Skip to content

Commit

Permalink
add belinda's design images (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinpham5614 authored May 30, 2024
1 parent 2d4c026 commit c0e3fce
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
import Image from "next/image";
import logo from "app/logo.png";
import logo from "@/app/logo.png";
import {
Box,
Button,
Expand Down
Binary file removed app/favicon.ico
Binary file not shown.
Binary file added app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 36 additions & 36 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
'use client';
"use client";
import React from "react";
import Image from "next/image";
import logo from "./logo.png";
import google_play from "./google_play.png";
import CustomCardContent from "@/components/CustomCardContent";
import Grid from '@mui/material/Unstable_Grid2';
import Stack from '@mui/material/Stack';
import Card from '@mui/material/Card';
import { Container, Typography, Button } from '@mui/material';
import WrapperDiv from '../components/WrapperDiv'

import Grid from "@mui/material/Unstable_Grid2";
import Stack from "@mui/material/Stack";
import Card from "@mui/material/Card";
import { Container, Typography, Button } from "@mui/material";
import WrapperDiv from "../components/WrapperDiv";
import { categories } from "@/components/CategoryImages";
// TEMPORARY CATEGORIES LIST
const placeholderImg = logo;
const categories = [
{'type': 'Shirts', 'image': placeholderImg},
{'type': 'Shoes', 'image': placeholderImg},
{'type': 'Pants', 'image': placeholderImg},
{'type': 'Skirts', 'image': placeholderImg},
{'type': 'Suits', 'image': placeholderImg},
{'type': 'Dress', 'image': placeholderImg},
{'type': 'Casual Wear', 'image': placeholderImg},
{'type': 'Accessories', 'image': placeholderImg},
{'type': 'Jacket/Blazer', 'image': placeholderImg},
]

const Home = () => {
return (
<WrapperDiv>
<Container disableGutters fixed maxWidth="xs" sx={{width: "15%"}}>
<Container disableGutters fixed maxWidth="xs" sx={{ width: "15%" }}>
<Image src={logo} alt="logo" width={100} />
</Container>
<Typography component='h1' variant='h3'>
<Typography component="h1" variant="h3">
Belinda&apos;s Closet
</Typography>
<Stack direction="row" spacing={2}>
<Button href="/auth/sign-in" component='a' variant="contained">Sign In</Button>
<Button href="/auth/sign-up" component='a' variant="contained">Sign Up</Button>
<Button href="/auth/sign-in" component="a" variant="contained">
Sign In
</Button>
<Button href="/auth/sign-up" component="a" variant="contained">
Sign Up
</Button>
</Stack>
{/* download mobile app link */}
<Button component='a' href="" variant="outlined" startIcon={<Image src={google_play} alt="google_play" />}>
<Button
component="a"
href=""
variant="outlined"
startIcon={<Image src={google_play} alt="google_play" />}
>
Download App
</Button>
<Grid container spacing={2}>
{categories.map((category, index)=>(
<Grid xs={12} md={6} lg={4} component="div" key={index}>
<Card>
<CustomCardContent title={category.type} image={placeholderImg} />
</Card>
</Grid>
))}
</Grid>
</WrapperDiv>
<Grid container spacing={2}>
{categories.map((category, index) => (
<Grid xs={12} md={6} lg={4} component="div" key={index}>
<Card>
<CustomCardContent
id={category.id}
title={category.title}
alt={category.alt}
/>
</Card>
</Grid>
))}
</Grid>
</WrapperDiv>
);
};

export default Home;
export default Home;
51 changes: 51 additions & 0 deletions components/CategoryImages.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Image from "next/image";

// Categories list
export const categories = [
{ id: "shirt", title: "Shirts", alt: "Shirt category image" },
{ id: "shoe", title: "Shoes", alt: "Shoe category image" },
{ id: "pants", title: "Pants", alt: "Pants category image" },
{ id: "skirt", title: "Skirts", alt: "Skirt category image" },
{ id: "suit", title: "Suits", alt: "Suit category image" },
{ id: "dress", title: "Dress", alt: "Dress category image" },
{ id: "casual", title: "Casual Wear", alt: "Casual Wear category image" },
{ id: "accessories", title: "Accessories", alt: "Accessories category image" },
{ id: "jacket", title: "Jacket/Blazer", alt: "Jacket/Blazer category image" },
];

// Category component
export function Category({
id,
title,
alt,
}: {
id: string;
title: string;
alt: string;
}) {
return (
<Image
src={`/categories-images/${id}.png`}
title={title}
alt={alt}
width={100}
height={100}
/>
);
}

// CategoryImages component
export function CategoryImages() {
return (
<div>
{categories.map((category, index) => (
<Category
key={index}
id={category.id}
title={category.title}
alt={category.alt}
/>
))}
</div>
);
}
48 changes: 24 additions & 24 deletions components/CustomCardContent.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import Image, { StaticImageData } from "next/image";
import React from "react";
import { CardActionArea, Typography } from '@mui/material';
import { CardActionArea, Typography } from "@mui/material";
import { useRouter } from "next/navigation";
import CardContent from '@mui/material/CardContent';
import CardContent from "@mui/material/CardContent";
import { Category } from "./CategoryImages";

// TODO: CHANGE types to match final DB
type CategoryCardProps = {
title: string;
image: StaticImageData;
id: string;
title: string;
alt: string;
};

const CustomCardContent: React.FC<CategoryCardProps> =({title, image})=>{
const router = useRouter();
const navigate=()=>{
const encodedCategoryId = encodeURIComponent(title); //sanitize item name for route
router.push(`/category-page/${encodedCategoryId}`);
}
return (
<CardActionArea onClick={() => navigate()}>
<CardContent>
<Image src={image} alt="logo" width={100} />
<Typography variant='h5' align='center' gutterBottom>
{title}
</Typography>
</CardContent>
</CardActionArea>
)
}
const CustomCardContent: React.FC<CategoryCardProps> = ({ id, title, alt }) => {
const router = useRouter();
const navigate = () => {
const encodedCategoryId = encodeURIComponent(title); //sanitize item name for route
router.push(`/category-page/${encodedCategoryId}`);
};
return (
<CardActionArea onClick={() => navigate()}>
<CardContent>
<Category id={id} title={title} alt={alt} />
<Typography variant="h5" align="center" gutterBottom>
{title}
</Typography>
</CardContent>
</CardActionArea>
);
};

export default CustomCardContent;
export default CustomCardContent;
4 changes: 2 additions & 2 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function Navbar() {
<Box sx={{ textAlign: "center" }}>
<Link href="/" passHref>
<Button color="secondary">
<Image src={logo} alt="logo" width={50} height={50} />
<Image src={logo} alt="logo" width={70} height={50} />
</Button>
</Link>
<Divider />
Expand Down Expand Up @@ -122,7 +122,7 @@ export default function Navbar() {
<Box sx={{ flexGrow: 1 }}>
<Link href="/" passHref>
<Button color="secondary">
<Image src={logo} alt="logo" width={50} height={50} />
<Image src={logo} alt="logo" width={70} height={50}/>
</Button>
</Link>
</Box>
Expand Down
Binary file added public/categories-images/accessories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/casual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/dress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/jacket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/pants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/shoe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/skirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/categories-images/suit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c0e3fce

Please sign in to comment.