Skip to content

Commit 96d4ca0

Browse files
authored
Keep protected navigation visible before login
Merged via PR because main is protected. Verification before merge: npm run lint, npm run build, ./gradlew test, git diff --check.
2 parents 33f91ce + 595e376 commit 96d4ca0

2 files changed

Lines changed: 27 additions & 31 deletions

File tree

src/App.jsx

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -503,24 +503,22 @@ function App() {
503503
>
504504
Notices
505505
</button>
506-
{user && (
507-
<button
508-
type="button"
509-
onClick={goArchive}
510-
className="px-1 text-sm font-semibold text-[var(--theme-body-dark)]/85 transition hover:text-[var(--theme-body-dark)]"
511-
>
512-
Resources
513-
</button>
514-
)}
515-
{user && (
516-
<button
517-
type="button"
518-
onClick={goCommunity}
519-
className="px-1 text-sm font-semibold text-[var(--theme-body-dark)]/85 transition hover:text-[var(--theme-body-dark)]"
520-
>
521-
Community
522-
</button>
523-
)}
506+
<button
507+
type="button"
508+
onClick={goArchive}
509+
disabled={authLoading}
510+
className="px-1 text-sm font-semibold text-[var(--theme-body-dark)]/85 transition hover:text-[var(--theme-body-dark)] disabled:cursor-wait disabled:opacity-60"
511+
>
512+
Resources
513+
</button>
514+
<button
515+
type="button"
516+
onClick={goCommunity}
517+
disabled={authLoading}
518+
className="px-1 text-sm font-semibold text-[var(--theme-body-dark)]/85 transition hover:text-[var(--theme-body-dark)] disabled:cursor-wait disabled:opacity-60"
519+
>
520+
Community
521+
</button>
524522
</nav>
525523

526524
{user ? (
@@ -581,16 +579,14 @@ function App() {
581579
<p className="mx-auto whitespace-nowrap px-2 leading-8 text-white/72 text-[clamp(0.68rem,1.55vw,1.125rem)]">
582580
광운대학교 중앙 컴퓨터 학술동아리 COM&apos;s는 함께 배우고, 만들고, 성장하는 개발 커뮤니티입니다.
583581
</p>
584-
{user && (
585-
<div className="flex flex-wrap justify-center gap-3 pt-3">
586-
<button type="button" onClick={goArchive} className={ghostActionBtnClass}>
587-
Resources
588-
</button>
589-
<button type="button" onClick={goCommunity} className={ghostActionBtnClass}>
590-
Community
591-
</button>
592-
</div>
593-
)}
582+
<div className="flex flex-wrap justify-center gap-3 pt-3">
583+
<button type="button" onClick={goArchive} disabled={authLoading} className={ghostActionBtnClass}>
584+
Resources
585+
</button>
586+
<button type="button" onClick={goCommunity} disabled={authLoading} className={ghostActionBtnClass}>
587+
Community
588+
</button>
589+
</div>
594590
</div>
595591
</div>
596592
</div>

src/pages/Login.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ export default function Login({ onBack, goSignup }) {
2020
setError('')
2121

2222
const trimmedIdentifier = identifier.trim()
23-
const trimmedPassword = password.trim()
23+
const submittedPassword = password
2424

25-
if (!trimmedIdentifier || !trimmedPassword) {
25+
if (!trimmedIdentifier || !submittedPassword) {
2626
setError('아이디와 비밀번호를 모두 입력해주세요.')
2727
return
2828
}
2929

3030
setLoading(true)
3131
try {
32-
const data = await loginUser({ identifier: trimmedIdentifier, password: trimmedPassword })
32+
const data = await loginUser({ identifier: trimmedIdentifier, password: submittedPassword })
3333
await login(data)
3434
onBack()
3535
} catch (err) {

0 commit comments

Comments
 (0)