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

monique/delivery-order-confirmation-page #71

Merged
merged 3 commits into from
Apr 8, 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
103 changes: 57 additions & 46 deletions src/app/orderConfirmationDelivery/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
fetchCurrentUserAddress,
} from '@/api/supabase/queries/user_queries';

import { Body2, Heading3Bold } from '@/styles/fonts';
import { Body1, Body2Light, Heading3Bold, Heading4Bold } from '@/styles/fonts';
import BackButton from '../../components/BackButton/BackButton';

import { fetchCartItemsWithQuantity } from '../../api/supabase/queries/cart_queries';
Expand All @@ -16,16 +16,21 @@ import NavBar from '../../components/NavBarFolder/NavBar';
import {
FavoriteDiv,
OutterFavoriteDiv,
OutterBox,
Label,

LabelBox,
ScrollDiv,
DateText,
CenterBox,
AddressDiv,
ShippingDetailsDiv,
BottomColumnDiv,
LeftColumnDiv,
RightColumnDiv,
DetailsHeader,
PageDiv,
CenterDiv,

} from './styles';

import { Product, User, Address } from '../../schema/schema';
import { Body1Bold } from '../orderPage/styles';

export default function OrderConfirmationDelivery() {
const [Cart, setCart] = useState<Product[]>([]);
Expand All @@ -50,46 +55,52 @@ export default function OrderConfirmationDelivery() {
}, []);

return (
<div>
<main>
<NavBar />

<BackButton destination="./storefront" />
<CenterBox>
<OutterBox>
<Heading3Bold>
Thank you, {user?.first_name}. Your order has been placed.
</Heading3Bold>
<OutterFavoriteDiv>
<DateText>Order No. {user?.cart_id}</DateText>
<ScrollDiv>
{Cart.map(cartItem => (
<FavoriteDiv key={cartItem.id}>
<img
src={cartItem.photo}
alt={cartItem.name}
style={{
width: '150px',
height: '150px',
marginLeft: '80px',
marginRight: '100px',
}}
/>
<LabelBox>
<Label>{cartItem.name}</Label>
<p>Category: {cartItem.category}</p>
</LabelBox>
</FavoriteDiv>
))}
</ScrollDiv>
<AddressDiv>
<Body2>
Shipping Address: {userAddress?.street}, {userAddress?.city},{' '}
{userAddress?.zipcode}
</Body2>
</AddressDiv>
</OutterFavoriteDiv>
</OutterBox>
</CenterBox>
</div>
<CenterDiv>
<PageDiv>
<BottomColumnDiv>
<LeftColumnDiv>
<BackButton destination="./storefront" />
<Heading3Bold>Your order has been submitted</Heading3Bold>
<OutterFavoriteDiv>
<Heading4Bold>Order No. {user?.cart_id}</Heading4Bold>
<ScrollDiv>
{Cart.map(cartItem => (
<FavoriteDiv key={cartItem.id}>
<img
src={cartItem.photo}
alt={cartItem.name}
style={{
width: '150px',
height: '150px',
marginLeft: '30px',
}}
/>
<LabelBox>
<Body1Bold>{cartItem.name}</Body1Bold>
<Body2Light>Category: {cartItem.category}</Body2Light>
</LabelBox>
</FavoriteDiv>
))}
</ScrollDiv>
</OutterFavoriteDiv>
</LeftColumnDiv>
<RightColumnDiv>
<ShippingDetailsDiv>
<Heading3Bold>Delivery Information</Heading3Bold>
<DetailsHeader>Estimated Date</DetailsHeader>
<Body1>date</Body1>
<DetailsHeader>Location</DetailsHeader>
<Body1>
{userAddress?.street}, {userAddress?.city},{' '}
{userAddress?.zipcode}
</Body1>
</ShippingDetailsDiv>
</RightColumnDiv>
</BottomColumnDiv>
</PageDiv>
</CenterDiv>
</main>
);
}
156 changes: 129 additions & 27 deletions src/app/orderConfirmationDelivery/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@ import NavBar from '../../components/NavBarFolder/NavBar';
export const FavoriteDiv = styled.div`
display: flex;
flex-direction: row;
align-items: start;
justify-content: space-start;
align-items: flex-start;
justify-content: flex-start;
width: 100%;
margin-bottom: 50px;
margin-top: 30px;
gap: 120px;
`;

export const OrderDetailsDiv = styled.div`
width: 750px;
height: auto;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
`;

export const CenterDiv = styled.div`
display: flex;
align-items: center;
justify-content: center;
width: 100%;
`;

export const OutterFavoriteDiv = styled.div`
Expand All @@ -21,10 +38,13 @@ export const OutterFavoriteDiv = styled.div`
border-radius: 10px;
background: var(--White, #fff);
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.2);
width: 800px;
width: 650px;
height: auto;
max-height: 600px;
margin-top: 10px;
max-height: 793px;
margin-top: 5px;
margin-bottom: 50px;
gap: 24px;
padding: 36px 32px;
`;

export const ScrollDiv = styled.div`
Expand All @@ -42,10 +62,11 @@ export const BackDiv = styled.button`
margin-bottom: 25px;
margin-top: 25px;
margin-left: 25px;
width: 100%;
`;

export const OutterBox = styled.div`
width: 900px;
width: 750px;
height: auto;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -80,18 +101,20 @@ export const NavBarMovedUP = styled(NavBar)`
`;

export const Label = styled.p`
margin-top: 20px;
margin-top: 9px;
`;

export const Category = styled.p`
margin-top: 10px;
`;

export const LabelBox = styled.div`
width: 150px;
height: 100%;
`;

export const CenterBox = styled.div`
display: flex;
justify-content: center;
height: 700px;
align-self: center;
flex-direction: column;
gap: 9px;
`;

export const HeaderText = styled.h3`
Expand All @@ -107,31 +130,110 @@ export const HeaderText = styled.h3`
line-height: normal;
`;

export const AddressText = styled.p`
export const ShippingDetailsDiv = styled.div`
display: flex;
flex-direction: column;
align-items: space-start;
border-radius: 10px;
background: var(--White, #fff);
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.2);
width: 467px;
height: auto;
max-height: 793px;
margin-top: 10px;
margin-bottom: 50px;
padding: 36px 34px;
gap: 33px;
`;

export const DetailsHeader = styled.p`
color: var(--Navy, #1b3679);
font-family: Public Sans, sans-serif;
font-size: 20px;
font-style: normal;
font-weight: 700;
line-height: normal;
`;

export const DetailsText = styled.p`
color: var(--Black, #101010);
font-family: Public Sans;
font-size: 17px;
font-style: normal;
font-weight: 400;
line-height: normal;
margin-top: 20px;
`;

export const BottomColumnDiv = styled.div`
display: flex;
flex-flow: row;
align-items: space-evenly;
justify-content: space-around;
width: 100%;
`;

export const PageDiv = styled.div`
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
width: 100%;
`;

export const TopColumnDiv = styled.div`
display: flex;
flex-flow: column;
align-items: flex-start;
justify-content: space-around;
margin-bottom: 20px;
margin-left: 45px;
`;

export const DateText = styled.p`
color: var(--Black, #101010);
margin-top: 20px;
margin-left: 45px;
font-family: Public Sans;
font-size: 25px;
font-style: normal;
font-weight: 700;
line-height: normal;
text-decoration-line: underline;
export const OrderSummaryDiv = styled.div`
overflow: scroll;
width: 350px;
height: 300px;
`;

export const ItemSummaryDiv = styled.div`
display: flex;
flex-direction: row;
margin-bottom: 20px;
justify-content: space-between;
padding-left: 10px;
padding-right: 10px;
`;

export const AddressDiv = styled.div`
position: relative;
export const OrderTotalDiv = styled.div`
height: 50px;
padding-top: 10px;
width: 350px;
padding-left: 0px;
border-top: 1px black solid;
display: flex;
align-items: flex-end;
flex-flow: row;
justify-content: space-between;
`;

export const LeftColumnDiv = styled.div`
display: flex;
flex-flow: column;
justify-content: space-evenly;
align-items: space-evenly;
`;
export const RightColumnDiv = styled.div`
display: flex;
flex-flow: column;
margin-left: 20px;
margin-top: 127px;
`;

export const WhiteBackgroundDiv = styled.div`
border-radius: 8px;
background: var(--White, #fff);
height: 430px;
width: 350px;
padding-top: 20px;

box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.1);
`;
1 change: 1 addition & 0 deletions src/components/BackButton/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const BackDiv = styled.button`
&:hover {
text-decoration: underline;
}

`;

export const ImageWithSize = styled(Image)`
Expand Down
Loading