Skip to content

Commit 2dbe948

Browse files
authored
Merge pull request #110 from dnd-side-project/feat/#109/discover-ui
[feat] 둘러보기 UI 변경사항 반영
2 parents 99d7caf + 76bf0c8 commit 2dbe948

File tree

18 files changed

+241
-266
lines changed

18 files changed

+241
-266
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const NavContainer = styled.div<{
192192
$layoutWidth: string
193193
$layoutBottomGap: number
194194
}>`
195-
z-index: 100;
195+
z-index: ${({ theme }) => theme.Z_INDEX.overlay};
196196
position: fixed;
197197
bottom: 0;
198198
margin: 0 -20px 0 0;

src/app/providers/ToastProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ const ToastContainer = styled.div`
5252
left: 0;
5353
right: 0;
5454
padding: 0 20px;
55-
z-index: 20000;
55+
z-index: ${({ theme }) => theme.Z_INDEX.topLayer};
5656
`

src/assets/icons/icn_volume.svg

Lines changed: 5 additions & 0 deletions
Loading

src/assets/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ export { default as CoachMarkArrow } from './icn_coachmark_arrow.svg?react'
4646
export { default as BgCd } from './icn_bg_cd.svg?react'
4747
export { default as BgHeadphone } from './icn_bg_headphone.svg?react'
4848
export { default as BgMusic } from './icn_bg_music.svg?react'
49+
export { default as Volume } from './icn_volume.svg?react'

src/pages/discover/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const DiscoverPage = () => {
150150

151151
return (
152152
<Page>
153-
{showCoachmark && <DiscoverCoachMark onClick={handleCloseCoachmark} />}
153+
{showCoachmark && <DiscoverCoachMark onClose={handleCloseCoachmark} />}
154154
<SwipeCarousel data={playlistsData} onSelectIndexChange={handleSelectPlaylist}>
155155
{playlistsData.map((data) => (
156156
<Slide key={data.playlistId}>
Lines changed: 26 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,35 @@
11
import Lottie from 'lottie-react'
22
import styled from 'styled-components'
33

4-
import { Cancel, CoachMarkArrow } from '@/assets/icons'
54
import { SwipeLottie } from '@/assets/lottie'
6-
import { useDevice } from '@/shared/lib/useDevice'
7-
import { Cd, SvgButton } from '@/shared/ui'
5+
import { flexColCenter } from '@/shared/styles/mixins'
86

97
interface DiscoverCoachMarkProps {
10-
onClick: () => void
8+
onClose: () => void
119
}
1210

13-
const DiscoverCoachMark = ({ onClick }: DiscoverCoachMarkProps) => {
14-
const deviceType = useDevice()
15-
const isMobile = deviceType === 'mobile'
11+
const DiscoverCoachMark = ({ onClose }: DiscoverCoachMarkProps) => {
12+
const handleOverlayClick = (e: React.MouseEvent | React.TouchEvent) => {
13+
e.stopPropagation()
1614

17-
return (
18-
<Overlay>
19-
<CloseButton>
20-
<SvgButton icon={Cancel} onClick={onClick} />
21-
</CloseButton>
15+
setTimeout(() => {
16+
onClose()
17+
}, 0)
18+
}
2219

23-
<ContentWrapper $isMobile={isMobile}>
24-
{isMobile && (
25-
<CoachMarkCdWrapper>
26-
<CdText>
27-
<Highlight>CD를 클릭</Highlight>하면 <br /> 플레이리스트가 재생돼요
28-
</CdText>
29-
<CoachMarkCd>
30-
<CoachMarkArrow />
31-
<Cd variant="xxl" bgColor="none" />
32-
</CoachMarkCd>
33-
</CoachMarkCdWrapper>
34-
)}
35-
<Content>
36-
<p>
37-
더 많은 플레이리스트를 보려면 <br />
38-
<Highlight>화면을 위로</Highlight> 올려보세요!
39-
</p>
40-
</Content>
41-
<LottieWrapper>
42-
<Lottie animationData={SwipeLottie} loop autoplay style={{ height: 190 }} />
43-
</LottieWrapper>
44-
</ContentWrapper>
20+
return (
21+
<Overlay
22+
onClick={handleOverlayClick}
23+
onTouchStart={handleOverlayClick}
24+
onMouseDown={handleOverlayClick}
25+
>
26+
<Content>
27+
<p>
28+
더 많은 플레이리스트를 보려면 <br />
29+
<Highlight>화면을 위로</Highlight> 올려보세요!
30+
</p>
31+
</Content>
32+
<Lottie animationData={SwipeLottie} loop autoplay style={{ height: 220 }} />
4533
</Overlay>
4634
)
4735
}
@@ -54,73 +42,18 @@ const Overlay = styled.div`
5442
left: 0;
5543
width: 100%;
5644
height: 100dvh;
57-
background: rgba(15, 16, 20, 0.68);
58-
z-index: 999;
59-
`
60-
61-
const CloseButton = styled.div`
62-
position: absolute;
63-
top: 18px;
64-
right: 0;
65-
z-index: 1001;
66-
`
67-
68-
const ContentWrapper = styled.div<{ $isMobile: boolean }>`
69-
position: absolute;
70-
left: 50%;
71-
transform: translateX(-50%);
45+
background: rgba(15, 16, 20, 0.8);
46+
z-index: ${({ theme }) => theme.Z_INDEX.coachMark};
47+
${flexColCenter}
7248
73-
display: flex;
74-
flex-direction: column;
75-
align-items: center;
76-
width: 100%;
77-
78-
top: ${({ $isMobile }) => ($isMobile ? '64px' : '50%')};
79-
transform: ${({ $isMobile }) => ($isMobile ? 'translateX(-50%)' : 'translate(-50%, -50%)')};
49+
pointer-events: auto;
8050
`
8151

8252
const Content = styled.div`
8353
text-align: center;
8454
${({ theme }) => theme.FONT.headline1};
85-
font-weight: 600;
86-
87-
margin-top: 20px;
88-
white-space: nowrap;
8955
`
9056

9157
const Highlight = styled.span`
9258
color: ${({ theme }) => theme.COLOR['primary-normal']};
9359
`
94-
95-
const CoachMarkCd = styled.div`
96-
position: relative;
97-
98-
& svg {
99-
position: absolute;
100-
right: 0;
101-
top: 0;
102-
}
103-
`
104-
105-
const LottieWrapper = styled.div`
106-
height: 180px;
107-
overflow: hidden;
108-
`
109-
const CoachMarkCdWrapper = styled.div`
110-
position: relative;
111-
display: inline-block;
112-
padding-top: 40px;
113-
`
114-
115-
const CdText = styled.p`
116-
color: ${({ theme }) => theme.COLOR['gray-50']};
117-
${({ theme }) => theme.FONT['body1-normal']};
118-
text-align: right;
119-
position: absolute;
120-
121-
top: -4%;
122-
right: 0;
123-
margin-bottom: 12px;
124-
125-
white-space: nowrap;
126-
`

src/shared/lib/getTrackOrderLabel.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/shared/lib/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export { getVideoId } from './getVideoId'
22
export { getGenreLabel } from './getGenreLabel'
3-
export { getTrackOrderLabel } from './getTrackOrderLabel'
43
export { getAccTime } from './getAccTime'

src/shared/styles/theme.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ export const theme = {
113113
letter-spacing: 0.0311em;
114114
`,
115115
},
116+
117+
Z_INDEX: {
118+
overlay: 100,
119+
topLayer: 200,
120+
coachMark: 300,
121+
},
116122
}
117123

118124
export type Theme = typeof theme

src/shared/ui/LiveInfo.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ const Wrapper = styled.div`
3434
align-items: center;
3535
gap: 8px;
3636
${({ theme }) => theme.FONT.caption1};
37+
padding: 8px 0;
3738
`
3839

3940
const OnAirBadge = styled.button<{ $isOnAir: boolean }>`
4041
background-color: ${({ theme }) => theme.COLOR['gray-600']};
4142
color: ${({ theme, $isOnAir }) =>
4243
$isOnAir ? theme.COLOR['primary-normal'] : theme.COLOR['gray-300']};
4344
font-weight: 600;
44-
padding: 6px 11px;
45+
padding: 4px 10px;
4546
border-radius: 6px;
4647
${({ theme }) => theme.FONT.label};
4748

0 commit comments

Comments
 (0)