Newer
Older
import React from 'react'
import { th } from '@pubsweet/ui-toolkit'
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import styled, { css } from 'styled-components'
const BreadcrumbsHeader = ({
history,
showBack,
title = '',
info = '',
underlined,
}) => (
<Root underlined={underlined}>
{showBack && <BackButton onClick={() => history.goBack()}>Back</BackButton>}
{title && <Title>{title}</Title>}
{info && <Content>{info}</Content>}
</Root>
)
export default BreadcrumbsHeader
// #region styles
const Root = styled.div`
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: ${th('gridUnit')};
border-bottom: ${({ underlined }) =>
underlined ? th('borderDefault') : 'none'};
padding-bottom: ${({ underlined }) => (underlined ? th('gridUnit') : '0')};
`
const defaultText = css`
color: ${th('colorPrimary')};
font-family: ${th('fontHeading')};
font-size: ${th('fontSizeBase')};
text-align: left;
padding: 0 calc(${th('subGridUnit')}*2);
`
const Title = styled.span`
${defaultText};
font-size: ${th('fontSizeHeading5')};
font-weight: bold;
`
const Content = styled.span`
${defaultText};
`
const BackButton = styled.span`
color: ${th('colorPrimary')};
font-size: ${th('fontSizeBase')};
text-align: left;
cursor: pointer;
padding-right: calc(${th('subGridUnit')}*2);
&:before {
content: '<';
padding-right: calc(${th('subGridUnit')}*2);
}
`
// #endregion