-
Notifications
You must be signed in to change notification settings - Fork 0
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
User info desktop/#81 #83
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
eabf34e
[web] feat: Add Avatar component
seonghunYang 6289fe7
[web] chore: Add profile image asset
seonghunYang e9b6c3a
[web] feat: Add Avatar component and stories
seonghunYang 07b30ea
[web] feat: Add UserInfoNavigator component to MyPage
seonghunYang 1c87404
feat: Add Suspense to UserInfoNavigator component and increase delay โฆ
seonghunYang 3ef3f99
feat: Add skeleton component
seonghunYang dfb171e
feat: Add UserInfoNavigatorSkeleton component
seonghunYang 498d929
fix: Fix authorization check in user-handler.mock.ts
seonghunYang a2266a7
refactor: Refactor user-info-navigator component
seonghunYang 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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Avatar from '../../view/atom/avatar/avatar'; | ||
import Button from '../../view/atom/button/button'; | ||
import { getUserInfo } from '@/app/business/user/user.query'; | ||
import Skeleton from '../../view/atom/skeleton'; | ||
|
||
export default async function UserInfoNavigator() { | ||
const userInfo = await getUserInfo(); | ||
|
||
return ( | ||
<div className="flex flex-col items-center p-4 "> | ||
<Avatar className="w-24 h-24" alt="Profile picture" src={'/assets/profile-image.png'} /> | ||
|
||
<div className="my-5 text-lg"> | ||
<span className="font-semibold">{userInfo.studentName}</span> | ||
<span>๋</span> | ||
</div> | ||
<div className="mb-3 text-sm">{userInfo.major}</div> | ||
<div className="text-sm text-gray-400">{userInfo.studentNumber}</div> | ||
|
||
<div className="mt-9"> | ||
<Button size="sm" variant="secondary" label="๋ก๊ทธ์์" /> | ||
</div> | ||
<div className="mt-2"> | ||
<Button size="sm" variant="text" label="ํ์ํํดํ๊ธฐ" /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export function UserInfoNavigatorSkeleton() { | ||
return ( | ||
<div className="flex flex-col items-center p-4 space-y-3"> | ||
<Skeleton className="h-24 w-24 rounded-full" /> | ||
<div className="space-y-6"> | ||
<Skeleton className="h-4 w-24" /> | ||
<Skeleton className="h-4 w-32" /> | ||
<Skeleton className="h-4 w-32" /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import Avatar from './avatar'; | ||
|
||
const meta = { | ||
title: 'ui/view/atom/Avatar', | ||
component: Avatar, | ||
} as Meta<typeof Avatar>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
src: './assets/profile-image.png', | ||
}, | ||
}; |
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,57 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import * as AvatarPrimitive from '@radix-ui/react-avatar'; | ||
|
||
import { cn } from '@/app/utils/shadcn/utils'; | ||
|
||
interface AvatarProps { | ||
src: string; | ||
fallback?: React.ReactNode; | ||
alt?: string; | ||
className?: string; | ||
} | ||
|
||
export default function Avatar({ src, fallback, alt, className }: AvatarProps) { | ||
return ( | ||
<AvatarRoot className={className}> | ||
<AvatarImage src={src} alt={alt} /> | ||
<AvatarFallback>{fallback}</AvatarFallback> | ||
</AvatarRoot> | ||
); | ||
} | ||
|
||
const AvatarRoot = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Root | ||
ref={ref} | ||
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)} | ||
{...props} | ||
/> | ||
)); | ||
AvatarRoot.displayName = AvatarPrimitive.Root.displayName; | ||
|
||
const AvatarImage = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Image>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Image ref={ref} className={cn('aspect-square h-full w-full', className)} {...props} /> | ||
)); | ||
AvatarImage.displayName = AvatarPrimitive.Image.displayName; | ||
|
||
const AvatarFallback = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Fallback>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Fallback | ||
ref={ref} | ||
className={cn( | ||
'flex h-full w-full items-center justify-center rounded-full bg-slate-100 dark:bg-slate-800', | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; |
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,5 @@ | ||
import { cn } from '@/app/utils/shadcn/utils'; | ||
|
||
export default function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) { | ||
return <div className={cn('animate-pulse rounded-md bg-slate-100 dark:bg-slate-800', className)} {...props} />; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
accessToken ์ด "undefined"์ธ ๊ฒฝ์ฐ์ ๋ํด ์ค๋ช ํด์ฃผ์ค ์ ์๋์??
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.