Skip to content

Commit

Permalink
feat: [메인 페이지] 상품 등록 페이지로 이동하는 버튼 구현 (#40)
Browse files Browse the repository at this point in the history
Co-authored-by: heejung <[email protected]>
  • Loading branch information
heejung0413 and heejung committed Nov 16, 2023
1 parent d3bc908 commit bc50653
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/pages/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Fire } from 'react-bootstrap-icons';
import { Link } from 'react-router-dom';
import { Box, Button, Flex, Heading, Spacer, Text } from '@chakra-ui/react';
import { useTheme } from '@emotion/react';
import { UserRole } from '@/api/@types/@enums';
import { Distance, GetMainPageProductsResponse } from '@/api/@types/Products';
import { ProductsService } from '@/api/services/Products';
import ProductCards from '@/components/domains/products/ProductCards';
Expand All @@ -17,6 +18,7 @@ const IndexPage: FC = () => {
const [bannerImages, setBannerImages] = useState<string[]>([]);
const toast = useCustomToast();
const geo = useBoundedStore(state => state.geo);
const user = useBoundedStore(state => state.user);

const fetchDataFromAPI = async () => {
try {
Expand Down Expand Up @@ -156,6 +158,23 @@ const IndexPage: FC = () => {
</Button>
</Link>
</Flex>

{user?.role === UserRole.SELLER && (
<Box position="fixed" bottom="100px">
<Link to="/products/register">
<Button
role="presentation"
colorScheme="brand"
boxShadow="0px 5px 15px gray "
borderRadius="16px"
fontSize="xl"
p="25px"
>
재고 상품 업로드하러 가요 😀
</Button>
</Link>
</Box>
)}
</Box>
);
};
Expand Down

0 comments on commit bc50653

Please sign in to comment.