generated from graasp/graasp-repo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build library profile page (UI) (#41)
* feat: build library profile page (UI) * style: add icons to social media link * build: connect public profile with hooks and mutations * feat: use social-links module to subtract social links * fix: rename from library profile to public profile and create a custom text editor component * fix: rename to public profile instead of library profile * fix: fix input's name to sync with profile data * fix: remove reolution i18next and linting * fix: update query client version
- Loading branch information
Showing
10 changed files
with
1,573 additions
and
1,852 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,57 @@ | ||
import React from 'react'; | ||
|
||
import { IconButton, InputAdornment, SvgIcon, TextField } from '@mui/material'; | ||
|
||
interface Props { | ||
label: string; | ||
value: string; | ||
name: string; | ||
helperText: string | false; | ||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
Icon?: typeof SvgIcon; | ||
isError: boolean; | ||
rows?: number; | ||
multiline?: boolean; | ||
required?: boolean; | ||
} | ||
const TextFieldWithValidation = ({ | ||
label, | ||
onChange, | ||
value, | ||
name, | ||
Icon, | ||
helperText, | ||
isError, | ||
rows = 4, | ||
multiline = false, | ||
required = false, | ||
}: Props): JSX.Element => ( | ||
<TextField | ||
label={label} | ||
variant="outlined" | ||
onChange={onChange} | ||
type="text" | ||
margin="dense" | ||
fullWidth | ||
name={name} | ||
value={value} | ||
helperText={helperText} | ||
error={isError} | ||
rows={rows} | ||
required={required} | ||
multiline={multiline} | ||
InputProps={ | ||
Icon && { | ||
startAdornment: ( | ||
<InputAdornment position="start"> | ||
<IconButton edge="end"> | ||
<Icon /> | ||
</IconButton> | ||
</InputAdornment> | ||
), | ||
} | ||
} | ||
/> | ||
); | ||
|
||
export default TextFieldWithValidation; |
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.