Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlotteLaw committed Apr 17, 2024
1 parent 7561742 commit db1f231
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 38 deletions.
7 changes: 5 additions & 2 deletions src/api/supabase/queries/button_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ export async function fetchButtonCategories(): Promise<StorefrontButtons[]> {
return buttons;
}

export async function convertButtonNumbertoCategory(id: string):Promise<string>{
export async function convertButtonNumbertoCategory(
id: string,
): Promise<string> {
const { data: buttonsCategory, error } = await supabase
.from('storefront_buttons')
.select('*')
.eq('id', id).single();
.eq('id', id)
.single();
if (error) {
throw new Error(`Error fetching category: ${error.message}`);
}
Expand Down
3 changes: 1 addition & 2 deletions src/api/supabase/queries/cart_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import supabase from '../createClient';
import { fetchUser } from './user_queries';
import { Product, ProductWithQuantity } from '../../../schema/schema';
import { fetchProductByID } from './product_queries';
import {convertButtonNumbertoCategory} from "./button_queries";
import { convertButtonNumbertoCategory } from './button_queries';
// define cart item type
export type CartItem = {
id: number;
Expand Down Expand Up @@ -203,7 +203,6 @@ export async function fetchCartItemsWithQuantity(): Promise<
category: await convertButtonNumbertoCategory(product.category),
};
});


const fetchedProducts = await Promise.all(productPromises);
console.log(fetchedProducts);
Expand Down
28 changes: 10 additions & 18 deletions src/app/orderConfirmationPickUp/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
ShippingDetailsDiv,
ImageDiv,
BottomColumnDiv,
Wrapper,
LeftColumnDiv,
RightColumnDiv,
DetailsHeader,
Expand Down Expand Up @@ -65,7 +64,6 @@ export default function OrderConfirmationPickUp() {

function organizePickupTime() {
const startTime = pickupTime?.start_time.toLocaleString();
const endTime = pickupTime?.end_time.toLocaleString();
const date =
startTime == null
? ['0', '0', '0']
Expand All @@ -87,7 +85,6 @@ export default function OrderConfirmationPickUp() {
<TextDiv>
<Heading3Bold>Your order has been submitted</Heading3Bold>
</TextDiv>

<OutterFavoriteDiv>
<TextDiv1>
<Heading4Bold>Order No. {user?.cart_id}</Heading4Bold>
Expand All @@ -96,40 +93,35 @@ export default function OrderConfirmationPickUp() {
{Cart.map(cartItem => (
<FavoriteDiv key={cartItem.id}>
<ImageDiv>
<img
src={cartItem.photo}
alt={cartItem.name}
style={{
width: '100px',
height: '100px',

}}
/>
<img
src={cartItem.photo}
alt={cartItem.name}
style={{
width: '100px',
height: '100px',
}}
/>
</ImageDiv>
<LabelBox1>
<Body1Bold>{cartItem.name}</Body1Bold>
<br />
<Body2Light>Category: {cartItem.category}</Body2Light>
</LabelBox1>
<LabelBox>
<Body1Bold>Quantity: {cartItem.quantity}</Body1Bold>
<Body1Bold>Quantity: {cartItem.quantity}</Body1Bold>
</LabelBox>
</FavoriteDiv>

))}
</ScrollDiv>
</OutterFavoriteDiv>

</LeftColumnDiv>
<RightColumnDiv>
<ShippingDetailsDiv>
<Heading3Bold>Delivery Information</Heading3Bold>
<DetailsHeader>Time Slot</DetailsHeader>
<Body1>{organizePickupTime()} (10:00 am - 12:30 pm)</Body1>
<DetailsHeader>Location</DetailsHeader>
<Body1>
3170 23rd Street, San Francisco, CA 94110
</Body1>
<Body1>3170 23rd Street, San Francisco, CA 94110</Body1>
</ShippingDetailsDiv>
</RightColumnDiv>
</BottomColumnDiv>
Expand Down
18 changes: 7 additions & 11 deletions src/app/orderConfirmationPickUp/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const FavoriteDiv = styled.div`
margin-bottom: 50px;
margin-top: 30px;
margin-right: 20px;
`;

export const OutterFavoriteDiv = styled.div`
Expand All @@ -27,9 +26,8 @@ export const OutterFavoriteDiv = styled.div`
max-height: 100%;
margin-top: 20px;
margin-right: 60px;
margin-left: 60px;
padding-right: 20px;
padding-left: 10px;
margin-left: 40px;
padding-right: 15px;
padding-top: 10px;
`;

Expand Down Expand Up @@ -109,7 +107,6 @@ export const NavBarMovedUP = styled(NavBar)`

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

export const LabelBox1 = styled.div`
Expand All @@ -124,7 +121,6 @@ export const LabelBox = styled.div`
padding: 20px;
gap: 50px;
margin-right: 30px;
`;

export const HeaderText = styled.h3`
Expand Down Expand Up @@ -235,7 +231,6 @@ export const RightColumnDiv = styled.div`
display: flex;
flex-flow: column;
align-items: start;
margin-left: 10px;
width: 100%;
`;

Expand All @@ -244,7 +239,7 @@ export const BackButtonDiv = styled.div`
flex-direction: row;
text-align: left;
width: 800px;
margin-left: 80px;
margin-left: 60px;
margin-bottom: 40px;
`;

Expand All @@ -257,22 +252,22 @@ export const WhiteBackgroundDiv = styled.div`
box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.1);
`;


export const BottomColumnDiv = styled.div`
display: flex;
flex-direction: row;
align-items: space-evenly;
justify-content: space-around;
width: 100%;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 30px;
gap: 30px;
`;

export const TextDiv = styled.div`
display: flex;
flex-direction: row;
margin-left: 60px;
margin-left: 40px;
margin-top: 20px;
margin-bottom: 20px;
`;
Expand All @@ -291,6 +286,7 @@ export const PageDiv = styled.div`
justify-content: flex-start;
align-items: flex-start;
width: 100%;
margin-bottom: 40px;
`;

export const ShippingDetailsDiv = styled.div`
Expand All @@ -300,7 +296,7 @@ export const ShippingDetailsDiv = styled.div`
border-radius: 10px;
background: var(--White, #fff);
box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.2);
width: 467px;
width: 475px;
height: auto;
max-height: 100%;
padding: 36px 34px;
Expand Down
4 changes: 2 additions & 2 deletions src/app/profileScreen/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,10 @@ function AccountDetailSectionPickUp(props: { user: User }) {
<AccountDetails>
<Heading2>Account Details</Heading2>
<HeadingSpacing>
<Body1Bold>Email</Body1Bold>
<Body1Bold>Email hi</Body1Bold>
</HeadingSpacing>
<TextSpacing>
<Body2>{user?.email}</Body2>
<Body1>{user?.email}</Body1>
</TextSpacing>
<HeadingSpacing>
<Body1Bold>Name</Body1Bold>
Expand Down
6 changes: 3 additions & 3 deletions src/app/profileScreen/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export const LogOutButton = styled.button`
line-height: normal;
border: transparent;
border-radius: 5px;
width: 405px;
height: 70px;
width: 500px;
height: 55px;
`;
/* transform: translateY(200px); */

Expand Down Expand Up @@ -154,7 +154,7 @@ export const LogOutDiv = styled.div`
display: flex;
justify-content: center;
width: 500px;
height: 350px;
height: 100%;
`;

export const MessageDiv = styled.div`
Expand Down

0 comments on commit db1f231

Please sign in to comment.