Rename title to name
This commit is contained in:
parent
ee4f7f5f10
commit
7e9ff1dfb9
|
@ -3,3 +3,4 @@ links.db
|
|||
password.txt
|
||||
/.vs
|
||||
/.vscode
|
||||
/links.json
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { useRef, useState } from "react";
|
|||
import { Draggable } from "react-beautiful-dnd";
|
||||
|
||||
export type EditableLink = {
|
||||
title: string;
|
||||
name: string;
|
||||
url: string;
|
||||
active: boolean;
|
||||
clicks: number;
|
||||
|
@ -56,7 +56,7 @@ const Link: React.FC<LinkProps> = ({ index, link, onChange, onDelete }) => {
|
|||
type="text"
|
||||
placeholder="Edit Title"
|
||||
value={link.title}
|
||||
onChange={(e) => onChange({ ...link, title: e.target.value })}
|
||||
onChange={(e) => onChange({ ...link, name: e.target.value })}
|
||||
/>
|
||||
|
||||
<input
|
||||
|
|
|
@ -29,7 +29,7 @@ const Editor: React.FC<EditorProps> = ({ links, setLinks }) => {
|
|||
setFormState([
|
||||
...formState,
|
||||
{
|
||||
title: "",
|
||||
name: "",
|
||||
url: "",
|
||||
clicks: 0,
|
||||
active: true,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React from "react";
|
||||
import { useEffect } from "react";
|
||||
|
||||
interface Link {
|
||||
title: string;
|
||||
export interface Link {
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
interface LinkProps {
|
||||
|
@ -36,7 +36,7 @@ const Links: React.FC<LinkProps> = ({ links }) => {
|
|||
<img className="mb-3" src="csc_logo.png" alt="CSC Logo" width="100px" />
|
||||
<h1 className="font-bold">@uwcsclub</h1>
|
||||
<ul className="flex flex-col my-6 w-full">
|
||||
{links.map(({ title, url }, i) => (
|
||||
{links.map(({ name, url }, i) => (
|
||||
<li key={i} className="w-full contents">
|
||||
<a
|
||||
className="btn bg-gray-450 p-3 text-white font-bold text-center self-center my-1.5
|
||||
|
@ -47,7 +47,7 @@ const Links: React.FC<LinkProps> = ({ links }) => {
|
|||
rel="noreferrer"
|
||||
onClick={handleClick}
|
||||
>
|
||||
{title}
|
||||
{name}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
|
|
|
@ -15,13 +15,13 @@ export const getStaticProps: GetStaticProps = async () => {
|
|||
props: {
|
||||
data: [
|
||||
{
|
||||
title: "dummlink1",
|
||||
name: "dummlink1",
|
||||
url: "www.helloworld.com",
|
||||
clicks: 0,
|
||||
active: true,
|
||||
},
|
||||
{
|
||||
title: "dummlink2",
|
||||
name: "dummlink2",
|
||||
url: "www.hiworld.com",
|
||||
clicks: 0,
|
||||
active: true,
|
||||
|
|
Loading…
Reference in New Issue