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

feat: [메인 페이지] 상품 등록 페이지로 이동하는 버튼 구현 #40

Merged
merged 5 commits into from
Nov 16, 2023
Merged
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
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
Loading