Skip to content

Commit ae03651

Browse files
authored
Merge pull request #72 from Neighbors-dev/develop
[DEPLOY] 공식 1차 배포
2 parents c8928e4 + b7ecfca commit ae03651

19 files changed

Lines changed: 177 additions & 182 deletions

File tree

src/apis/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const postLogout = async () => {
3636
logout()
3737
return true
3838
} catch (error) {
39+
logout()
3940
if (error instanceof Error) {
4041
console.error(error.message)
4142
}

src/components/SolidButton.tsx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
import { ComponentPropsWithoutRef } from 'react'
1+
import { ComponentPropsWithoutRef, forwardRef } from 'react'
22
import { twMerge } from 'tailwind-merge'
33

44
interface SolidButtonProps extends ComponentPropsWithoutRef<'button'> {
55
variant: 'primary' | 'secondary'
66
size: 'small' | 'medium' | 'large'
77
className?: string
88
children: React.ReactNode
9+
ref?: React.RefObject<HTMLButtonElement>
910
}
1011

11-
export default function SolidButton({
12-
variant,
13-
size,
14-
className,
15-
children,
16-
...props
17-
}: SolidButtonProps) {
18-
// TODO: 색상 - 디자인시스템
12+
const SolidButton = forwardRef<HTMLButtonElement, SolidButtonProps>(
13+
({ variant, size, className, children, ...props }, ref) => {
14+
const variantClass = {
15+
primary: 'bg-brand-yellow text-neutral-100 disabled:bg-neutral-80 disabled:text-neutral-90',
16+
secondary: 'bg-neutral-80 text-white',
17+
}[variant]
1918

20-
const variantClass = {
21-
primary: 'bg-brand-yellow text-neutral-100 disabled:bg-neutral-80 disabled:text-neutral-90',
22-
secondary: 'bg-neutral-80 text-white',
23-
}[variant]
19+
const sizeClass = {
20+
large: 'px-6 py-3 label-large-prominent rounded-[10px]',
21+
medium: 'px-5 py-2 label-large-prominent rounded-lg',
22+
small: 'px-3.5 py-1.5 label-medium-prominent rounded-md',
23+
}[size]
2424

25-
const sizeClass = {
26-
large: 'px-6 py-3 label-large-prominent rounded-[10px]',
27-
medium: 'px-5 py-2 label-large-prominent rounded-lg',
28-
small: 'px-3.5 py-1.5 label-medium-prominent rounded-md',
29-
}[size]
25+
return (
26+
<button
27+
ref={ref}
28+
className={twMerge(
29+
'flex shrink-0 items-center justify-center gap-1.5',
30+
variantClass,
31+
sizeClass,
32+
className
33+
)}
34+
{...props}
35+
>
36+
{children}
37+
</button>
38+
)
39+
}
40+
)
3041

31-
return (
32-
<button
33-
className={twMerge(
34-
'flex shrink-0 items-center justify-center gap-1.5',
35-
variantClass,
36-
sizeClass,
37-
className
38-
)}
39-
{...props}
40-
>
41-
{children}
42-
</button>
43-
)
44-
}
42+
SolidButton.displayName = 'SolidButton'
43+
44+
export default SolidButton

src/constants/key.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const SHARE_CODE_KEY = 'TH-SC-qa-7'
2-
export const REFRESH_TOKEN_KEY = 'TH-RT-qa-7'
3-
export const MEMBER_INFO_KEY = 'TH-MI-qa-7'
4-
export const GUEST_INFO_KEY = 'TH-GI-qa-7'
1+
export const SHARE_CODE_KEY = 'TH-SC'
2+
export const REFRESH_TOKEN_KEY = 'TH-RT'
3+
export const MEMBER_INFO_KEY = 'TH-MI'
4+
export const GUEST_INFO_KEY = 'TH-GI'

src/constants/write.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,9 @@ export const BOTTOM_SHEET_CONTENT = {
5353
cancelText: null,
5454
},
5555
}
56+
57+
export const SEARCH_EXAMPLE =
58+
'검색하고 싶은 근무지가 구의119안전센터일 경우\n1. 근무지 이름로 검색\nex) 구의\n\n2. 주소지로 검색(광진구 광나루로 480 (구의동))\nex) 광진구, 구의동, 광나루로'
59+
60+
export const SECRET_EXPLANATION =
61+
'공개 시, 더 많은 사람들이 당신의 따뜻한 마음을 보고 공감할 수 있으며,\n특별한 메시지는 다양한 채널을 통해 소개될 수도 있습니다.\n비공개로 설정하면, 나만의 소중한 기록으로 남길 수 있어요.'

src/containers/Share/Onboarding.tsx

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,59 @@
11
import Header from '@/components/Header'
22
import useEmblaCarousel from 'embla-carousel-react'
33
import { twMerge } from 'tailwind-merge'
4-
import FirstSlide from './FirstSlide'
5-
import SecondSlide from './SecondSlide'
6-
import ThirdSlide from './ThirdSlide'
74
import useAuthStore from '@/stores/authStore'
85
import { useDotButton } from '@/hooks/useDotButton'
96
import SolidButton from '@/components/SolidButton'
107
import { shareLink } from '@/utils/shareLink'
118
import { useEffect } from 'react'
129
import { useQueryClient } from '@tanstack/react-query'
10+
import Slide from './Slide'
1311

1412
export default function Onboarding() {
1513
const nickname = useAuthStore((state) => state.user)?.nickname ?? ''
1614
const [emblaRef, emblaApi] = useEmblaCarousel()
1715
const { selectedIndex, scrollSnaps, onDotButtonClick } = useDotButton(emblaApi)
1816
const queryClient = useQueryClient()
1917

18+
const SLIDE_DATA = [
19+
{
20+
title: `${nickname}님, 어두웠던 아파트를\n밝혀주셨어요`,
21+
subtitle: '이제 가족, 친구들과 함께 더 많은 불빛을 켜볼까요?',
22+
windowObj: { 0: nickname },
23+
},
24+
{
25+
title: `공유하기 버튼을 눌러\n친구에게 초대 링크를 보내고`,
26+
windowObj: { 0: nickname, 7: '내 친구', 9: '내 친구' },
27+
},
28+
{
29+
title: `친구가 감사메시지를 남기면\n불빛이 켜져요`,
30+
subtitle: '함께하는 사람마다 불빛이 하나씩 늘어날거에요',
31+
windowObj: { 0: nickname, 7: '내 친구', 9: '내 친구', 2: '' },
32+
},
33+
{
34+
title: `${nickname}님의 공유 한 번이\n이 도시를 빛나게 할거에요`,
35+
subtitle: `익숙하지 않은 이름이 보여도 놀라지 마세요\n${nickname}님의 선한 영향력을 받은 분이에요`,
36+
windowObj: {
37+
0: nickname,
38+
7: '내 친구',
39+
9: '내 친구',
40+
2: '',
41+
8: '',
42+
},
43+
},
44+
{
45+
title: `자, 이제 친구들에게\n공유해볼까요?`,
46+
windowObj: {
47+
0: nickname,
48+
7: '내 친구',
49+
9: '내 친구',
50+
2: '',
51+
5: '',
52+
8: '',
53+
},
54+
},
55+
]
56+
2057
useEffect(() => {
2158
document.body.style.overflowY = 'hidden'
2259
return () => {
@@ -34,23 +71,33 @@ export default function Onboarding() {
3471
return (
3572
<>
3673
<Header className="bg-[#14192F]" prevPath="/" />
74+
<div className="px-5">
75+
<div className="h-[2px] w-full rounded-full bg-white/20">
76+
<div
77+
className="tras h-full rounded-full bg-brand-yellow transition-all duration-300 ease-out"
78+
style={{ width: `calc(100% * (${selectedIndex} + 1) / ${SLIDE_DATA.length})` }}
79+
/>
80+
</div>
81+
</div>
3782
<main className="flex grow flex-col pt-[7%] text-center">
3883
<div className="absolute left-1/2 top-[10px] z-[-10] h-[350px] w-screen -translate-x-1/2 bg-star-top bg-cover bg-center" />
3984
<div className="absolute left-1/2 top-[325px] z-[-10] h-[390px] w-screen -translate-x-1/2 bg-star-bottom bg-cover bg-center" />
4085
<section className="flex w-full grow flex-col">
4186
<div className="flex grow flex-col overflow-hidden" ref={emblaRef}>
4287
<div className="flex grow touch-pan-y touch-pinch-zoom">
43-
<FirstSlide nickname={nickname} />
44-
<SecondSlide nickname={nickname} />
45-
<ThirdSlide nickname={nickname} />
88+
{SLIDE_DATA.map(({ title, subtitle, windowObj }) => (
89+
<Slide key={title} title={title} subtitle={subtitle} windowObj={windowObj} />
90+
))}
4691
</div>
4792
</div>
4893
<SolidButton
4994
variant="primary"
5095
size="large"
5196
className={twMerge(
5297
'fixed bottom-[5%] left-1/2 z-20 w-[175px] -translate-x-1/2 rounded-full px-[30px] py-4 drop-shadow-[0_15px_25px_rgba(0,0,0,0.35)] transition-opacity duration-300',
53-
selectedIndex === 2 ? 'opacity-100' : 'pointer-events-none opacity-0'
98+
selectedIndex === SLIDE_DATA.length - 1
99+
? 'opacity-100'
100+
: 'pointer-events-none opacity-0'
54101
)}
55102
onClick={() => {
56103
shareLink(nickname)

src/containers/Share/SecondSlide.tsx

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,27 @@ import { BUILDING_WINDOW } from '@/constants/window'
22
import BuildingWindow from '@/containers/Share/BuildingWindow'
33
import { chunkWindow } from '@/utils/chunkWindow'
44

5-
interface FirstSlideProps {
6-
nickname: string
5+
interface SlideProps {
6+
title: string
7+
subtitle?: string
8+
windowObj: Record<number, string | undefined>
79
}
810

9-
export default function FirstSlide({ nickname }: FirstSlideProps) {
11+
export default function Slide({ title, subtitle, windowObj }: SlideProps) {
1012
return (
1113
<div className="relative flex w-full shrink-0 flex-col items-center">
12-
<div className="h-[144px]">
13-
<h1 className="headline-small w-sm:text-[20px] mb-5 text-center text-white">
14-
{nickname}님, 어두웠던 아파트를
15-
<br />
16-
밝혀주셨어요.
17-
</h1>
18-
<p className="title-small text-neutral-30">하지만 아직 많이 어두운 것 같아요.</p>
14+
<div className="mb-7 flex h-[120px] flex-col gap-3 whitespace-pre-wrap">
15+
<h1 className="headline-small text-center text-white w-sm:text-[20px]">{title}</h1>
16+
<p className="title-small text-neutral-30">{subtitle}</p>
1917
</div>
20-
<div className="absolute top-[160px] z-[-10] h-[151px] w-[150px] rounded-full bg-[#C4EF66] blur-[77px]" />
18+
<div className="absolute top-[170px] z-[-10] h-[151px] w-[150px] rounded-full bg-[#C4EF66] blur-[77px]" />
2119
<section className="w-full max-w-[375px] grow overflow-hidden bg-[#262831] pb-24">
2220
<div className="roof-background mt-[-7px] h-[29px]" />
2321
<div className="h-3 w-full bg-[#3E3E42]" />
2422
<div className="flex flex-col gap-3 px-10 pt-7">
2523
{chunkWindow(
2624
BUILDING_WINDOW.slice(0, 12).map((window, index) => (
27-
<BuildingWindow key={index} imgSrc={window} name={index === 0 ? nickname : null} />
25+
<BuildingWindow key={index} imgSrc={window} name={windowObj[index] ?? null} />
2826
))
2927
).map((row, index) => (
3028
<div key={index} className="flex justify-between">

src/containers/Share/ThirdSlide.tsx

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

src/containers/Write/BottomSheet/ShareLink.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ export default function ShareLink() {
4242
<section className="mt-1 h-[76px] text-center text-white">
4343
<p className="title-large mb-2">친구들에게 공유하러 가요</p>
4444
<p className="body-medium whitespace-pre-wrap text-center">
45-
다른 친구들에게 공유해 거리를 환하게 밝혀주세요
45+
다른 친구들에게 초대링크를 보내고
46+
<br />
47+
함께 거리를 환하게 밝혀주세요
4648
</p>
4749
</section>
4850
<section className="flex w-full flex-col gap-3">

src/containers/Write/Funnel/MessagesCollection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function MessagesCollection() {
2424
)}
2525
<div className="grow">
2626
<h2 className="body-large my-5 text-neutral-30">
27-
다른 사람이 작성한 감사 메시지를
27+
다른 사람들이 작성한 감사 메시지를
2828
<br />
2929
참고해 작성해보세요!
3030
</h2>

0 commit comments

Comments
 (0)