-
Notifications
You must be signed in to change notification settings - Fork 13
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 #152 from unicef/feaure/update-material-ui
Material UI 5 + React 18 & other updates
- Loading branch information
Showing
179 changed files
with
30,739 additions
and
56,861 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react"], | ||
"presets": ["@babel/preset-env", ["@babel/preset-react", { | ||
"runtime": "automatic" | ||
}]], | ||
"plugins": [ | ||
"transform-object-rest-spread", | ||
"transform-react-jsx", | ||
["@babel/plugin-transform-react-jsx", { | ||
"runtime": "automatic" | ||
}], | ||
["@babel/plugin-proposal-class-properties"] | ||
] | ||
} |
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,4 +1,4 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
} | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2 | ||
} |
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
Large diffs are not rendered by default.
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
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,13 +1,15 @@ | ||
body { | ||
background-color: #f4f4f4; | ||
overflow-x: hidden; | ||
background-color: #f4f4f4 !important; | ||
overflow-x: hidden; | ||
margin: 8px !important; | ||
} | ||
|
||
.margin-top { | ||
margin-top: 124px; | ||
} | ||
|
||
@media only screen and (max-width: 959px) { | ||
.margin-top { | ||
margin-top: 72px; | ||
} | ||
.margin-top { | ||
margin-top: 72px; | ||
} | ||
} |
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,53 @@ | ||
import React, { useState, useRef } from 'react' | ||
import { Typography, Grid } from '@mui/material' | ||
import { | ||
UAriaLive, | ||
UAriaHiddenText, | ||
UTextField, | ||
UValidatorForm, | ||
} from 'unicef-material-ui' | ||
|
||
export default function Accessibility() { | ||
const form = useRef() | ||
const [formValues, setFormValues] = useState({ email: '' }) | ||
const handleSubmit = () => {} | ||
const handleChange = e => { | ||
const { name, value } = e.target | ||
setFormValues({ | ||
...formValues, | ||
[name]: value, | ||
}) | ||
} | ||
return ( | ||
<> | ||
<Typography variant="h6">Aria live</Typography> | ||
<UAriaLive type="alert" role="alert" text="Please fill the form" /> | ||
<Typography variant="h6">Aria hidden text</Typography> | ||
<UValidatorForm | ||
onSubmit={handleSubmit} | ||
ref={form} | ||
onError={errors => console.log(errors)} | ||
instantValidate={true} | ||
noValidate | ||
> | ||
<Grid container> | ||
<Grid item xs={12} lg={3} xl={2}> | ||
<UTextField | ||
label="Email" | ||
required | ||
onChange={handleChange} | ||
name="email" | ||
validators={['required', 'isEmail']} | ||
value={formValues.email} | ||
inputProps={{ 'aria-describedby': 'email-help' }} | ||
/> | ||
<UAriaHiddenText | ||
id="email-help" | ||
text="Please enter email address" | ||
/> | ||
</Grid> | ||
</Grid> | ||
</UValidatorForm> | ||
</> | ||
) | ||
} |
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,55 +1,57 @@ | ||
import React from 'react'; | ||
import React from 'react' | ||
import { | ||
Typography, | ||
Button, | ||
Dialog, | ||
DialogActions, | ||
DialogContent, | ||
DialogContentText, | ||
DialogTitle | ||
} from '@material-ui/core'; | ||
Typography, | ||
Button, | ||
Dialog, | ||
DialogActions, | ||
DialogContent, | ||
DialogContentText, | ||
DialogTitle, | ||
} from '@mui/material' | ||
|
||
export default function Alert() { | ||
const [open, setOpen] = React.useState(false); | ||
const [open, setOpen] = React.useState(false) | ||
|
||
function handleClickOpen() { | ||
setOpen(true); | ||
} | ||
function handleClickOpen() { | ||
setOpen(true) | ||
} | ||
|
||
function handleClose() { | ||
setOpen(false); | ||
} | ||
function handleClose() { | ||
setOpen(false) | ||
} | ||
|
||
return ( | ||
<div> | ||
<Typography variant="h5" style={{ margin: '32px 0px' }}> | ||
Alert | ||
return ( | ||
<div> | ||
<Typography variant="h5" style={{ margin: '32px 0px' }}> | ||
Alert | ||
</Typography> | ||
<Button variant="outlined" color="primary" onClick={handleClickOpen}> | ||
Open alert dialog | ||
<Button variant="outlined" color="primary" onClick={handleClickOpen}> | ||
Open alert dialog | ||
</Button> | ||
<Dialog | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description" | ||
> | ||
<DialogTitle id="alert-dialog-title">{"Use Google's location service?"}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText id="alert-dialog-description"> | ||
Let Google help apps determine location. This means sending anonymous location data to | ||
Google, even when no apps are running. | ||
<Dialog | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description" | ||
> | ||
<DialogTitle id="alert-dialog-title"> | ||
{"Use Google's location service?"} | ||
</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText id="alert-dialog-description"> | ||
Let Google help apps determine location. This means sending | ||
anonymous location data to Google, even when no apps are running. | ||
</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={handleClose} color="primary"> | ||
Disagree | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={handleClose} color="primary"> | ||
Disagree | ||
</Button> | ||
<Button onClick={handleClose} color="primary" autoFocus> | ||
Agree | ||
<Button onClick={handleClose} color="primary" autoFocus> | ||
Agree | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
</div> | ||
); | ||
} | ||
</DialogActions> | ||
</Dialog> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.