-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade packages. Fixup mui styling change to Dialog button. Add fixt…
…ures for Dialog, About and fix ControlButton. (#682) Signed-off-by: Pablo Mayrgundter <pablo.mayrgundter@gmail.com>
- Loading branch information
1 parent
ca07d4d
commit 50f423a
Showing
8 changed files
with
179 additions
and
146 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,21 @@ | ||
import React from 'react' | ||
import {HelmetProvider} from 'react-helmet-async' | ||
import {ThemeProvider} from '@mui/material/styles' | ||
import useShareTheme from '../../theme/Theme' | ||
import {AboutDialog} from './AboutControl' | ||
|
||
|
||
/** @return {React.Component} */ | ||
export default function Example() { | ||
return ( | ||
<HelmetProvider> | ||
<ThemeProvider theme={useShareTheme()}> | ||
<AboutDialog | ||
isDialogDisplayed={true} | ||
// eslint-disable-next-line no-empty-function | ||
setIsDialogDisplayed={() => {}} | ||
/> | ||
</ThemeProvider> | ||
</HelmetProvider> | ||
) | ||
} |
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,20 @@ | ||
import React from 'react' | ||
import Dialog from './Dialog' | ||
import AttentionIcon from '../assets/icons/Attention.svg' | ||
|
||
|
||
export default ( | ||
<Dialog | ||
icon={<AttentionIcon/>} | ||
headerText={'Here\'s the thing!'} | ||
isDialogDisplayed={true} | ||
// eslint-disable-next-line no-empty-function | ||
setIsDialogDisplayed={() => {}} | ||
content={'What you should know about doing the thing'} | ||
actionTitle={'Do do the thing?'} | ||
actionCb={() => { | ||
// eslint-disable-next-line no-alert | ||
alert('You did the thing') | ||
}} | ||
/> | ||
) |
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,36 +1,32 @@ | ||
import React, {useState} from 'react' | ||
import {ControlButton} from '../../Components/Buttons' | ||
import Announcement from '@mui/icons-material/Announcement' | ||
import Dialog from '../../Components/Dialog' | ||
import AnnouncementIcon from '@mui/icons-material/Announcement' | ||
|
||
|
||
/** | ||
* @property {string} title Title of the button | ||
* Demo controlled component with open/close. | ||
* | ||
* @return {React.Component} | ||
*/ | ||
export default function ControlButtonFixture({title}) { | ||
const [isDialogDisplayed, setIsDialogDisplayed] = useState(true) | ||
const dialog = ( | ||
<Dialog | ||
icon={<Announcement/>} | ||
headerText={'Example Dialog'} | ||
isDialogDisplayed={isDialogDisplayed} | ||
setIsDialogDisplayed={setIsDialogDisplayed} | ||
content={'Example content.'} | ||
actionTitle={'Action title.'} | ||
actionCb={() => console.log('action callback')} | ||
actionIcon={<Announcement/>} | ||
/> | ||
) | ||
|
||
|
||
export default function Control() { | ||
const [isDisplayed, setIsDisplayed] = useState(false) | ||
return ( | ||
<ControlButton | ||
title={title} | ||
isDialogDisplayed={isDialogDisplayed} | ||
setIsDialogDisplayed={setIsDialogDisplayed} | ||
icon={<Announcement/>} | ||
dialog={dialog} | ||
title={'title'} | ||
isDialogDisplayed={isDisplayed} | ||
setIsDialogDisplayed={setIsDisplayed} | ||
icon={<AnnouncementIcon/>} | ||
dialog={ | ||
<div style={{border: 'solid 1px black'}}> | ||
{isDisplayed ? | ||
<div> | ||
<h1>Controlled component</h1> | ||
<button onClick={() => setIsDisplayed(false)}>Close</button> | ||
</div> : | ||
null} | ||
</div> | ||
} | ||
placement={'left'} | ||
/>) | ||
/> | ||
) | ||
} |
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.