Skip to content

Commit

Permalink
dpone
Browse files Browse the repository at this point in the history
  • Loading branch information
BuyankhuuTsCAl committed Apr 15, 2024
2 parents 02d2da8 + 853ffaa commit 4c6a390
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 39 deletions.
1 change: 1 addition & 0 deletions src/api/supabase/queries/product_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export async function filterProduct(productType: string): Promise<Product[]> {
export async function convertCategoryToNumber(
productType: string,
): Promise<StorefrontButtons> {
console.log(productType);
const { data: buttonVal, error } = await supabase
.from('storefront_buttons')
.select('*')
Expand Down
2 changes: 2 additions & 0 deletions src/api/supabase/queries/user_queries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Lekton } from 'next/font/google';
import supabase from '../createClient';
import { User, Product } from '../../../schema/schema';
import { fetchProductByID } from './product_queries';
import { convertButtonNumberToCategory } from './button_queries';

/**
* fetchUser is a function that fetches the user data from the database and returns the user object.
Expand Down
38 changes: 18 additions & 20 deletions src/app/cart/Buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { QuantityButton, PlusMinusButton } from './styles';
import { QuantityButton, PlusMinusButton } from './styles';

import {
decreaseFromCart,
Expand Down Expand Up @@ -53,24 +53,22 @@ export default function Buttons(props: {
// used hyphen instead of dash for display

return (

<QuantityButton>
<PlusMinusButton
type="button"
style={{ cursor: 'pointer' }}
onClick={decreaseQuantity}
>
</PlusMinusButton>
<span>{count}</span>
<PlusMinusButton
type="button"
style={{ cursor: 'pointer' }}
onClick={increaseQuantity}
>
+
</PlusMinusButton>
</QuantityButton>

<QuantityButton>
<PlusMinusButton
type="button"
style={{ cursor: 'pointer' }}
onClick={decreaseQuantity}
>
</PlusMinusButton>
<span>{count}</span>
<PlusMinusButton
type="button"
style={{ cursor: 'pointer' }}
onClick={increaseQuantity}
>
+
</PlusMinusButton>
</QuantityButton>
);
}
2 changes: 0 additions & 2 deletions src/app/cart/cartItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import {
FavoriteDiv,
TrashIcon,
TransparentButton,

LabelBox,

ImageBackground,
} from './styles';

Expand Down
4 changes: 2 additions & 2 deletions src/app/favorites/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export default function FavoritesPage() {
<OutterFavoriteDiv>
{Favorites.map(favorite => (
<FavoriteDiv key={favorite.id}>
<ImageLinkWrapper href={`${ favorite.id}`}>
<ImageLinkWrapper href={`${favorite.id}`}>
<img
src={favorite.photo}
alt={favorite.name}
style={{ width: '150px', height: '150px' }}
style={{ width: '100px', height: '100px' }}
/>
</ImageLinkWrapper>

Expand Down
23 changes: 11 additions & 12 deletions src/app/favorites/styles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import { Heart } from 'react-feather';
import Link from "next/link";
import Link from 'next/link';
import COLORS from '@/styles/colors';

import NavBar from '../../components/NavBarFolder/NavBar';
Expand Down Expand Up @@ -60,7 +60,7 @@ export const HeartIcon = styled(Heart)`
export const TransparentButton = styled.button`
background-color: transparent;
border: transparent;
cursor:pointer;
cursor: pointer;
`;

export const NavBarMovedUP = styled(NavBar)`
Expand Down Expand Up @@ -98,14 +98,13 @@ export const Fullscreen = styled.div`
`;

export const ImageLinkWrapper = styled(Link)`
width:100px;
height:100px;
background-color:${COLORS.lightGrey};
padding:32px;
margin-bottom:8px;
display:flex;
justify-content:center;
align-items:center;
box-shadow: 1px 1px 4px 1px rgba(0,0,0,.1);
width: 100px;
height: 100px;
background-color: ${COLORS.lightGrey};
padding: 32px;
margin-bottom: 8px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.1);
`;

2 changes: 2 additions & 0 deletions src/app/storefront/productButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default function ProductButtons(props: {
// Applying the filter to the categories of the product

if (category !== 'All') {
console.log(category);
const products = await filterUserProducts(category);
if (products !== null) {
setFiltredProducts(products);
Expand All @@ -85,6 +86,7 @@ export default function ProductButtons(props: {
<CategoryButton
$selected={index === clickedButton}
key={value}
value={value}
onClick={e => applyFilter(e)}
/>
<CategoryButtonLabel $selected={index === clickedButton}>
Expand Down
4 changes: 2 additions & 2 deletions src/app/storefront/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const ImageLinkWrapper = styled(Link)`
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.10);
box-shadow: 0px 4px 7px 0px rgba(0, 0, 0, 0.1);
`;

export const StorefrontWrapper = styled.div`
Expand Down Expand Up @@ -251,4 +251,4 @@ export const BackButton = styled.button<{ $reachedEnd?: boolean }>`
border: none;
visibility: ${props => (props.$reachedEnd ? 'visible' : 'hidden')};
cursor: pointer;
`;
`;
2 changes: 1 addition & 1 deletion src/components/ViewAllButton/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const ViewAllDiv = styled.div`
}
`;

export const placeHolder = "";
export const placeHolder = '';

0 comments on commit 4c6a390

Please sign in to comment.