-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create casePage, greyBadge svd and theme for the page && displayed ba…
…dges to the page Relates #10'
- Loading branch information
Showing
8 changed files
with
92 additions
and
10 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,40 @@ | ||
import React from 'react'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import { Badge, Avatar } from '../components/Image'; | ||
import { H1, H2, Text } from '../components/Text'; | ||
import { casesPageTheme } from './../components/themes'; | ||
import styled from 'styled-components'; | ||
|
||
const BadgeDisplay = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
width: 90%; | ||
`; | ||
|
||
const SubTitle = styled(H2)` | ||
margin-left: 4rem; | ||
align-self: flex-start; | ||
`; | ||
|
||
const CasesPage = ({ alias, cases }) => { | ||
const displayBadges = cases => { | ||
let badgeArray = []; | ||
for (const property in cases) { | ||
badgeArray.push(<Badge badgeType={cases[property]} />); | ||
} | ||
return badgeArray; | ||
}; | ||
|
||
const Badges = displayBadges(cases); | ||
|
||
return ( | ||
<ThemeProvider theme={casesPageTheme}> | ||
<H1>Cases solved</H1> | ||
<Avatar className="avatar" /> | ||
<Text>Alias: {alias}</Text> | ||
<SubTitle>Badges</SubTitle> | ||
<BadgeDisplay>{Badges}</BadgeDisplay> | ||
</ThemeProvider> | ||
); | ||
}; | ||
export default CasesPage; |
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