Skip to content

Commit

Permalink
more refactoring of the navbar and backbutton
Browse files Browse the repository at this point in the history
  • Loading branch information
davidqing6432 committed Mar 27, 2024
1 parent e4b99d7 commit dc62a20
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export default function App() {
width={125}
height={65}
style={{
position: 'absolute',
top: '30px',
left: '30px',
position: 'absolute',
}}
/>
<LoginBox>
Expand Down
3 changes: 2 additions & 1 deletion src/app/login/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ export const EyeIcon = styled(Eye)`

export const Fullscreen = styled.div`
width: 100%;
height: 100%;
height: 100vh;
display: grid;
place-items: center;
`;

export const InputField = styled.div`
Expand Down
20 changes: 10 additions & 10 deletions src/app/storefront/StoreFrontNavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable react/button-has-type */
import Image from 'next/image';
import Link from 'next/link';
import React, { useEffect, useState } from 'react';

import { fetchButtonCategories } from '@/api/supabase/queries/button_queries';
Expand All @@ -23,6 +22,7 @@ import {
BackButton,
FrontArrow,
BackArrow,
IconWithLabelLink,
} from './styles';

import ProductButtons from './productButtons';
Expand Down Expand Up @@ -117,14 +117,14 @@ export default function StoreFrontNavBar(props: {

return (
<NavBarComp>
<Link href="../storefront">
<IconWithLabelLink href="../storefront">
<Image
src="/images/ShantiLogo.png"
alt="Shanti Logo"
width={147}
height={73}
width={125}
height={70}
/>
</Link>
</IconWithLabelLink>
<ButtonsContainer>
<FrontButton onClick={handlePrevious} $reachedStart={reachedStart}>
<FrontArrow />
Expand All @@ -148,15 +148,15 @@ export default function StoreFrontNavBar(props: {
</ButtonsContainer>

<ButtonsDiv>
<Link href="../profileScreen">
<IconWithLabelLink href="../profileScreen">
<UserProfileIcon />
<Body2>Users</Body2>
</Link>
<Link href="../cart">
<Body2>User</Body2>
</IconWithLabelLink>
<IconWithLabelLink href="../cart">
<ShoppingCartIcon />
<Body2>Cart</Body2>
<CartTotalCircle $isZero={isZero}>{data}</CartTotalCircle>
</Link>
</IconWithLabelLink>
</ButtonsDiv>
</NavBarComp>
);
Expand Down
8 changes: 8 additions & 0 deletions src/app/storefront/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,11 @@ export const BackButton = styled.button<{ $reachedEnd?: boolean }>`
visibility: ${props => (props.$reachedEnd ? 'visible' : 'hidden')};
cursor: pointer;
`;

export const IconWithLabelLink = styled(Link)`
display: flex;
flex-direction: column;
align-items: center;
text-decoration: none;
color: ${COLORS.black};
`;
3 changes: 2 additions & 1 deletion src/components/BackButton/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export const BackLink = styled(Link)`
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
color: ${COLORS.black};
gap: 5px;
width: 56px;
`;

export const ArrowLeftIcon = styled(ArrowLeft)`
Expand Down

0 comments on commit dc62a20

Please sign in to comment.