diff --git a/meshapp/src/components/home-logged-in/homePage.tsx b/meshapp/src/components/home-logged-in/homePage.tsx index eedb0461..f39bf087 100644 --- a/meshapp/src/components/home-logged-in/homePage.tsx +++ b/meshapp/src/components/home-logged-in/homePage.tsx @@ -3,17 +3,14 @@ import ErrorOutline from "@mui/icons-material/ErrorOutline"; import group_image from "../../assets/media/group_image.png"; import { paths } from "../../Routing/RoutePaths"; import { Link as RouterLink } from "react-router-dom"; + export default function homePage() { /*-----------------Group image container------------*/ const imgContainer = ( - group_image + group_image ); @@ -54,7 +51,7 @@ export default function homePage() { const topText = () => { return ( - + { return ( - + {imgAlertItem()} {topText()} - {/*-----------Grid item for bottom text & swipe button----------------*/} - - - {bottomTextItem()} - {swipeButton()} - + + {bottomTextItem()} + {swipeButton()} diff --git a/meshapp/src/home/logged-in/LoggedInHome.tsx b/meshapp/src/home/logged-in/LoggedInHome.tsx index 21269cc0..409c7eb3 100644 --- a/meshapp/src/home/logged-in/LoggedInHome.tsx +++ b/meshapp/src/home/logged-in/LoggedInHome.tsx @@ -25,13 +25,13 @@ function homeTheme() { fontSize: "23px", }, "@media (min-width:600px)": { - fontSize: "20px", + fontSize: "24px", }, "@media (min-width:900px)": { fontSize: "31px", }, "@media (min-width:1200px)": { - fontSize: "42px", + fontSize: "43px", }, "@media (min-width: 1536px)": { fontSize: "55px", @@ -46,13 +46,13 @@ function homeTheme() { fontSize: "20px", }, "@media (min-width:600px)": { - fontSize: "13px", + fontSize: "17px", }, "@media (min-width:900px)": { fontSize: "23px", }, "@media (min-width:1200px)": { - fontSize: "25px", + fontSize: "29px", }, "@media (min-width: 1536px)": { fontSize: "38px", @@ -70,9 +70,9 @@ function homeTheme() { fontSize: "10px", }, "@media (min-width:900px)": { - fontSize: "15px", + fontSize: "14px", }, - "@media (min-width:1000px)": { + "@media (min-width:1200px)": { fontSize: "16px", }, "@media (min-width: 1536px)": { diff --git a/meshapp/src/index.tsx b/meshapp/src/index.tsx index 425311ca..7d31befe 100644 --- a/meshapp/src/index.tsx +++ b/meshapp/src/index.tsx @@ -13,7 +13,6 @@ root.render( - diff --git a/meshapp/src/profile/profile-occupation.tsx b/meshapp/src/profile/profile-occupation.tsx new file mode 100644 index 00000000..acdfb7e4 --- /dev/null +++ b/meshapp/src/profile/profile-occupation.tsx @@ -0,0 +1,126 @@ +import { useState } from "react"; +import { Grid, Typography, createTheme, ThemeProvider } from "@mui/material"; + +import EditIcon from "@mui/icons-material/Edit"; +import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos"; + +import ProfileTextField from "./profile-textfield"; + +const theme = createTheme({ + palette: { + mode: "light", + primary: { + main: "#0b7d66", + }, + }, + typography: { + h1: { + fontFamily: "cocogoose", + fontWeight: "bold", + color: "#26383A", + }, + }, +}); + +/** + * Displays the user's current occupation. + * + * @param props - Properties of the component + * @param {string} props.occupationTitle - Title of user's occupation + * @param {string} props.occupationBusiness - Name of business/org the user affiliates with + */ +export default function ProfileOccupation(props: { + occupationTitle: string; + occupationBusiness: string; +}) { + const [editMode, setEditMode] = useState(false); + const [occupationTitle, setOccupationTitle] = useState(props.occupationTitle); + const [occupationBusiness, setOccupationBusiness] = useState( + props.occupationBusiness + ); + + const handleEditClick = () => { + setEditMode(true); + }; + + const handleBackClick = () => { + setEditMode(false); + }; + + //TODO: Retrieve and store occupation + function saveTitle(text: string) { + setOccupationTitle(text); + } + + function saveBusiness(text: string) { + setOccupationBusiness(text); + } + + /** + * Displays the user's occupation in edit mode. + */ + const EditOccupation = () => { + return ( + + + + + + + + + ); + }; + + return ( + + + {editMode ? ( + + + + + + + ) : ( + + + {occupationTitle}, {occupationBusiness} + + + + )} + + + ); +} diff --git a/meshapp/src/profile/profile-page.tsx b/meshapp/src/profile/profile-page.tsx index 0d499b1f..e32a4f33 100644 --- a/meshapp/src/profile/profile-page.tsx +++ b/meshapp/src/profile/profile-page.tsx @@ -8,6 +8,7 @@ import { Chip, } from "@mui/material"; +import ProfileOccupation from "./profile-occupation"; import ProfileTextField from "./profile-textfield"; import ProfilePicture from "./profile-picture"; import { Education, Profile } from "./types/profile"; @@ -139,28 +140,6 @@ const ProfilePage = (props: Profile) => { * @param {string} props.pronouns - Pronouns used by user */ -/** - * Displays the user's current occupation. - * - * @param props - Properties of the component - * @param {string} props.occupationTitle - Title of user's occupation - * @param {string} props.occupationBusiness - Name of business/org the user affiliates with - */ -const ProfileOccupation = (props: { - occupationTitle: string; - occupationBusiness: string; -}) => { - return ( - - - - {props.occupationTitle}, {props.occupationBusiness} - - - - ); -}; - /** * Displays the user's biography. It also has a max character limit of 300. * @@ -212,8 +191,9 @@ const ProfileBiography = (props: { biography: string; accountID: number }) => { { const TestComponent = (props: any) => { return ( { return; diff --git a/meshapp/src/profile/profile-textfield.tsx b/meshapp/src/profile/profile-textfield.tsx index 66c16085..e24aa173 100644 --- a/meshapp/src/profile/profile-textfield.tsx +++ b/meshapp/src/profile/profile-textfield.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { TextField, Box } from "@mui/material"; +import { TextField, Box, TextFieldVariants } from "@mui/material"; import EditIcon from "@mui/icons-material/Edit"; import SaveIcon from "@mui/icons-material/Save"; @@ -18,6 +18,7 @@ import SaveIcon from "@mui/icons-material/Save"; * @param {function} props.handleSave - Callback to save data */ const ProfileTextField = (props: { + variant: TextFieldVariants; label: string; placeholder: string; text: string; @@ -47,7 +48,7 @@ const ProfileTextField = (props: { label={props.label} placeholder={props.placeholder} InputLabelProps={{ shrink: true }} - variant={"standard"} + variant={props.variant} InputProps={{ endAdornment: editMode ? ( @@ -90,7 +91,7 @@ const ProfileTextField = (props: { value={text} onChange={handleTextChange} sx={{ - "& .MuiOutlinedInput-root": { + "& .MuiInputBase-root": { "& fieldset": { transition: "border 0.10s ease-in-out", },