-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update on MUI and using localStorage for search.
- Loading branch information
1 parent
1f65225
commit b55ba91
Showing
13 changed files
with
108 additions
and
94 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
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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import ReactHtmlParser from 'react-html-parser'; | ||
// TODO Substituir esta biblioteca para formatar a formula molecular. | ||
import HTMLParser from 'fast-html-parser'; | ||
|
||
import Grid from '@material-ui/core/Grid'; | ||
import Tooltip from '@material-ui/core/Tooltip'; | ||
import Grid from '@mui/material/Grid'; | ||
import Tooltip from '@mui/material/Tooltip'; | ||
|
||
const MolecularFormula = ({ formula }) => { | ||
let formattedFormula = formula.split('').map( (s) => { | ||
return s.match(/[0-9]/i) ? `<sub>${s}</sub>` : s; | ||
}).reduce((str, l) => str + l); | ||
|
||
return( | ||
<Grid container justify="space-between"> | ||
<Grid container justifyContent="space-between"> | ||
<Grid item> | ||
<Tooltip title="Molecular Formula" enterDelay={500}> | ||
<b>Molecular Formula:</b> | ||
</Tooltip> | ||
</Grid> | ||
<Grid item> | ||
{ ReactHtmlParser(formattedFormula) } | ||
{ formula } | ||
</Grid> | ||
</Grid> | ||
); | ||
} | ||
|
||
export default MolecularFormula; | ||
export default MolecularFormula; |
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
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
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