-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from daodaoedu/refactor/profile_form
Refactor/profile form
- Loading branch information
Showing
12 changed files
with
297 additions
and
226 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Typography, TextField } from '@mui/material'; | ||
import { StyledGroup } from './Edit.styled'; | ||
|
||
function EditFormInput({ | ||
title = '', | ||
parmKey = '', | ||
value = '', | ||
onChange = () => ({}), | ||
errorMsg = '', | ||
isRequire = false, | ||
placeholder = '', | ||
}) { | ||
return ( | ||
<StyledGroup> | ||
<Typography fontWeight="500"> | ||
{title} {isRequire && '*'} | ||
</Typography> | ||
<TextField | ||
name={parmKey} | ||
value={value} | ||
fullWidth | ||
placeholder={placeholder} | ||
onChange={(e) => onChange({ key: parmKey, value: e.target.value })} | ||
error={!!errorMsg} | ||
helperText={errorMsg} | ||
/> | ||
</StyledGroup> | ||
); | ||
} | ||
|
||
export default EditFormInput; |
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,21 @@ | ||
export const NAME = 'name'; | ||
export const PHOTO_URL = 'photoURL'; | ||
export const BIRTHDAY = 'birthDay'; | ||
export const GENDER = 'gender'; | ||
export const ROLE_LIST = 'roleList'; | ||
export const WANT_TO_DO_LIST = 'wantToDoList'; | ||
export const INSTAGRAM = 'instagram'; | ||
export const FACEBOOK = 'facebook'; | ||
export const DISCORD = 'discord'; | ||
export const LINE = 'line'; | ||
export const EDUCATION_STAGE = 'educationStage'; | ||
export const LOCATION = 'location'; | ||
export const TAG_LIST = 'tagList'; | ||
export const SELF_INTRODUCTION = 'selfIntroduction'; | ||
export const SHARE = 'share'; | ||
export const IS_OPEN_LOCATION = 'isOpenLocation'; | ||
export const IS_OPEN_PROFILE = 'isOpenProfile'; | ||
export const IS_LOADING_SUBMIT = 'isLoadingSubmit'; | ||
export const COUNTRY = 'country'; | ||
export const CITY = 'city'; | ||
export const DISTRICT = 'district'; |
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,44 @@ | ||
import React from 'react'; | ||
import { LazyLoadImage } from 'react-lazy-load-image-component'; | ||
|
||
import { Skeleton } from '@mui/material'; | ||
|
||
const EditAvator = ({ | ||
url = 'https://imgur.com/EADd1UD.png', | ||
height = 128, | ||
width = 128, | ||
}) => { | ||
return ( | ||
<LazyLoadImage | ||
alt="login" | ||
src={url} | ||
height={height} | ||
width={width} | ||
effect="opacity" | ||
style={{ | ||
marginTop: '24px', | ||
borderRadius: '100%', | ||
background: 'rgba(240, 240, 240, .8)', | ||
objectFit: 'cover', | ||
objectPosition: 'center', | ||
minWidth: `${width}px`, | ||
minHeight: `${height}px`, | ||
}} | ||
placeholder={ | ||
// eslint-disable-next-line react/jsx-wrap-multilines | ||
<Skeleton | ||
sx={{ | ||
height: '128px', | ||
width: '128px', | ||
background: 'rgba(240, 240, 240, .8)', | ||
marginTop: '4px', | ||
}} | ||
variant="circular" | ||
animation="wave" | ||
/> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default EditAvator; |
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.