-
Notifications
You must be signed in to change notification settings - Fork 8
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
좋아요한 템플릿 목록 페이지 생성 및 캐로셀 스크롤로 변경 #872
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6d9fb5a
feat(src): Layout에 ScrollTopButton 적용
Hain-tain ca99c9c
feat(Carousel): 스크롤 추가 및 버튼 스타일 변경, 모바일에서 버튼 제거
Hain-tain 616e30f
refactor(hooks): useHotTopic에서 tagIds 변경시 page 리셋 추가
Hain-tain 62d4dde
feat(Carousel): 캐로셀 스크롤로 변경 및 무한순환 제거
Hain-tain f0df646
feat(ForbiddenPage): 403 ERROR 페이지 생성
Hain-tain 2d482e7
refactor(src): NoSearchResult => NoResult로 변경
Hain-tain 9b35548
feat(src): 좋아요한 템플릿 목록 페이지 생성
Hain-tain 4768e18
design(TemplateCard): 제목과 설명 사이 gap 추가
Hain-tain f243727
refactor(Carousel): 불필요한 주석 제거
Hain-tain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../NoSearchResults/NoSearchResults.style.ts → ...c/components/NoResults/NoResults.style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { PropsWithChildren } from 'react'; | ||
|
||
import { ZapzapCuriousLogo } from '@/assets/images'; | ||
import { theme } from '@/style/theme'; | ||
|
||
import { Text } from '..'; | ||
import * as S from './NoResults.style'; | ||
|
||
const NoResults = ({ children }: PropsWithChildren) => ( | ||
<S.NoResultsContainer> | ||
<ZapzapCuriousLogo width={48} height={48} /> | ||
<Text.Large color={theme.color.light.secondary_700}>{children}</Text.Large> | ||
</S.NoResultsContainer> | ||
); | ||
|
||
export default NoResults; |
14 changes: 0 additions & 14 deletions
14
frontend/src/components/NoSearchResults/NoSearchResults.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 62 additions & 9 deletions
71
frontend/src/components/ScrollTopButton/ScrollTopButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,69 @@ | ||
import { useEffect, useState, useRef } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
|
||
import { ArrowUpIcon } from '@/assets/images'; | ||
import { useWindowWidth } from '@/hooks'; | ||
import { END_POINTS } from '@/routes'; | ||
import { BREAKING_POINT } from '@/style/styleConstants'; | ||
import { scroll } from '@/utils'; | ||
|
||
import * as S from './ScrollTopButton.style'; | ||
|
||
const ScrollTopButton = () => ( | ||
<S.ScrollTopButton | ||
onClick={() => { | ||
scroll.top('smooth'); | ||
}} | ||
> | ||
<ArrowUpIcon aria-label='맨 위로' /> | ||
</S.ScrollTopButton> | ||
); | ||
const ScrollTopButton = () => { | ||
const location = useLocation(); | ||
const [isVisible, setIsVisible] = useState(false); | ||
const sentinelRef = useRef<HTMLDivElement>(null); | ||
|
||
const windowWidth = useWindowWidth(); | ||
|
||
const isMobile = windowWidth <= BREAKING_POINT.MOBILE; | ||
const isTemplateUpload = isMobile && location.pathname === END_POINTS.TEMPLATES_UPLOAD; | ||
|
||
useEffect(() => { | ||
const sentinel = sentinelRef.current; | ||
|
||
if (!sentinel) { | ||
return; | ||
} | ||
|
||
const observerOptions: IntersectionObserverInit = { | ||
root: null, | ||
rootMargin: '0px', | ||
threshold: [0, 1.0], | ||
}; | ||
|
||
const observerCallback: IntersectionObserverCallback = (entries) => { | ||
// entries[0].isIntersecting이 false일 때 (sentinel이 화면에서 벗어났을 때) 버튼 보여줌 | ||
const entry = entries[0]; | ||
const shouldShow = !entry.isIntersecting || entry.intersectionRatio < 1; | ||
|
||
void setIsVisible(shouldShow); | ||
}; | ||
|
||
const observer = new IntersectionObserver(observerCallback, observerOptions); | ||
|
||
observer.observe(sentinel); | ||
|
||
// eslint-disable-next-line consistent-return | ||
return () => { | ||
observer.disconnect(); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<S.Sentinel ref={sentinelRef} aria-hidden='true' /> | ||
<S.ScrollTopButtonContainer | ||
isVisible={isVisible} | ||
isTemplateUpload={isTemplateUpload} | ||
onClick={() => { | ||
scroll.top('smooth'); | ||
}} | ||
> | ||
<ArrowUpIcon aria-label='맨 위로' /> | ||
</S.ScrollTopButtonContainer> | ||
</> | ||
); | ||
}; | ||
|
||
export default ScrollTopButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,19 +60,21 @@ const TemplateCard = ({ template }: Props) => { | |
</Flex> | ||
|
||
<Link to={END_POINTS.template(template.id)}> | ||
<S.EllipsisTextWrapper> | ||
<Text.XLarge color={theme.color.light.secondary_900} weight='bold'> | ||
{title} | ||
</Text.XLarge> | ||
</S.EllipsisTextWrapper> | ||
<Flex direction='column' gap='0.5rem'> | ||
<S.EllipsisTextWrapper> | ||
<Text.XLarge color={theme.color.light.secondary_900} weight='bold'> | ||
{title} | ||
</Text.XLarge> | ||
</S.EllipsisTextWrapper> | ||
Comment on lines
+63
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기는 gap이 추가된걸까요?! |
||
|
||
<S.EllipsisTextWrapper> | ||
{description ? ( | ||
<Text.Medium color={theme.color.light.secondary_600}>{description}</Text.Medium> | ||
) : ( | ||
<S.BlankDescription /> | ||
)} | ||
</S.EllipsisTextWrapper> | ||
<S.EllipsisTextWrapper> | ||
{description ? ( | ||
<Text.Medium color={theme.color.light.secondary_600}>{description}</Text.Medium> | ||
) : ( | ||
<S.BlankDescription /> | ||
)} | ||
</S.EllipsisTextWrapper> | ||
</Flex> | ||
</Link> | ||
</Flex> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { TigerLogo } from '@/assets/images'; | ||
import { Button, Flex, Heading, Text } from '@/components'; | ||
import { useCustomNavigate } from '@/hooks'; | ||
import { theme } from '@/style/theme'; | ||
|
||
interface props { | ||
resetError?: () => void; | ||
} | ||
|
||
const ForbiddenPage = ({ resetError }: props) => { | ||
const navigate = useCustomNavigate(); | ||
|
||
return ( | ||
<Flex direction='column' gap='3rem' margin='2rem 0 0 0' justify='center' align='center'> | ||
<TigerLogo aria-label='호랑이 로고' /> | ||
<Heading.XLarge color={theme.color.light.primary_500}>403 ERROR</Heading.XLarge> | ||
<Flex direction='column' gap='2rem' align='center'> | ||
<Text.XLarge color={theme.color.light.primary_500} weight='bold'> | ||
죄송합니다. 해당 페이지에 접근할 수 있는 권한이 없습니다. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사소하지만 '죄송합니다.' 표현이 없어도 될 것 같다는 생각이네요 ㅎㅎ |
||
</Text.XLarge> | ||
<Flex direction='column' justify='center' align='center' gap='1rem'> | ||
<Text.Medium color={theme.color.light.secondary_600} weight='bold'> | ||
입력하신 주소가 정확한지 다시 확인하거나 홈으로 이동해주세요. | ||
</Text.Medium> | ||
</Flex> | ||
</Flex> | ||
<Button | ||
weight='bold' | ||
onClick={() => { | ||
resetError && resetError(); | ||
navigate('/'); | ||
}} | ||
> | ||
<Text.Medium color={theme.color.light.white}>홈으로 이동</Text.Medium> | ||
</Button> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default ForbiddenPage; |
37 changes: 37 additions & 0 deletions
37
frontend/src/pages/MyLikedTemplatePage/MyLikedTemplatePage.style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const PageTitle = styled.div` | ||
align-items: center; | ||
justify-content: center; | ||
|
||
width: 100%; | ||
padding: 5rem 1rem; | ||
|
||
white-space: nowrap; | ||
`; | ||
|
||
export const TemplateExplorePageContainer = styled.div<{ cols: number }>` | ||
display: grid; | ||
grid-gap: 1rem; | ||
grid-template-columns: repeat(${({ cols }) => cols}, minmax(0, 1fr)); | ||
|
||
width: 100%; | ||
max-width: 80rem; | ||
`; | ||
|
||
export const MainContainer = styled.main` | ||
display: flex; | ||
|
||
@media (max-width: 1376px) { | ||
gap: clamp(1rem, calc(0.0888 * 100vw - 3.2618rem), 4.375rem); | ||
} | ||
|
||
@media (max-width: 768px) { | ||
gap: 0; | ||
} | ||
`; | ||
|
||
export const TemplateListSectionWrapper = styled.div` | ||
position: relative; | ||
width: 100%; | ||
`; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이렇게 로직을 쓰는군요?!