From 9dc7a52383e196b5efd57bbfaf3d2adebc451693 Mon Sep 17 00:00:00 2001
From: Mina Choi
Date: Tue, 27 Oct 2026 08:30:41 +0900
Subject: [PATCH] =?UTF-8?q?feat:=20=ED=86=A0=EC=8A=A4=ED=8C=90=20=ED=86=A0?=
=?UTF-8?q?=EC=8A=A4=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=8B=A4=EC=8B=9C=20?=
=?UTF-8?q?=EC=BC=AC=20(0144a64=20=EB=90=98=EB=8F=8C=EB=A6=BC)=20=E2=80=94?=
=?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=B2=84=ED=8A=BC=C2=B7?=
=?UTF-8?q?=EA=B8=80=EC=93=B0=EA=B8=B0=20=EC=B9=B8=C2=B7=EA=B8=80=20?=
=?UTF-8?q?=EB=8D=94=EB=B3=B4=EA=B8=B0,=20=EB=91=90=20=EB=B2=88=EC=A7=B8?=
=?UTF-8?q?=20=EB=82=B4=20=EA=B0=81=20=EC=A0=80=EC=9E=A5=20=EB=95=8C=20?=
=?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=B0=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/b/BLayout.tsx | 3 +-
frontend/src/b/Sheets.tsx | 58 ++++++++++++++++++++++++++++++++------
frontend/src/b/talk.tsx | 18 ++++--------
3 files changed, 55 insertions(+), 24 deletions(-)
diff --git a/frontend/src/b/BLayout.tsx b/frontend/src/b/BLayout.tsx
index fe9924b..3f87a6b 100644
--- a/frontend/src/b/BLayout.tsx
+++ b/frontend/src/b/BLayout.tsx
@@ -2,7 +2,6 @@ import { useCallback, useEffect, useMemo, useState, type ReactNode } from 'react
import { NavLink, Outlet, useLocation, useNavigationType } from 'react-router'
import { useIsFetching, useQuery } from '@tanstack/react-query'
import { getSeasonWeekOptions } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
-import { IS_TOSS } from '../lib/platform'
import { cx } from '../lib/utils'
import { kindOfHour, kst, seasonOf, type TimeKind } from '@nalssigak/shared/lib'
import './b.css'
@@ -61,7 +60,7 @@ function TopBar() {
{locateStatus === 'locating' ? : {region.name} {region.name.split(' ').at(-1)} }
- {IS_TOSS ? null : mePending ? (
+ {mePending ? (
) : me ? (
open({ type: 'me' })} aria-label={`내 정보, ${me.nickname}`} className="shrink-0 cursor-pointer rounded-full shadow-[0_6px_12px_rgb(40_48_74/0.12)]">
diff --git a/frontend/src/b/Sheets.tsx b/frontend/src/b/Sheets.tsx
index 05a4d6b..c2c3a68 100644
--- a/frontend/src/b/Sheets.tsx
+++ b/frontend/src/b/Sheets.tsx
@@ -20,6 +20,7 @@ import {
listRegionsOptions,
meQueryKey,
reportCommentMutation,
+ tossMutation,
unblockMutation,
unlikeCommentMutation,
updateMeMutation,
@@ -27,7 +28,7 @@ import {
} from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
import { AuthProvider, ReportReason, type CommentData, type Factor, type ResAuth, type ResCommentList, type ResIndexDetail } from '@nalssigak/shared/api/client/types.gen'
import { track } from '../lib/analytics'
-import { IS_TOSS, tossShare } from '../lib/platform'
+import { IS_TOSS, tossLogin, tossShare } from '../lib/platform'
import { cx } from '../lib/utils'
import { useAuth } from './authContext'
import { ago, articleMeta, AVATAR_COLORS, cardBg, CHARACTERS, dateRange, loadOf, MOODS, shortDay } from '@nalssigak/shared/lib'
@@ -968,7 +969,7 @@ function LoginSheet({ onDone, onLoggedIn }: { onDone: () => void; onLoggedIn: ()
const fail = () => setError('서버에 닿지 못했어요. 잠시 뒤에 다시 해 주세요.')
if (me) return
- if (IS_TOSS) return
+ if (IS_TOSS) return
return (
@@ -992,13 +993,52 @@ function LoginSheet({ onDone, onLoggedIn }: { onDone: () => void; onLoggedIn: ()
)
}
-/** 토스판은 로그인이 없다. 로그인이 필요한 곳(두 번째 내 각)에서 안내만 한다 */
-function TossNoLoginSheet({ onDone }: { onDone: () => void }) {
+/** 앱인토스는 토스 로그인만 쓸 수 있다 */
+function TossLoginSheet({ onDone, onLoggedIn }: { onDone: () => void; onLoggedIn: () => void }) {
+ const [error, setError] = useState('')
+ const [opening, setOpening] = useState(false)
+ const toss = useMutation(tossMutation())
+ const pending = opening || toss.isPending
+
+ const start = async () => {
+ setError('')
+ setOpening(true)
+ let code: Awaited>
+ try {
+ code = await tossLogin()
+ } catch (e) {
+ console.error('[login] toss', e)
+ setError('토스 로그인을 마치지 못했어요. 한 번 더 눌러 주세요.')
+ return
+ } finally {
+ setOpening(false)
+ }
+ toss.mutate(
+ { body: { authorization_code: code.authorizationCode, referrer: code.referrer } },
+ {
+ onSuccess: (res) => {
+ if (!res.result?.success || !res.access_token) return setError('토스 로그인을 마치지 못했어요. 한 번 더 눌러 주세요.')
+ setTokens(res.access_token, res.refresh_token ?? null)
+ track('login', { method: 'toss' })
+ onLoggedIn()
+ },
+ onError: () => setError('서버에 닿지 못했어요. 잠시 뒤에 다시 해 주세요.'),
+ },
+ )
+ }
+
return (
- 토스에서는 내 각을 하나만 만들 수 있어요. 지금 각을 지우고 새로 만들어 주세요.
-
- 알겠어요
+ 날씨각 로그인
+ 로그인하면 동네 이야기를 쓰고 내 각을 저장할 수 있어요
+
+ {error}
+
+
+
+
+
+ 나중에 할게요
)
@@ -1295,12 +1335,12 @@ function RegionSheet({ onDone }: { onDone: () => void }) {
))}
- {!IS_TOSS &&
+
{me ? `${me.nickname}(으)로 로그인했어요` : '로그인하면 좋아요·댓글을 쓸 수 있어요'}
open({ type: 'login' })} className="cursor-pointer font-extrabold text-(--rain)">
{me ? '로그아웃' : '로그인'}
-
}
+
)
}
diff --git a/frontend/src/b/talk.tsx b/frontend/src/b/talk.tsx
index f6734ec..9bd1329 100644
--- a/frontend/src/b/talk.tsx
+++ b/frontend/src/b/talk.tsx
@@ -12,7 +12,6 @@ import {
import { uploadTalkImage } from '@nalssigak/shared/api/client/sdk.gen'
import { TalkReport, TalkTopic, type TalkData } from '@nalssigak/shared/api/client/types.gen'
import { API_BASE_URL } from '../api/setup'
-import { IS_TOSS } from '../lib/platform'
import { cx } from '../lib/utils'
import { useAuth } from './authContext'
import { ago, kst } from '@nalssigak/shared/lib'
@@ -252,15 +251,10 @@ function TalkRow({ t, onGone, compact }: { t: TalkData; onGone?: () => void; com
)}
{t.image && !compact && }
- {ago(t.created_at)} · 좋아요 {count}개
- {!IS_TOSS && (
- <>
- {' · '}
- setMenu(menu === 'closed' ? 'open' : 'closed')} aria-expanded={menu !== 'closed'} className="cursor-pointer font-bold text-(--ink3)">
- {t.mine ? '내 글' : '더보기'}
-
- >
- )}
+ {ago(t.created_at)} · 좋아요 {count}개 ·{' '}
+ setMenu(menu === 'closed' ? 'open' : 'closed')} aria-expanded={menu !== 'closed'} className="cursor-pointer font-bold text-(--ink3)">
+ {t.mine ? '내 글' : '더보기'}
+
{menu !== 'closed' && (
@@ -304,7 +298,6 @@ function TalkRow({ t, onGone, compact }: { t: TalkData; onGone?: () => void; com
/** 이야기 탭: 쓰기 칸과 전국 최신 글 (아래로 더 받기) */
/** 피드 위 쓰는 칸. 늘 펼쳐 두고, 방금 올린 글은 바로 아래에 보인다 (피드 사이 글은 새로 받을 때 섞인다) */
export function FeedComposer({ onPosted }: { onPosted: (t: TalkData) => void }) {
- if (IS_TOSS) return null
return (
@@ -374,8 +367,7 @@ export function FirstTalkCard() {
/** '동네 사람들' 자리: 글이 GROUP_MIN 개 이상이면 묶음, 아니면 첫 글 쓰기 */
export function NearTalks({ talks, loaded }: { talks: TalkData[]; loaded: boolean }) {
if (!loaded) return null
- if (talks.length >= GROUP_MIN) return
- return IS_TOSS ? null :
+ return talks.length >= GROUP_MIN ? :
}
/** 내 정보 창의 내가 쓴 글 */