diff --git a/frontend/src/main-page/MainPage.tsx b/frontend/src/main-page/MainPage.tsx index 5c96ac0..950a7de 100644 --- a/frontend/src/main-page/MainPage.tsx +++ b/frontend/src/main-page/MainPage.tsx @@ -4,6 +4,7 @@ import GrantPage from "./grants/GrantPage"; import Header from "./header/Header"; import Users from "./users/Users"; import RestrictedPage from "./restricted/RestrictedPage"; +import Settings from "./settings/Settings"; function MainPage() { @@ -18,6 +19,7 @@ function MainPage() { } /> } /> } /> + } /> {/* fallback route */} } /> diff --git a/frontend/src/main-page/settings/Settings.tsx b/frontend/src/main-page/settings/Settings.tsx new file mode 100644 index 0000000..1753fef --- /dev/null +++ b/frontend/src/main-page/settings/Settings.tsx @@ -0,0 +1,77 @@ +import Button from "./components/Button"; +import InfoCard from "./components/InfoCard"; +import logo from "../../images/logo.svg"; + +export default function Settings() { + return ( +
+

Settings

+ +
+
+ {/* Avatar */} + Profile + + {/* Buttons + helper text */} +
+

Profile Picture

+
+ +
+ +

+ We support PNGs, JPEGs, and PDFs under 10 MB +

+
+
+
+ + alert("edit personal info")} + className="bg-white text-black border-2 border-grey-500" + /> + } + fields={[ + { label: "First Name", value: "John" }, + { label: "Last Name", value: "Doe" }, + { label: "Email Address", value: "john.doe@gmail.com" }, + ]} + /> + +
+
+

Change Password

+

+ Re-enter your current password in order to change your password. +

+
+ +
+
+ ); +} diff --git a/frontend/src/main-page/settings/components/Button.tsx b/frontend/src/main-page/settings/components/Button.tsx new file mode 100644 index 0000000..2da0f16 --- /dev/null +++ b/frontend/src/main-page/settings/components/Button.tsx @@ -0,0 +1,34 @@ +type ButtonProps = { + text: string; + onClick: () => void; + className?: string; + logo?: string; + logoPosition?: 'left' | 'right'; +} + + +// Button component where you can pass in text, onClick handler, optional className +// for styling, and an optional logo with its position. +//Styling is default, but can be overridden by passing in a className prop +export default function Button({ text, onClick, className, logo, logoPosition }: ButtonProps) { + return ( + + ); +} \ No newline at end of file diff --git a/frontend/src/main-page/settings/components/InfoCard.tsx b/frontend/src/main-page/settings/components/InfoCard.tsx new file mode 100644 index 0000000..a8ffa24 --- /dev/null +++ b/frontend/src/main-page/settings/components/InfoCard.tsx @@ -0,0 +1,40 @@ +import type { ReactNode } from "react"; + +type InfoField = { + label: string; + value: string; +}; + +type InfoCardProps = { + title?: string; + fields: InfoField[]; + action?: ReactNode; +}; + +export default function InfoCard({ title, fields, action }: InfoCardProps) { + return ( +
+ {(title || action) && ( +
+ {title && ( +

+ {title} +

+ )} + {action} +
+ )} + +
+ {fields.map((field) => ( +
+

{field.label}

+

+ {field.value} +

+
+ ))} +
+
+ ); +}