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

[메인 머지] dev -> main 머지 진행 #36

Merged
merged 8 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
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
Binary file added src/assets/img/workBackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 38 additions & 32 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ function Layout({ children }: { children: React.ReactNode }) {

const toggleDrawer = () => setIsDrawerOpen(!isDrawerOpen);

const isWorkDetailRoute = /^\/work\/[^/]+\/[^/]+$/.test(location.pathname);

useEffect(() => {
if (isDrawerOpen === true) {
document.body.style.overflow = 'hidden';
Expand All @@ -31,38 +33,42 @@ function Layout({ children }: { children: React.ReactNode }) {

return (
<LayoutWrapper>
<Nav isMobile={isMobile}>
{isMobile ? (
<>
<HamburgerButton onClick={toggleDrawer} src="/svg/hamburger.svg" />
<Drawer isOpen={isDrawerOpen}>
<DrawerContent>
<DrawerButton onClick={toggleDrawer} src="/svg/left-arrow.svg" />
<NavLinkContainer isMobile={isMobile}>
{NAVIGATION_ITEMS.map((item) => (
<NavLink
key={item.name}
to={item.path}
isActive={location.pathname === item.path}
onClick={toggleDrawer}
>
{item.name}
</NavLink>
))}
</NavLinkContainer>
</DrawerContent>
</Drawer>
</>
) : (
<NavLinkContainer isMobile={isMobile}>
{NAVIGATION_ITEMS.map((item) => (
<NavLink key={item.name} to={item.path} isActive={location.pathname === item.path}>
{item.name}
</NavLink>
))}
</NavLinkContainer>
)}
</Nav>
{isMobile && isWorkDetailRoute ? (
<></>
) : (
<Nav isMobile={isMobile}>
{isMobile ? (
<>
<HamburgerButton onClick={toggleDrawer} src="/svg/hamburger.svg" />
<Drawer isOpen={isDrawerOpen}>
<DrawerContent>
<DrawerButton onClick={toggleDrawer} src="/svg/left-arrow.svg" />
<NavLinkContainer isMobile={isMobile}>
{NAVIGATION_ITEMS.map((item) => (
<NavLink
key={item.name}
to={item.path}
isActive={location.pathname === item.path}
onClick={toggleDrawer}
>
{item.name}
</NavLink>
))}
</NavLinkContainer>
</DrawerContent>
</Drawer>
</>
) : (
<NavLinkContainer isMobile={isMobile}>
{NAVIGATION_ITEMS.map((item) => (
<NavLink key={item.name} to={item.path} isActive={location.pathname === item.path}>
{item.name}
</NavLink>
))}
</NavLinkContainer>
)}
</Nav>
)}
{children}
</LayoutWrapper>
);
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/queries/useGetWorkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const useGetWorkList = ({ category, currentPage }: WorkListRequestType) =
pageParams: data?.pageParams || [],
}),
staleTime: 1000 * 60 * 5,
// refetchOnWindowFocus: false,
// refetchOnMount: false,
refetchOnWindowFocus: false,
refetchOnMount: false,
});

return { data, hasNextPage, fetchNextPage, isFetchingNextPage };
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/useIntersectionObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ interface useIntersectionObserverProps {
}

export const useIntersectionObserver = ({
threshold = 0.5,
threshold = 0.2,
hasNextPage,
fetchNextPage,
}: useIntersectionObserverProps) => {

//관찰할 요소
const [target, setTarget] = useState<HTMLDivElement | null | undefined>(null);

Expand Down
17 changes: 16 additions & 1 deletion src/pages/Work/Work.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useState } from 'react';
import { Category } from '../../types/types';
import { useIsMobile } from '../../hooks/useIsMobile';
import MobileHeader from './components/mobile/MobileHeader';
import background from '../../assets/img/workBackground.png';

const Work = () => {
const [category, setCategory] = useState<Category>('ALL');
Expand All @@ -18,6 +19,7 @@ const Work = () => {

return (
<WorkPage>
<img src={background} />
<Helmet>
<title>Digging Club - Work</title>
</Helmet>
Expand Down Expand Up @@ -55,14 +57,27 @@ const WorkPage = styled.div`

display: flex;
justify-content: center;

img {
width: 100vw;
height: 100vh;
position: fixed;

z-index: 1;
}
`;

const PcDiv = styled.div`
padding: 6rem 0 10.4rem 0;
display: flex;
padding: 6rem 0;

z-index: 2;
`;

const MobileDiv = styled.div`
display: flex;
flex-direction: column;
align-items: center;

z-index: 2;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const CategoriesItem = styled.span<{ selected: boolean }>`
line-height: 120%;
font-style: normal;
font-weight: 900;
color: ${({ theme, selected }) => (selected ? theme.colors.primary : 'white')};
color: ${({ theme, selected }) => (selected ? theme.colors.primaryBlue : 'white')};

cursor: pointer;

Expand Down
3 changes: 1 addition & 2 deletions src/pages/Work/components/mobile/MobileWorkInfoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const WorkCategory = styled.span`

font-size: 1.8rem;
line-height: 120%;
color: ${({ theme }) => theme.colors.primary};
color: ${({ theme }) => theme.colors.primaryBlue};
`;

const WorkAuthorInfo = styled.div`
Expand Down Expand Up @@ -85,7 +85,6 @@ const InfoBodyWrapper = styled.div`
const WorkTitle = styled.span`
margin-bottom: 1.2rem;

font: ${({ theme }) => theme.fonts.Primary};
font-size: 2.4rem;
font-style: normal;
font-weight: 900;
Expand Down
10 changes: 6 additions & 4 deletions src/pages/Work/components/work/CategoriesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default CategoriesSection;

const CategoriesWrapper = styled.section`
position: fixed;
width: 13rem;

display: flex;
flex-direction: column;
Expand All @@ -42,11 +43,12 @@ const CategoriesWrapper = styled.section`
`;

const CategoriesItem = styled.span<{ selected: boolean }>`
${({ theme }) => theme.fonts.primary};
font-size: 4rem;
${({ theme }) => theme.fonts.primaryBlue};
font-size: 3rem;
font-style: normal;
font-weight: 500;
line-height: 120%;
color: ${({ theme, selected }) => (selected ? theme.colors.primary : 'white')};
color: ${({ theme, selected }) => (selected ? theme.colors.primaryBlue : 'white')};

cursor: pointer;
`;
1920;
2 changes: 1 addition & 1 deletion src/pages/Work/components/work/ExhibitionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const ExhibitionWrapper = styled.div<{ isMobile: boolean }>`
display: ${({ isMobile }) => (isMobile ? 'flex' : null)};
justify-content: ${({ isMobile }) => (isMobile ? 'center' : null)};
width: ${({ isMobile }) => (isMobile ? '34.3rem' : '95rem')};
margin-left: ${({ isMobile }) => (isMobile ? null : '33.85%')};
margin-left: ${({ isMobile }) => (isMobile ? null : '33rem')};
margin-top: ${({ isMobile }) => (isMobile ? '14.8rem' : null)};

display: grid;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Work/components/workDetail/WorkInfoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const WorkCategory = styled.span`

font-size: 5rem;
line-height: 120%;
color: ${({ theme }) => theme.colors.primary};
color: ${({ theme }) => theme.colors.primaryBlue};
`;

const WorkAuthorInfo = styled.div`
Expand Down
Loading