File tree Expand file tree Collapse file tree 11 files changed +96
-27
lines changed Expand file tree Collapse file tree 11 files changed +96
-27
lines changed Original file line number Diff line number Diff line change
1
+ import Image from "next/image" ;
2
+
3
+ import NoUserImage from "@Components/atom/images/no-image/NoUserImage" ;
4
+
5
+ import { UserImageProps } from "@Components/atom/images/interface/userImageProps" ;
6
+
7
+ const UserImage = ( { avatar, cursor = false } : UserImageProps ) => {
8
+ if ( ! avatar ) return < NoUserImage cursor = { cursor } /> ;
9
+ return (
10
+ < Image
11
+ className = { `rounded-full ${ cursor ? "cursor-pointer" : "" } ` }
12
+ layout = "fill"
13
+ alt = "avatar"
14
+ src = { avatar }
15
+ />
16
+ ) ;
17
+ } ;
18
+ export default UserImage ;
Original file line number Diff line number Diff line change
1
+ import {
2
+ UserImageProps ,
3
+ NoUserImageProps ,
4
+ } from "@Components/atom/images/interface/userImageProps" ;
5
+
6
+ export type { UserImageProps , NoUserImageProps } ;
Original file line number Diff line number Diff line change
1
+ export interface UserImageProps {
2
+ avatar : string | null ;
3
+ cursor ?: boolean ;
4
+ }
5
+
6
+ export interface NoUserImageProps {
7
+ cursor ?: boolean ;
8
+ }
Original file line number Diff line number Diff line change
1
+ import { NoUserImageProps } from "@Components/atom/images/interface/userImageProps" ;
2
+
3
+ const NoUserImage = ( { cursor = false } : NoUserImageProps ) => {
4
+ return (
5
+ < div
6
+ className = { `${
7
+ cursor ? "cursor-pointer" : ""
8
+ } w-full h-full rounded-full dark:bg-neutral-100 bg-neutral-700`}
9
+ />
10
+ ) ;
11
+ } ;
12
+
13
+ export default NoUserImage ;
Original file line number Diff line number Diff line change
1
+ import UserNameProp from "@Components/atom/user/interface/userNameProp" ;
2
+
3
+ const UserName = ( { userNameStyle, children } : UserNameProp ) => (
4
+ < span
5
+ className = { `ml-3 text-xl font-semibold text-neutral-600 dark:text-neutral-50 font-eng-sub-font-1 ${ userNameStyle } ` }
6
+ >
7
+ { children }
8
+ </ span >
9
+ ) ;
10
+
11
+ export default UserName ;
Original file line number Diff line number Diff line change
1
+ import UserNameProp from "@Components/atom/user/interface/userNameProp" ;
2
+
3
+ export type { UserNameProp } ;
Original file line number Diff line number Diff line change
1
+ import { ReactNode } from "react" ;
2
+
3
+ export default interface UserNameProp {
4
+ userNameStyle ?: string ;
5
+ children : ReactNode ;
6
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import UserImage from "@Components/atom/images/UserImage" ;
2
+ import UserName from "@Components/atom/user/UserName" ;
3
+ import { ProfileUserProps } from "@Components/molecules/user/interface" ;
4
+
5
+ const UserProfile = ( {
6
+ cursor,
7
+ userNameStyle,
8
+ UserImageStyle,
9
+ avatar,
10
+ children,
11
+ } : ProfileUserProps ) => {
12
+ return (
13
+ < div className = "flex items-center" >
14
+ < div className = { `relative ${ UserImageStyle } ` } >
15
+ < UserImage cursor = { cursor } avatar = { avatar } />
16
+ </ div >
17
+ < UserName userNameStyle = { userNameStyle } > { children } </ UserName >
18
+ </ div >
19
+ ) ;
20
+ } ;
21
+
22
+ export default UserProfile ;
Original file line number Diff line number Diff line change
1
+ import ProfileUserProps from "@Components/molecules/user/interface/profileUserProps" ;
2
+
3
+ export type { ProfileUserProps } ;
You can’t perform that action at this time.
0 commit comments