Skip to content

Commit 10e55b6

Browse files
authored
Merge pull request #204 from CSE-Shaco/develop
fix(manito): ui/ux 개선
2 parents 3c5af67 + 4ba0a3d commit 10e55b6

File tree

1 file changed

+60
-87
lines changed

1 file changed

+60
-87
lines changed

src/app/manitto/page.jsx

Lines changed: 60 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -142,92 +142,65 @@ export default function ManitoVerifyPage() {
142142
const disabled = !sessionCode || !studentId;
143143

144144
return (<div className="dark min-h-[100svh] flex items-center justify-center bg-black px-4">
145-
<Card className="max-w-md w-full bg-zinc-900 border border-zinc-800">
146-
<CardHeader className="flex flex-col items-start gap-2">
147-
<h1 className="text-2xl font-bold text-white">마니또 확인</h1>
148-
<p className="text-sm text-zinc-400">
149-
전달받은 링크로 접속한 뒤, 본인이 설정한 PIN 4자리를 입력해 주세요.
150-
</p>
151-
</CardHeader>
152-
<Divider className="border-zinc-800"/>
153-
<CardBody className="flex flex-col gap-4 text-white">
154-
{/* 세션/학번 정보 표시 (읽기 전용) */}
155-
<div className="text-xs text-zinc-400 space-y-1">
156-
<div>
157-
<span className="font-semibold text-zinc-300">세션 코드: </span>
158-
<span>{sessionCode || '(없음)'}</span>
159-
</div>
160-
<div>
161-
<span className="font-semibold text-zinc-300">학번: </span>
162-
<span>{studentId || '(없음)'}</span>
163-
</div>
164-
{hash && (<div>
165-
<span className="font-semibold text-zinc-300">해시: </span>
166-
<span className="break-all">{hash}</span>
167-
</div>)}
168-
</div>
169-
170-
{disabled && (<p className="text-xs text-red-400">
171-
세션 코드 또는 학번 정보가 누락되었습니다. 링크를 다시 확인해 주세요.
172-
</p>)}
173-
174-
<form onSubmit={handleSubmit} className="flex flex-col gap-4 mt-2">
175-
<Input
176-
label="PIN (숫자 4자리)"
177-
type="password"
178-
variant="bordered"
179-
value={pin}
180-
maxLength={4}
181-
onChange={(e) => setPin(e.target.value.replace(/[^0-9]/g, '').slice(0, 4))}
182-
classNames={{
183-
label: 'text-zinc-300',
184-
input: 'text-white',
185-
inputWrapper: 'bg-zinc-900 border-zinc-700 group-data-[focus=true]:border-zinc-400',
186-
}}
187-
isDisabled={disabled || loading}
188-
/>
189-
190-
{error && (<p className="text-xs text-red-400 whitespace-pre-line">
191-
{error}
192-
</p>)}
193-
194-
<Button
195-
type="submit"
196-
color="primary"
197-
isLoading={loading}
198-
isDisabled={disabled || loading || !pin}
199-
className="font-semibold"
200-
>
201-
마니또 확인하기
202-
</Button>
203-
</form>
204-
205-
{/* 결과 영역 */}
206-
{(cipher || plain) && (<>
207-
<Divider className="border-zinc-800 my-2"/>
208-
<div className="space-y-2 text-sm">
209-
<p className="font-semibold text-zinc-200">결과</p>
210-
211-
{plain ? (<>
212-
<pre
213-
className="text-xs bg-zinc-950 border border-zinc-800 rounded-lg p-3 overflow-x-auto">
214-
{JSON.stringify(plain, null, 2)}
215-
</pre>
216-
<p className="text-xs text-zinc-400">
217-
위 내용은 클라이언트에서 hash를 이용해 복호화한 결과입니다.
218-
</p>
219-
</>) : (<>
220-
<p className="text-xs text-zinc-400 mb-1">
221-
서버에서 받은 암호문(encryptedManito)입니다.
222-
</p>
223-
<pre
224-
className="text-xs bg-zinc-950 border border-zinc-800 rounded-lg p-3 break-all">
225-
{cipher}
226-
</pre>
227-
</>)}
228-
</div>
145+
<Card className="max-w-md w-full bg-zinc-900 border border-zinc-800">
146+
<CardHeader className="flex flex-col items-start gap-2">
147+
<h1 className="text-2xl font-bold text-white">마니또 확인</h1>
148+
<p className="text-sm text-zinc-400">
149+
전달받은 링크로 접속한 뒤, 본인이 설정한 PIN 4자리를 입력해 주세요.
150+
</p>
151+
</CardHeader>
152+
<Divider className="border-zinc-800"/>
153+
<CardBody className="flex flex-col gap-4 text-white">
154+
{disabled && (<p className="text-xs text-red-400">
155+
필수 정보가 누락되었습니다. 링크를 다시 확인해 주세요.
156+
</p>)}
157+
158+
<form onSubmit={handleSubmit} className="flex flex-col gap-4 mt-2">
159+
<Input
160+
label="PIN (숫자 4자리)"
161+
type="password"
162+
variant="bordered"
163+
value={pin}
164+
maxLength={4}
165+
onChange={(e) => setPin(e.target.value.replace(/[^0-9]/g, '').slice(0, 4))}
166+
classNames={{
167+
label: 'text-zinc-300',
168+
input: 'text-white',
169+
inputWrapper: 'bg-zinc-900 border-zinc-700 group-data-[focus=true]:border-zinc-400',
170+
}}
171+
isDisabled={disabled || loading}
172+
/>
173+
174+
{error && (<p className="text-xs text-red-400 whitespace-pre-line">
175+
{error}
176+
</p>)}
177+
178+
<Button
179+
type="submit"
180+
color="primary"
181+
isLoading={loading}
182+
isDisabled={disabled || loading || !pin}
183+
className="font-semibold"
184+
>
185+
마니또 확인하기
186+
</Button>
187+
</form>
188+
189+
{/* 결과 영역 */}
190+
{(cipher || plain) && (<>
191+
<Divider className="border-zinc-800 my-2"/>
192+
<div className="space-y-2 text-sm">
193+
<p className="font-semibold text-zinc-200">결과</p>
194+
195+
{plain ? (<>
196+
<pre className="text-xs bg-zinc-950 border border-zinc-800 rounded-lg p-3 overflow-x-auto">
197+
{JSON.stringify(plain, null, 2)}
198+
</pre>
199+
</>) : (<>
229200
</>)}
230-
</CardBody>
231-
</Card>
232-
</div>);
201+
</div>
202+
</>)}
203+
</CardBody>
204+
</Card>
205+
</div>);
233206
}

0 commit comments

Comments
 (0)