-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] Make everything beautiful (maaaaagic...)
- Loading branch information
1 parent
b5465e5
commit 15a5c8d
Showing
48 changed files
with
709 additions
and
220 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styled from 'styled-components/macro' | ||
|
||
type Props = { | ||
hasFooter?: boolean | ||
} | ||
|
||
const ModalBodyWrapper = styled('div')<Props>` | ||
margin: auto; | ||
height: ${props => (props.hasFooter ? 'calc(100% - 64px)' : '100%')}; | ||
width: 100%; | ||
padding: 24px; | ||
position: relative; | ||
overflow-y: auto; | ||
> *:first-child { | ||
margin-top: 0; | ||
} | ||
` | ||
|
||
export default ModalBodyWrapper |
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,24 @@ | ||
import styled from 'styled-components/macro' | ||
|
||
const ModalFooterWrapper = styled('div')` | ||
margin: auto; | ||
height: 64px; | ||
width: 100%; | ||
padding: 0 24px; | ||
position: relative; | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
border-top: 1px solid rgba(0, 0, 0, 0.1); | ||
margin-top: -1px; | ||
button { | ||
width: 100%; | ||
} | ||
button + button { | ||
margin-left: 16px; | ||
} | ||
` | ||
|
||
export default ModalFooterWrapper |
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,12 +1,7 @@ | ||
import styled from 'styled-components' | ||
|
||
const Body = styled('div')` | ||
margin: auto; | ||
height: calc(100% - 64px); | ||
width: 100%; | ||
padding: 24px; | ||
position: relative; | ||
overflow-y: auto; | ||
` | ||
|
||
export default Body |
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,16 @@ | ||
import styled from 'styled-components' | ||
|
||
const Footer = styled('div')` | ||
margin: auto; | ||
height: 64px; | ||
width: 100%; | ||
padding: 0 24px; | ||
position: relative; | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
border-top: 1px solid rgba(0, 0, 0, 0.1); | ||
margin-top: -1px; | ||
` | ||
|
||
export default Footer |
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
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
9 changes: 9 additions & 0 deletions
9
src/components/molecules/TreasureList/TreasureGridWrapper.tsx
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,9 @@ | ||
import styled from 'styled-components/macro' | ||
|
||
const TreasureGridWrapper = styled('div')` | ||
margin-top: 24px; | ||
` | ||
|
||
TreasureGridWrapper.displayName = 'TreasureGridWrapper' | ||
|
||
export default TreasureGridWrapper |
28 changes: 28 additions & 0 deletions
28
src/components/molecules/TreasureList/TreasureTile/Body.tsx
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,28 @@ | ||
import React from 'react' | ||
import List from '@material-ui/core/List' | ||
|
||
import { Treasure } from '../../../../types' | ||
|
||
import AbilityText from '../../../atoms/AbilityText' | ||
|
||
import InfoItem from '../../InfoItem' | ||
|
||
import Name from './Name' | ||
|
||
type Props = { | ||
treasure: Treasure | ||
} | ||
|
||
const Body = React.memo(({ treasure }: Props) => ( | ||
<React.Fragment> | ||
<Name component="p">{treasure.name}</Name> | ||
<List> | ||
<InfoItem label="Set" info={treasure.expansion} /> | ||
<InfoItem label="Treasure Level" info={treasure.level.toString()} /> | ||
{treasure.subtype && <InfoItem label="Subtype" info={treasure.subtype} />} | ||
</List> | ||
<AbilityText dangerouslySetInnerHTML={{ __html: treasure.effect }} /> | ||
</React.Fragment> | ||
)) | ||
|
||
export default Body |
10 changes: 10 additions & 0 deletions
10
src/components/molecules/TreasureList/TreasureTile/Name.tsx
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,10 @@ | ||
import styled from 'styled-components/macro' | ||
import Typography from '@material-ui/core/Typography' | ||
|
||
const Name = styled(Typography)` | ||
font-weight: bold; | ||
` | ||
|
||
Name.displayName = 'Name' | ||
|
||
export default Name |
16 changes: 16 additions & 0 deletions
16
src/components/molecules/TreasureList/TreasureTile/Wrapper.tsx
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,16 @@ | ||
import styled from 'styled-components/macro' | ||
import Grid from '@material-ui/core/Grid' | ||
|
||
import TileWrapper from '../../Tile/Wrapper' | ||
|
||
const Wrapper = styled(Grid)` | ||
${TileWrapper} { | ||
min-height: 148px; | ||
min-width: 30px; | ||
height: 100%; | ||
} | ||
` | ||
|
||
Wrapper.displayName = 'Wrapper' | ||
|
||
export default Wrapper |
Oops, something went wrong.