-
Notifications
You must be signed in to change notification settings - Fork 96
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 #2469 from Emurgo/refactor-multiple-layouts
Refactor layout components to mui styles
- Loading branch information
Showing
13 changed files
with
237 additions
and
335 deletions.
There are no files selected for viewing
32 changes: 18 additions & 14 deletions
32
packages/yoroi-extension/app/components/layout/BackgroundColoredLayout.js
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,21 +1,25 @@ | ||
// @flow | ||
import { Component } from 'react'; | ||
import type { Node } from 'react'; | ||
import type { Node, ComponentType } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import styles from './BackgroundColoredLayout.scss'; | ||
import { Box } from '@mui/system'; | ||
|
||
type Props = {| | ||
+children: Node | ||
+children: Node, | ||
|}; | ||
|
||
@observer | ||
export default class BackgroundColoredLayout extends Component<Props> { | ||
render(): Node { | ||
const { children } = this.props; | ||
return ( | ||
<div className={styles.component}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
function BackgroundColoredLayout({ children }: Props): Node { | ||
return ( | ||
<Box | ||
sx={{ | ||
overflow: 'overlay', | ||
height: '100%', | ||
padding: '30px', | ||
background: 'var(--yoroi-palette-gray-50)', | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
} | ||
|
||
export default (observer(BackgroundColoredLayout): ComponentType<Props>); |
6 changes: 0 additions & 6 deletions
6
packages/yoroi-extension/app/components/layout/BackgroundColoredLayout.scss
This file was deleted.
Oops, something went wrong.
37 changes: 18 additions & 19 deletions
37
packages/yoroi-extension/app/components/layout/CenteredLayout.js
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,26 +1,25 @@ | ||
// @flow | ||
import { Component } from 'react'; | ||
import type { Node } from 'react'; | ||
import type { Node, ComponentType } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import styles from './CenteredLayout.scss'; | ||
import { Box } from '@mui/material'; | ||
|
||
type Props = {| | ||
+children?: Node, | ||
+children: Node, | ||
|}; | ||
|
||
@observer | ||
export default class CenteredLayout extends Component<Props> { | ||
|
||
static defaultProps: {|children: void|} = { | ||
children: undefined | ||
}; | ||
|
||
render(): Node { | ||
const { children } = this.props; | ||
return ( | ||
<div className={styles.component}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
function CenteredLayout({ children }: Props): Node { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
backgroundColor: 'var(--yoroi-loading-background-color)', | ||
height: '100%', | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
} | ||
export default (observer(CenteredLayout): ComponentType<Props>); |
7 changes: 0 additions & 7 deletions
7
packages/yoroi-extension/app/components/layout/CenteredLayout.scss
This file was deleted.
Oops, something went wrong.
Empty file.
33 changes: 20 additions & 13 deletions
33
packages/yoroi-extension/app/components/layout/HorizontalFlexContainer.js
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,21 +1,28 @@ | ||
// @flow | ||
import { Component } from 'react'; | ||
import type { Node } from 'react'; | ||
import type { Node, ComponentType } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import styles from './HorizontalFlexContainer.scss'; | ||
import { Box } from '@mui/system'; | ||
|
||
type Props = {| | ||
+children: ?Node, | ||
|}; | ||
|
||
@observer | ||
export default class HorizontalFlexContainer extends Component<Props> { | ||
render(): Node { | ||
const { children } = this.props; | ||
return ( | ||
<div className={styles.component}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
function HorizontalFlexContainer({ children }: Props): Node { | ||
return ( | ||
<Box | ||
sx={{ | ||
width: '100%', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
position: 'relative', | ||
'&::-webkit-scrollbar-button': { | ||
width: '7px', | ||
display: 'block', | ||
}, | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
} | ||
export default (observer(HorizontalFlexContainer): ComponentType<Props>); |
11 changes: 0 additions & 11 deletions
11
packages/yoroi-extension/app/components/layout/HorizontalFlexContainer.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.