Skip to content

Commit

Permalink
Fixed mainpage top bar and added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhPhan8803 committed Nov 27, 2022
1 parent da40ee1 commit c19d69f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 37 deletions.
76 changes: 39 additions & 37 deletions src/frontend/src/components/SingleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Typography, Card, CardContent } from '@material-ui/core';
import { Typography, Card, CardContent, Stack } from '@mui/material';
import { CardActionArea } from '@mui/material';
import { AptType } from './Types';

Expand Down Expand Up @@ -30,43 +30,45 @@ const SingleCard = ({
}
>
<CardContent style={{ height: '175px' }}>
<Stack>
{/*<Button size="small">Learn More</Button>*/}
<Typography
gutterBottom
variant="h5"
style={{ float: 'left', marginLeft: '30px' }}
component="div"
>
{name}
</Typography>
<Typography
gutterBottom
variant="body1"
style={{ float: 'right', marginTop: '5px' }}
>
{address}
</Typography>
<Typography
gutterBottom
variant="body2"
style={{ float: 'left' }}
>
{/*review*/}
</Typography>
<Typography
gutterBottom
variant="body2"
style={{ float: 'right' }}
>
${price_min}-${price_max}
</Typography>
<Typography
gutterBottom
variant="body2"
style={{ float: 'left' }}
>
{/* {rating} */}
</Typography>
<Typography
gutterBottom
variant="h5"
style={{ float: 'left', marginLeft: '30px' }}
component="div"
>
{name}
</Typography>
<Typography
gutterBottom
variant="body1"
style={{ float: 'right', marginTop: '5px' }}
>
{address}
</Typography>
<Typography
gutterBottom
variant="body2"
style={{ float: 'left' }}
>
{/*review*/}
</Typography>
<Typography
gutterBottom
variant="body2"
style={{ float: 'right' }}
>
${price_min}-${price_max}
</Typography>
<Typography
gutterBottom
variant="body2"
style={{ float: 'left' }}
>
{/* {rating} */}
</Typography>
</Stack>
</CardContent>
</CardActionArea>
</Card>
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/components/user/getReviewedApts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { AptType } from '../Types';
const baseURL = 'http://127.0.0.1:5000/user';

export default function getReviewedApts(username: string) {
// Get apts that username reviewed
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);
const emptyarray: AptType[] = [];
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function MainPage() {
return (
<>
<Stack spacing={2}>
{/* Top bar */}
<AppBar component="nav">
<Toolbar>
<Grid container spacing={0}>
Expand Down Expand Up @@ -71,6 +72,7 @@ function MainPage() {
</Toolbar>
</AppBar>
<Grid container spacing={3}>
{/* Search bar and rest of the components */}
<Grid item xs={12}>
<Box
display="flex"
Expand Down
7 changes: 7 additions & 0 deletions src/frontend/src/pages/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function User() {
<>
<Stack spacing={1}>
<AppBar component="nav">
{/*Renders top bar*/}
<Toolbar>
<Grid container spacing={0}>
<Grid item>
Expand Down Expand Up @@ -81,6 +82,7 @@ export default function User() {
</Toolbar>
</AppBar>
<Grid container spacing={2}>
{/*Headers*/}
<Grid item xs={4}>
<Box display="flex" justifyContent="center">
<Typography variant="h4">User</Typography>
Expand All @@ -93,6 +95,7 @@ export default function User() {
</Grid>
</Grid>
<Grid container spacing={2}>
{/* User info and list of reviewed apts */}
<Grid item xs={4}>
<FormUser />
<Button variant="outlined" style={btnstyle}>
Expand All @@ -115,6 +118,7 @@ function FormUser() {
const user_info = getUser('Zongxian');
return (
<React.Fragment>
{/* Form UI for user info */}
<List>
<ListItem>
<ListItemAvatar>
Expand Down Expand Up @@ -145,6 +149,7 @@ function FormEmail({ email }: EmailComponentProps) {
const [newEmail, setNewEmail] = useState('');
return (
<React.Fragment>
{/* Email box changes based on click */}
{editEmail == false && (
<ListItem>
<ListItemAvatar>
Expand Down Expand Up @@ -217,6 +222,7 @@ function FormPhone({ phone }: PhoneComponentProps) {
const [newPhone, setNewPhone] = useState('');
return (
<React.Fragment>
{/* Phone box changes based on click */}
{editPhone == false && (
<ListItem>
<ListItemAvatar>
Expand Down Expand Up @@ -287,6 +293,7 @@ function FormLikedApts() {
const reviewed_apts = getReviewedApts('Zongxian');
return (
<React.Fragment>
{/* UI for liked apartments */}
<Box>
<Stack spacing={2}>
{reviewed_apts.apartments.map((apt, i) => {
Expand Down

3 comments on commit c19d69f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
app.py1332780%55–82
config.py10100% 
decorators.py270100% 
dataholders
   apt.py90100% 
   mainpage_get.py150100% 
   review.py70100% 
   user.py80100% 
pages
   login.py290100% 
   mainpage.py1000100% 
   userpage.py540100% 
TOTAL3832793% 

Tests Skipped Failures Errors Time
48 0 💤 3 ❌ 0 🔥 0.822s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
app.py1332780%55–82
config.py10100% 
decorators.py270100% 
dataholders
   apt.py90100% 
   mainpage_get.py150100% 
   review.py70100% 
   user.py80100% 
pages
   login.py290100% 
   mainpage.py1000100% 
   userpage.py540100% 
TOTAL3832793% 

Tests Skipped Failures Errors Time
48 0 💤 3 ❌ 0 🔥 0.791s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
app.py1332780%55–82
config.py10100% 
decorators.py270100% 
dataholders
   apt.py90100% 
   mainpage_get.py150100% 
   review.py70100% 
   user.py80100% 
pages
   login.py290100% 
   mainpage.py1000100% 
   userpage.py540100% 
TOTAL3832793% 

Tests Skipped Failures Errors Time
48 0 💤 3 ❌ 0 🔥 0.828s ⏱️

Please sign in to comment.