Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcf2fe5a53 | ||
|
|
132301dc28 |
@@ -130,13 +130,14 @@ function Composer({ onDone }: { onDone?: (t: TalkData) => void }) {
|
||||
id={COMPOSE_ID}
|
||||
value={text}
|
||||
onChange={(e) => setText(e.target.value)}
|
||||
onFocus={(e) => {
|
||||
if (loggedIn) return
|
||||
// 로그인 창(<dialog>)은 닫힐 때 포커스를 이 칸으로 돌려놓아 다시 열리므로, 열기 전에 포커스를 뺀다
|
||||
e.currentTarget.blur()
|
||||
// 로그인 전엔 읽기 전용이라 눌러도 키보드가 안 올라온다 (키보드가 떴다 내려가며 로그인 창이 버벅이던 것). 누르거나 Enter 면 로그인 창
|
||||
onClick={() => !loggedIn && open({ type: 'login' })}
|
||||
onKeyDown={(e) => {
|
||||
if (loggedIn || (e.key !== 'Enter' && e.key !== ' ')) return
|
||||
e.preventDefault()
|
||||
open({ type: 'login' })
|
||||
}}
|
||||
readOnly={busy}
|
||||
readOnly={busy || !loggedIn}
|
||||
maxLength={BODY_MAX}
|
||||
rows={2}
|
||||
placeholder={`지금 ${region.name.split(' ').at(-1)} 날씨 어때요?`}
|
||||
@@ -360,7 +361,10 @@ export function TalkGroup({ title, topic, talks }: { title: string; topic?: numb
|
||||
export function FirstTalkCard() {
|
||||
const { region } = useRegion()
|
||||
const place = region.name.split(' ').at(-1)
|
||||
const { loggedIn } = useAuth()
|
||||
const { open } = useSheet()
|
||||
const go = () => {
|
||||
if (!loggedIn) return open({ type: 'login' })
|
||||
const el = document.getElementById(COMPOSE_ID)
|
||||
el?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
||||
el?.focus({ preventScroll: true })
|
||||
|
||||
Reference in new issue
Block a user