Skip to content

Commit d820dc1

Browse files
committed
deploy: 84f05d2
1 parent 2240a98 commit d820dc1

22 files changed

Lines changed: 591 additions & 402 deletions

assets/auth-BdycFaGx.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/auth-By0nG7EY.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/button-CAEJdT3Q.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/button-Dr2mjWNP.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import{i as e,s as t}from"./preload-helper-B-rJVKt8.js";import{$ as n,A as r,C as i,D as a,E as o,M as s,O as c,S as l,T as u,W as d,Z as f,a as p,c as m,d as h,j as g,k as _,l as v,m as y,o as b,u as x,w as S,x as C}from"./iframe-Ce9oT3n4.js";import{E as w,_ as T,g as E,h as D,m as O,n as k,p as A,t as j,v as M}from"./button-CAEJdT3Q.js";var N,P,F,I=e((()=>{T(),N=t(n(),1),o(),S(),D(),g(),O(),k(),P=f(),F=()=>{let{token:e}=E(i),{authQuery:t}=E(u),{logout:n}=t.useLogout(),{toMain:r,toSignIn:a,toSignUp:o}=s(),[c,l]=(0,N.useState)(!1),d=()=>{e!==null&&n({token:e})},f=()=>l(!1);return(0,P.jsx)(`header`,{className:`sticky top-0 z-50 flex w-full justify-center bg-white shadow-md`,children:(0,P.jsxs)(`div`,{className:`flex w-full items-center justify-between px-6 py-4`,children:[(0,P.jsx)(`h1`,{onClick:r,className:`cursor-pointer font-bold text-gray-800 text-xl transition-colors duration-150 hover:text-blue-600`,children:`VLSI`}),(0,P.jsx)(`div`,{className:`hidden items-center gap-5 sm:flex`,children:e===null?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(j,{onClick:o,variant:`ghost`,children:`회원가입`}),(0,P.jsx)(j,{onClick:a,variant:`ghost`,children:`로그인`})]}):(0,P.jsx)(j,{onClick:d,variant:`ghost`,children:`로그아웃`})}),(0,P.jsxs)(`div`,{className:`flex sm:hidden`,children:[(0,P.jsx)(j,{variant:`ghost`,size:`icon`,onClick:()=>l(e=>!e),children:(0,P.jsx)(w,{})}),c&&(0,P.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/30 sm:hidden`,onClick:f}),(0,P.jsxs)(`div`,{className:A(`fixed top-0 right-0 z-50 h-full w-64 transform bg-white shadow-xl transition-transform duration-300 ease-in-out sm:hidden`,c?`translate-x-0`:`translate-x-full`),children:[(0,P.jsx)(`div`,{className:`flex justify-start px-2 py-4`,children:(0,P.jsx)(j,{variant:`ghost`,size:`icon`,onClick:f,children:(0,P.jsx)(M,{})})}),(0,P.jsx)(`div`,{className:`flex flex-col space-y-6 px-6`,children:e===null?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(j,{onClick:()=>{o(),f()},variant:`ghost`,className:`justify-between`,children:`회원가입`}),(0,P.jsx)(j,{onClick:()=>{a(),f()},variant:`ghost`,className:`justify-between`,children:`로그인`})]}):(0,P.jsx)(j,{onClick:()=>{d(),f()},variant:`ghost`,className:`justify-between`,children:`로그아웃`})})]})]})]})})},F.__docgenInfo={description:``,methods:[],displayName:`GlobalNavigationBar`}})),L,R,z,B,V,H,U,W,G,K,q,J;e((()=>{p(),L=t(n(),1),_(),c(),o(),S(),l(),x(),v(),I(),R=f(),{expect:z,userEvent:B,within:V}=__STORYBOOK_MODULE_TEST__,H=`mock-reviewer-token`,U=()=>{let[e,t]=(0,L.useState)(null),n=a({api:y({externalCall:h}),tokenRepository:m({setToken:t})}),o=r({authUsecase:n}),s=(0,L.useRef)(!1),{reissueToken:c}=o.useRefreshToken();return(0,L.useEffect)(()=>{s.current||(s.current=!0,c())},[c]),(0,R.jsx)(u.Provider,{value:{authQuery:o},children:(0,R.jsx)(i.Provider,{value:{token:e},children:(0,R.jsx)(C.Provider,{value:{authUsecase:n},children:(0,R.jsx)(F,{})})})})},W={title:`Common/GlobalNavigationBar`,component:U},G={name:`비로그인 — 로그인/회원가입 버튼 표시`,parameters:{msw:{handlers:[b.get(`*/api/auth/token`,()=>d.json({code:`AUTH_001`,message:`Unauthorized`},{status:401}))]}},play:async({canvasElement:e})=>{let t=V(e);await z(t.findByRole(`button`,{name:`로그인`})).resolves.toBeInTheDocument(),await z(t.findByRole(`button`,{name:`회원가입`})).resolves.toBeInTheDocument()}},K={name:`로그인 상태 — 로그아웃 버튼 표시`,parameters:{msw:{handlers:[b.get(`*/api/auth/token`,()=>d.json({accessToken:H},{status:200}))]}},play:async({canvasElement:e})=>{await z(V(e).findByRole(`button`,{name:`로그아웃`})).resolves.toBeInTheDocument()}},q={name:`로그아웃 플로우`,parameters:{msw:{handlers:[b.get(`*/api/auth/token`,()=>d.json({accessToken:H},{status:200})),b.delete(`*/api/auth/user/session`,()=>d.json(null,{status:200}))]}},play:async({canvasElement:e})=>{let t=V(e),n=await t.findByRole(`button`,{name:`로그아웃`});await B.click(n),await z(t.findByRole(`button`,{name:`로그인`})).resolves.toBeInTheDocument()}},G.parameters={...G.parameters,docs:{...G.parameters?.docs,source:{originalSource:`{
2+
name: '비로그인 — 로그인/회원가입 버튼 표시',
3+
parameters: {
4+
msw: {
5+
handlers: [http.get('*/api/auth/token', () => HttpResponse.json({
6+
code: 'AUTH_001',
7+
message: 'Unauthorized'
8+
}, {
9+
status: 401
10+
}))]
11+
}
12+
},
13+
play: async ({
14+
canvasElement
15+
}) => {
16+
const canvas = within(canvasElement);
17+
await expect(canvas.findByRole('button', {
18+
name: '로그인'
19+
})).resolves.toBeInTheDocument();
20+
await expect(canvas.findByRole('button', {
21+
name: '회원가입'
22+
})).resolves.toBeInTheDocument();
23+
}
24+
}`,...G.parameters?.docs?.source}}},K.parameters={...K.parameters,docs:{...K.parameters?.docs,source:{originalSource:`{
25+
name: '로그인 상태 — 로그아웃 버튼 표시',
26+
parameters: {
27+
msw: {
28+
handlers: [http.get('*/api/auth/token', () => HttpResponse.json({
29+
accessToken: MOCK_TOKEN
30+
}, {
31+
status: 200
32+
}))]
33+
}
34+
},
35+
play: async ({
36+
canvasElement
37+
}) => {
38+
const canvas = within(canvasElement);
39+
await expect(canvas.findByRole('button', {
40+
name: '로그아웃'
41+
})).resolves.toBeInTheDocument();
42+
}
43+
}`,...K.parameters?.docs?.source}}},q.parameters={...q.parameters,docs:{...q.parameters?.docs,source:{originalSource:`{
44+
name: '로그아웃 플로우',
45+
parameters: {
46+
msw: {
47+
handlers: [http.get('*/api/auth/token', () => HttpResponse.json({
48+
accessToken: MOCK_TOKEN
49+
}, {
50+
status: 200
51+
})), http.delete('*/api/auth/user/session', () => HttpResponse.json(null, {
52+
status: 200
53+
}))]
54+
}
55+
},
56+
play: async ({
57+
canvasElement
58+
}) => {
59+
const canvas = within(canvasElement);
60+
const logoutButton = await canvas.findByRole('button', {
61+
name: '로그아웃'
62+
});
63+
await userEvent.click(logoutButton);
64+
await expect(canvas.findByRole('button', {
65+
name: '로그인'
66+
})).resolves.toBeInTheDocument();
67+
}
68+
}`,...q.parameters?.docs?.source}}},J=[`NotLoggedIn`,`LoggedIn`,`LogoutFlow`]}))();export{K as LoggedIn,q as LogoutFlow,G as NotLoggedIn,J as __namedExportsOrder,W as default};

assets/global-navigation-bar.stories-kkIBtxzf.js

Lines changed: 0 additions & 68 deletions
This file was deleted.

assets/iframe-B5czXlpS.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)