Skip to content

Commit ba9419e

Browse files
committed
feat(home): implement top banner
1 parent 33226ad commit ba9419e

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

src/assets/icons/underline.svg

+3
Loading

src/components/top-banner.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Card, Col, Row } from 'antd'
2+
import PropTypes from 'prop-types'
3+
import React from 'react'
4+
import { ReactComponent as Underline } from '../assets/icons/underline.svg'
5+
import styled from 'styled-components/macro'
6+
7+
const StyledRow = styled(Row)`
8+
line-height: 32px;
9+
`
10+
const StyledTitleCol = styled(Col)`
11+
font-weight: bold;
12+
`
13+
const StyledUnderline = styled(Underline)`
14+
bottom: -8px;
15+
left: 0;
16+
position: absolute;
17+
`
18+
const TopBanner = ({ description, extra, title }) => (
19+
<Card>
20+
<StyledRow>
21+
<StyledTitleCol offset={2} span={6}>
22+
{title}
23+
<StyledUnderline className="primary" />
24+
</StyledTitleCol>
25+
<Col span={12}>{description}</Col>
26+
<Col span={4}>{extra}</Col>
27+
</StyledRow>
28+
</Card>
29+
)
30+
31+
TopBanner.propTypes = {
32+
description: PropTypes.string.isRequired,
33+
extra: PropTypes.node.isRequired,
34+
title: PropTypes.string.isRequired
35+
}
36+
37+
export default TopBanner

src/containers/home.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
export default () => 'Home'
1+
import { Button } from 'antd'
2+
import React from 'react'
3+
import TopBanner from '../components/top-banner'
4+
5+
export default () => (
6+
<TopBanner
7+
description="Get started by buying PNK if you don't have any already."
8+
extra={
9+
<Button size="large" type="primary">
10+
Buy PNK
11+
</Button>
12+
}
13+
title="Welcome to the Kleros Juror Dashboard!"
14+
/>
15+
)

0 commit comments

Comments
 (0)