Skip to content

Commit

Permalink
Deleted redundant props for MemberInformation.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
thea2506 committed Mar 15, 2024
1 parent 447a467 commit aedcc44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
10 changes: 1 addition & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,7 @@ const router = createBrowserRouter([
path: "/member-information-test",
element: (
<div className="flex flex-col gap-y-20 items-center justify-center w-full h-[100vh] bg-slate-400">
<MemberInformation
link="https://github.com/"
lastName="Nguyen"
/>
<MemberInformation
link="https://github.com/"
lastName="Nguyen"
errorText="Error message"
/>
<MemberInformation />
</div>
),
},
Expand Down
20 changes: 9 additions & 11 deletions src/components/MemberInformation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,20 @@ import {

//#region Interfaces
interface MemberInformationProps {
link: string;
lastName: string;
errorText?: string;
className?: string;
}
//#endregion

/**
* Renders a member information component.
* @param link - The link of the member.
* @param lastName - The last name of the member.
* @param errorText - The error text to be displayed.
* @returns
*/
const MemberInformation = ({
link,
lastName,
errorText,
}: MemberInformationProps) => {
const MemberInformation = ({ className }: MemberInformationProps) => {
const [lastName, setLastName] = useState<string>("Lastname");
const [link, setLink] = useState<string>("Link");
const [errorText, setErrorText] = useState<string>("Error message");

const [password, setPassword] = useState<string>();
const [copied, setCopied] = useState<boolean>(false);
const fields = [
Expand Down Expand Up @@ -72,7 +68,9 @@ const MemberInformation = ({
}, 2500);

return (
<div className="flex flex-col gap-y-4 w-[90vw] md:w-[50vw] max-w-2xl text-sm md:text-base bg-neutrals-light-100 p-8 rounded-lg font-display">
<div
className={`flex flex-col gap-y-4 w-[90vw] md:w-[50vw] max-w-2xl text-sm md:text-base bg-neutrals-light-100 p-8 rounded-lg font-display ${className}`}
>
{/* title */}
<div className="flex items-center text-xl md:text-2xl gap-x-2 font-semibold">
<WarningCircle size={28} />
Expand Down

0 comments on commit aedcc44

Please sign in to comment.