-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rephrase word choices for user gender on client's advice * Create a dedicated image box for single image display * Use switch to toggle showing and hiding animation * Show save/cancel buttons explicitly on profile page but save button enabled only when there's some editing * Use CSS styles for background image for better perf * Enhance appearance of user goal panel on profile page * Bugfix
- Loading branch information
Showing
12 changed files
with
398 additions
and
201 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 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,38 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import { Box } from '@mui/material'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
interface ImgBoxProps { | ||
imgSrc?: string; | ||
alt?: string; | ||
size: number; | ||
} | ||
|
||
const CircImgFrame = styled(Box)<ImgBoxProps>(({ theme, size }) => ({ | ||
border: `1px solid ${theme.palette.primary.main}`, | ||
borderRadius: '50%', | ||
overflow: 'hidden', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
height: size, | ||
width: size, | ||
})); | ||
|
||
const StyledImg = styled('img')({ | ||
width: '100%', | ||
height: '100%', | ||
objectFit: 'cover', | ||
}); | ||
|
||
|
||
export function CircImgBox({imgSrc, alt, size}: ImgBoxProps) { | ||
return ( | ||
<CircImgFrame size={size}> | ||
<StyledImg src={imgSrc} alt={alt} /> | ||
</CircImgFrame> | ||
); | ||
}; | ||
|
||
// TODO: add a rectangle image box |
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 |
---|---|---|
|
@@ -23,11 +23,11 @@ export const AVATARS: string[] = [ | |
export const DUSER: User = { | ||
email: '[email protected]', | ||
name: 'Joyfule Jar', | ||
gender: 'Secret', | ||
gender: 'Prefer not to say', | ||
phone: '', | ||
avatar: DEFAULT_AVATAR, | ||
task: { | ||
goal: 0, | ||
setDate: '', | ||
goal: 100, | ||
setDate: '2024-10-08', | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
// Common interfaces | ||
export interface Task { | ||
goal: number, | ||
setDate: string, | ||
goal: number; | ||
setDate: string; | ||
}; | ||
|
||
export interface User { | ||
email: string, | ||
name: string, | ||
gender?: string, | ||
phone?: string, | ||
avatar?: string, | ||
task?: Task, | ||
email: string; | ||
name: string; | ||
gender?: string; | ||
phone?: string; | ||
avatar?: string; | ||
task?: Task; | ||
}; | ||
|
||
export interface UserProfileProps { | ||
user: User, | ||
user: User; | ||
handler: (update: Partial<User>) => void; | ||
}; |
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
Oops, something went wrong.