-
Notifications
You must be signed in to change notification settings - Fork 6
design: 왼쪽 하단 프로필 관련 화면 작업 #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
593d65a
feat: 프로필-계정설정 탭 퍼블리싱
supersett 9e25330
feat: 평가 및 피드백 모달 작업
supersett 06d762d
Merge branch 'develop' of https://github.com/depromeet/layer into 516…
supersett 8e67618
Merge branch 'develop' of https://github.com/depromeet/layer into 516…
supersett 1ce2fa4
feat: 피드백 api 없어서 toast 처리
supersett 13c8c2a
feat: mock 데이터 -> 실제데이터로 변경, 회원정보변경 api, 계정탈퇴 api, 로그아웃 기능 적용
supersett 1be3eb4
fix: ic_close 중복 export 수정
supersett b74127c
Merge branch 'develop' of https://github.com/depromeet/layer into 516…
supersett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
89 changes: 89 additions & 0 deletions
89
apps/web/src/component/common/LocalNavigationBar/UserProfileDropdown.tsx
This file contains hidden or 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,89 @@ | ||
| import { css } from "@emotion/react"; | ||
| import { forwardRef } from "react"; | ||
|
|
||
| import { DESIGN_TOKEN_COLOR } from "@/style/designTokens"; | ||
|
|
||
| type UserProfileDropdownProps = { | ||
| isOpen: boolean; | ||
| onAccountSettings: () => void; | ||
| onFeedback: () => void; | ||
| onHelp: () => void; | ||
| onLogout: () => void; | ||
| }; | ||
|
|
||
| export const UserProfileDropdown = forwardRef<HTMLDivElement, UserProfileDropdownProps>( | ||
| ({ isOpen, onAccountSettings, onFeedback, onHelp, onLogout }, ref) => { | ||
| if (!isOpen) return null; | ||
|
|
||
| return ( | ||
| <div | ||
| ref={ref} | ||
| css={css` | ||
| position: absolute; | ||
| bottom: 100%; | ||
| left: 0; | ||
| right: 0; | ||
| background: white; | ||
| border: 1px solid ${DESIGN_TOKEN_COLOR.gray200}; | ||
| border-radius: 0.8rem; | ||
| box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.1); | ||
| margin-bottom: 0.8rem; | ||
| z-index: 1000; | ||
| overflow: hidden; | ||
| animation: slideUp 0.2s ease-out; | ||
| min-width: 16.5rem; | ||
|
|
||
| @keyframes slideUp { | ||
| from { | ||
| opacity: 0; | ||
| transform: translateY(10px); | ||
| } | ||
| to { | ||
| opacity: 1; | ||
| transform: translateY(0); | ||
| } | ||
| } | ||
| `} | ||
| > | ||
| <DropdownItem onClick={onAccountSettings}>계정 설정</DropdownItem> | ||
| <DropdownItem onClick={onFeedback}>평가 및 피드백</DropdownItem> | ||
| <DropdownItem onClick={onHelp}>도움말</DropdownItem> | ||
| <DropdownItem onClick={onLogout}>로그아웃</DropdownItem> | ||
| </div> | ||
| ); | ||
| }, | ||
| ); | ||
|
|
||
| UserProfileDropdown.displayName = "UserProfileDropdown"; | ||
|
|
||
| type DropdownItemProps = { | ||
| children: React.ReactNode; | ||
| onClick: () => void; | ||
| }; | ||
|
|
||
| const DropdownItem = ({ children, onClick }: DropdownItemProps) => { | ||
| return ( | ||
| <button | ||
| css={css` | ||
| width: 100%; | ||
| padding: 0.8rem 2rem; | ||
| margin-top: 0.5rem; | ||
| margin-bottom: 0.5rem; | ||
| border: none; | ||
| background: transparent; | ||
| text-align: left; | ||
| cursor: pointer; | ||
| font-size: 1.4rem; | ||
| color: ${DESIGN_TOKEN_COLOR.gray800}; | ||
| transition: background-color 0.2s ease; | ||
|
|
||
| &:hover { | ||
| background-color: ${DESIGN_TOKEN_COLOR.gray100}; | ||
| } | ||
| `} | ||
| onClick={onClick} | ||
| > | ||
| {children} | ||
| </button> | ||
| ); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추후에 제가 만든
useClickOutside훅 사용하셔도 좋을 것 같아요!