feat: 토스판 첫 실행 인트로(서비스 소개 후 시작하기), 토스 로그인 창에 로그인하면 할 수 있는 것 안내
This commit is contained in:
1 parent
2400957657
commit
91837ff8e9
3 files changed
+61
-1
No files matched your search
@@ -12,6 +12,7 @@ import { useRegion } from './regionContext'
|
||||
import { useSheet } from './sheetContext'
|
||||
import { SheetProvider } from './Sheets'
|
||||
import { SkyContext, useSky } from './skyContext'
|
||||
import { TossIntro } from './tossIntro'
|
||||
import { PinIcon, TabIcon } from './svg'
|
||||
import { Avatar, Ic, Skel } from './ui'
|
||||
|
||||
@@ -305,6 +306,7 @@ export function BLayout() {
|
||||
<RegionProvider>
|
||||
<SheetProvider>
|
||||
<Shell />
|
||||
<TossIntro />
|
||||
</SheetProvider>
|
||||
</RegionProvider>
|
||||
</AuthProvider>
|
||||
|
||||
@@ -895,7 +895,8 @@ function TossLoginSheet({ onDone, onLoggedIn }: { onDone: () => void; onLoggedIn
|
||||
|
||||
return (
|
||||
<Body className="flex flex-col gap-2.5">
|
||||
<p className="text-center text-sm font-semibold text-(--ink2)">좋아요·댓글은 로그인한 뒤에 할 수 있어요.</p>
|
||||
<h3 className="m-0 text-center font-jua text-xl font-normal">날씨각 로그인</h3>
|
||||
<p className="m-0 text-center text-sm font-semibold text-(--ink2)">로그인하면 동네 이야기를 쓰고 내 각을 저장할 수 있어요</p>
|
||||
<p className="min-h-5 text-center text-[13px] font-bold text-(--heart)" aria-live="polite">
|
||||
{error}
|
||||
</p>
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import { useState } from 'react'
|
||||
import { IS_TOSS } from '../lib/platform'
|
||||
import { Ic } from './ui'
|
||||
|
||||
const KEY = 'nalssigak.b.tossIntroSeen'
|
||||
|
||||
const POINTS = [
|
||||
['sun', '세차·빨래·러닝 각 점수'],
|
||||
['sunset', '오늘 노을이 예쁜 시간'],
|
||||
['fireworks', '이번 주말 가까운 행사'],
|
||||
] as const
|
||||
|
||||
function seen() {
|
||||
try {
|
||||
return localStorage.getItem(KEY) === '1'
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/** 토스판을 처음 열면 서비스 소개를 먼저 보여 준다 (앱인토스 검수: 로그인 전에 서비스 설명) */
|
||||
export function TossIntro() {
|
||||
const [open, setOpen] = useState(() => IS_TOSS && !seen())
|
||||
if (!open) return null
|
||||
|
||||
const start = () => {
|
||||
try {
|
||||
localStorage.setItem(KEY, '1')
|
||||
} catch (e) {
|
||||
console.warn('[intro] 본 기록을 저장하지 못함', e)
|
||||
}
|
||||
setOpen(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<div role="dialog" aria-modal="true" aria-labelledby="toss-intro-title" className="fixed inset-0 z-70 flex flex-col items-center justify-center gap-6 bg-[#d6ebff] px-8 text-(--ink)">
|
||||
<Ic name="rabbit" className="w-24" />
|
||||
<div className="text-center">
|
||||
<h1 id="toss-intro-title" className="m-0 font-jua text-[28px] font-normal">
|
||||
날씨각
|
||||
</h1>
|
||||
<p className="m-0 mt-1.5 text-[15px] font-semibold text-(--ink2)">오늘 날씨에 맞는 일을 점수로 알려 줘요</p>
|
||||
</div>
|
||||
<ul className="m-0 flex w-full max-w-xs list-none flex-col gap-2.5 p-0">
|
||||
{POINTS.map(([icon, label]) => (
|
||||
<li key={label} className="flex items-center gap-3 rounded-[18px] bg-white/80 px-4 py-3 text-[15px] font-extrabold">
|
||||
<Ic name={icon} className="w-8 shrink-0" />
|
||||
{label}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<button type="button" onClick={start} className="w-full max-w-xs cursor-pointer rounded-[14px] bg-(--orange) p-[13px] font-jua text-[17px] text-white shadow-[inset_0_-5px_0_var(--orange-deep)]">
|
||||
시작하기
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user