-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'frontend' of https://github.com/Kernel360/F2-TECHPICK i…
…nto front/feat/#612
- Loading branch information
Showing
17 changed files
with
114 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { HTTPError } from 'ky'; | ||
import { apiClient } from '@/apis/apiClient'; | ||
import { API_URLS } from './apiConstants'; | ||
import { returnErrorFromHTTPError } from './error'; | ||
|
||
export const postLogout = async () => { | ||
try { | ||
await apiClient.post(API_URLS.POST_LOGOUT); | ||
} catch (httpError) { | ||
if (httpError instanceof HTTPError) { | ||
const error = await returnErrorFromHTTPError(httpError); | ||
throw error; | ||
} | ||
throw httpError; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
import { colorVars } from 'techpick-shared'; | ||
|
||
export const myPageLayoutStyle = style({ | ||
width: '100%', | ||
height: '100vh', | ||
padding: '12px', | ||
backgroundColor: colorVars.gold2, | ||
}); | ||
|
||
export const buttonSectionLayout = style({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
height: '100%', | ||
}); | ||
|
||
export const logoutButtonStyle = style({ | ||
width: '120px', | ||
height: '32px', | ||
border: '1px solid', | ||
borderColor: colorVars.red8, | ||
borderRadius: '4px', | ||
transition: 'background-color 0.3s ease', | ||
color: colorVars.red11, | ||
cursor: 'pointer', | ||
|
||
':hover': { | ||
backgroundColor: colorVars.red3, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
|
||
import { postLogout } from '@/apis/postLogout'; | ||
import { ROUTES } from '@/constants'; | ||
import { | ||
buttonSectionLayout, | ||
logoutButtonStyle, | ||
myPageLayoutStyle, | ||
} from './page.css'; | ||
|
||
export default function MyPage() { | ||
const handleLogout = async () => { | ||
try { | ||
await postLogout(); | ||
window.location.replace(ROUTES.LOGIN); | ||
} catch { | ||
/* empty */ | ||
} | ||
}; | ||
|
||
return ( | ||
<div className={myPageLayoutStyle}> | ||
<div className={buttonSectionLayout}> | ||
<button className={logoutButtonStyle} onClick={handleLogout}> | ||
로그아웃 | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
frontend/techpick/src/components/FolderTree/UserMenuBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Link from 'next/link'; | ||
import { CircleUserRoundIcon, SearchIcon } from 'lucide-react'; | ||
import { ROUTES } from '@/constants'; | ||
import { userMenuBarLayoutStyle } from './userMenuBar.css'; | ||
|
||
export function UserMenuBar() { | ||
return ( | ||
<div className={userMenuBarLayoutStyle}> | ||
<Link href={ROUTES.MY_PAGE}> | ||
<CircleUserRoundIcon /> | ||
</Link> | ||
|
||
<button> | ||
<SearchIcon /> | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
frontend/techpick/src/components/FolderTree/userMenuBar.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const userMenuBarLayoutStyle = style({ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
marginLeft: '12px', | ||
marginRight: '8px', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ globalStyle( | |
); | ||
|
||
globalStyle('body', { | ||
lineHeight: 1, | ||
lineHeight: 1.5, | ||
fontSize: '16px', | ||
}); | ||
|
||
|