Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrapping home and sign in / up #138

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions src/components/shared/mui/media-card/media-card.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,22 @@ export default function MediaCard({ styles, header, imageUrl, imageTitle, path,
const navigate = useNavigate()

return (
<Card sx={{ margin: "1%", ...styles }} onClick={ () => navigate(path) }>
<CardMediaContainer>
<CardMedia
<Card sx={{ ...styles }} onClick={ () => navigate(path) }>
<CardMedia
// sx={{ height: styles.height }}
// src={ "https://buffer.com/library/content/images/2023/10/free-images.jpg" }
title={`${imageTitle}`}
/>
<img src={`${imageUrl}`} alt={ `${imageTitle}` } width={ styles.width } height={ styles.height * 0.66 } objectFit={ "contain" }/>
<CardContent>
<img src={`${imageUrl}`} alt={ `${imageTitle}` } width={ styles.width } height={ styles.height * 0.67 } objectFit={ "contain" }/>
<CardMediaContainer>
<CardContent sx={{ height: styles.height }}>
<Typography gutterBottom variant="h5" component="div">
{ header }
</Typography>
<Typography variant="body2" color="text.secondary">
{ content }
</Typography>
</CardContent>

<CardActions>
{/* <Button size="small">Share</Button> */}
<Button size="small">
<Link to={ path }>
Learn More
</Link>
</Button>
</CardActions>
</CardMediaContainer>
</Card>
);
Expand Down
16 changes: 11 additions & 5 deletions src/components/signed-out/sign-in-form/sign-in-form.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,19 @@ const SignInForm = () => {
<FormInput label="Password" type="password" required onChange={ handleChange }
name="password" value={ password }/>

<div className="buttons-container">
<Button type="submit">Sign In</Button>
<Button buttonType="google-sign-in" type="button"
onClick={ signInWithGoogle }>Google Sign In</Button>
<div className="container">
<div className="row justify-content-evenly align-items-center">
<div className="col-sm-12 col-md-2 button-container">
<Button type="submit">Sign In</Button>
</div>

<div className="col-sm-12 col-md-2 button-container">
<Button buttonType="google-sign-in" type="button"
onClick={ signInWithGoogle }>Google Sign In</Button>
</div>
</div>
</div>
</form>

</div>
);
};
Expand Down
15 changes: 8 additions & 7 deletions src/components/signed-out/sign-in-form/sign-in-form.styles.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
.sign-in-container {
display: flex;
flex-direction: column;
width: 400px;
margin-top: 2%;
display: block;
// flex-direction: column;
justify-content: center;
align-items: center;
// width: 400px;
margin: 2% 20% 2% 20%;

h2 {
margin: 10px 0;
}

.buttons-container {
display: flex;
justify-content: space-between;
.button-container {
width: 400px;
margin-bottom: 4%;
}
}
10 changes: 6 additions & 4 deletions src/components/signed-out/sign-up-form/sign-up-form.styles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.sign-up-container {
display: flex;
flex-direction: column;
width: 380px;
margin-top: 2%;
display: block;
// flex-direction: column;
justify-content: center;
align-items: center;
// width: 380px;
margin: 2% 20% 2% 20%;

h2 {
margin: 10px 0;
Expand Down
73 changes: 45 additions & 28 deletions src/pages/shared/home/home.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { selectCurrentUser } from "../../../store/shared/user/user.selector.js";
import { COLOR_CODES, NAV_LINKS } from "../../../utils/constants/shared.constants.js";

const styles = {
width: 475,
height: 500,
backgroundColor: COLOR_CODES.general["0"]
width: 350,
height: 450,
backgroundColor: COLOR_CODES.general["0"],
marginBottom: "6%"
}

const Home = () => {
Expand Down Expand Up @@ -79,38 +80,54 @@ const Home = () => {

return (
<Fragment>
<HomeContainer>
<MediaCard styles={ styles } header={ homeCardContent.chatbot.header } imageUrl={ homeCardContent.chatbot.imageUrl }
imageTitle={ homeCardContent.chatbot.header } path={ homeCardContent.chatbot.path } content={ homeCardContent.chatbot.description }></MediaCard>
<div className="container">
<div className="row justify-content-center align-items-center">
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.chatbot.header } imageUrl={ homeCardContent.chatbot.imageUrl }
imageTitle={ homeCardContent.chatbot.header } path={ homeCardContent.chatbot.path } content={ homeCardContent.chatbot.description }></MediaCard>
</div>

<MediaCard styles={ styles } header={ homeCardContent.storage.header } imageUrl={ homeCardContent.storage.imageUrl }
imageTitle={ homeCardContent.storage.header } path={ homeCardContent.storage.path } content={ homeCardContent.storage.description }></MediaCard>

<MediaCard styles={ styles } header={ homeCardContent.nutrientPredictor.header } imageUrl={ homeCardContent.nutrientPredictor.imageUrl }
imageTitle={ homeCardContent.nutrientPredictor.header } path={ homeCardContent.nutrientPredictor.path } content={ homeCardContent.nutrientPredictor.description }></MediaCard>
</HomeContainer>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.storage.header } imageUrl={ homeCardContent.storage.imageUrl }
imageTitle={ homeCardContent.storage.header } path={ homeCardContent.storage.path } content={ homeCardContent.storage.description }></MediaCard>
</div>

<HomeContainer>
<MediaCard styles={ styles } header={ homeCardContent.nutritionTracker.header } imageUrl={ homeCardContent.nutritionTracker.imageUrl }
imageTitle={ homeCardContent.nutritionTracker.header } path={ homeCardContent.nutritionTracker.path } content={ homeCardContent.nutritionTracker.description }></MediaCard>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.nutrientPredictor.header } imageUrl={ homeCardContent.nutrientPredictor.imageUrl }
imageTitle={ homeCardContent.nutrientPredictor.header } path={ homeCardContent.nutrientPredictor.path } content={ homeCardContent.nutrientPredictor.description }></MediaCard>
</div>

<MediaCard styles={ styles } header={ homeCardContent.fitness.header } imageUrl={ homeCardContent.fitness.imageUrl }
imageTitle={ homeCardContent.fitness.header } path={ homeCardContent.fitness.path } content={ homeCardContent.fitness.description }></MediaCard>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.nutritionTracker.header } imageUrl={ homeCardContent.nutritionTracker.imageUrl }
imageTitle={ homeCardContent.nutritionTracker.header } path={ homeCardContent.nutritionTracker.path } content={ homeCardContent.nutritionTracker.description }></MediaCard>
</div>

<MediaCard styles={ styles } header={ homeCardContent.caloriesBurned.header } imageUrl={ homeCardContent.caloriesBurned.imageUrl }
imageTitle={ homeCardContent.caloriesBurned.header } path={ homeCardContent.caloriesBurned.path } content={ homeCardContent.caloriesBurned.description }></MediaCard>
</HomeContainer>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.fitness.header } imageUrl={ homeCardContent.fitness.imageUrl }
imageTitle={ homeCardContent.fitness.header } path={ homeCardContent.fitness.path } content={ homeCardContent.fitness.description }></MediaCard>
</div>

<HomeContainer>
<MediaCard styles={ styles } header={ homeCardContent.recipes.header } imageUrl={ homeCardContent.recipes.imageUrl }
imageTitle={ homeCardContent.recipes.header } path={ homeCardContent.recipes.path } content={ homeCardContent.recipes.description }></MediaCard>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.caloriesBurned.header } imageUrl={ homeCardContent.caloriesBurned.imageUrl }
imageTitle={ homeCardContent.caloriesBurned.header } path={ homeCardContent.caloriesBurned.path } content={ homeCardContent.caloriesBurned.description }></MediaCard>
</div>

<MediaCard styles={ styles } header={ homeCardContent.notifications.header } imageUrl={ homeCardContent.notifications.imageUrl }
imageTitle={ homeCardContent.notifications.header } path={ homeCardContent.notifications.path } content={ homeCardContent.notifications.description }></MediaCard>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.recipes.header } imageUrl={ homeCardContent.recipes.imageUrl }
imageTitle={ homeCardContent.recipes.header } path={ homeCardContent.recipes.path } content={ homeCardContent.recipes.description }></MediaCard>
</div>

<MediaCard styles={ styles } header={ homeCardContent.summary.header } imageUrl={ homeCardContent.summary.imageUrl }
imageTitle={ homeCardContent.summary.header } path={ homeCardContent.summary.path } content={ homeCardContent.summary.description }></MediaCard>
</HomeContainer>
<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.notifications.header } imageUrl={ homeCardContent.notifications.imageUrl }
imageTitle={ homeCardContent.notifications.header } path={ homeCardContent.notifications.path } content={ homeCardContent.notifications.description }></MediaCard>
</div>

<div className="col-sm-12 col-md-6 col-lg-4">
<MediaCard styles={ styles } header={ homeCardContent.summary.header } imageUrl={ homeCardContent.summary.imageUrl }
imageTitle={ homeCardContent.summary.header } path={ homeCardContent.summary.path } content={ homeCardContent.summary.description }></MediaCard>
</div>
</div>
</div>
</Fragment>
);
};
Expand Down
31 changes: 29 additions & 2 deletions src/routes/signed-out/authentication/authentication.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,38 @@ import "./authentication.styles.scss";
import SignInForm from "../../../components/signed-out/sign-in-form/sign-in-form.component";
import SignUpForm from "../../../components/signed-out/sign-up-form/sign-up-form.component";

import ItemTabs from "../../../components/shared/mui/tabs/tabs.component";
import LoginIcon from '@mui/icons-material/Login';
import AppRegistrationIcon from '@mui/icons-material/AppRegistration';

const AuthenticationRoute = () => {
const tabList = [
{
value: "sign-in-form",
icon: <LoginIcon/>,
label: "Sign In"
},
{
value: "sign-up-form",
icon: <AppRegistrationIcon/>,
label: "Register"
}
]

const panelList = [
{
value: "sign-in-form",
children: <SignInForm/>
},
{
value: "sign-up-form",
children: <SignUpForm/>
}
]

return (
<div className="authentication-container">
<SignInForm/>
<SignUpForm/>
<ItemTabs tabList={ tabList } panelList={ panelList }></ItemTabs>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.authentication-container {
display: flex;
width: 900px;
justify-content: space-between;
margin: 30px auto;
// display: flex;
// width: 900px;
// justify-content: space-between;
// margin: 30px auto;
}
Loading