Skip to content

Commit

Permalink
Merge pull request #1434 from cozy/bar-title
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne authored Apr 17, 2020
2 parents 6236d71 + ab01c10 commit 0fe89fb
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ module.exports = {
sections: [
{
name: 'Bar',
components: () => ['../react/BarButton/index.jsx']
components: () => [
'../react/BarButton/index.jsx',
'../react/BarTitle/index.jsx'
]
},
{
name: 'Basics',
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions react/BarTitle/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Used to display a title in the Cozy Bar.

### Usage

```jsx static
import { useBreakpoints } from 'cozy-ui/transpiled/react/hooks/useBreakpoints'

const MyPage = () => {
const { isMobile } = useBreakpoints()
return (
<BarCenter>
{isMobile ? <BarTitle>My transactions</BarTitle> : null }
</BarCenter>
)
}
```


### Display

```
<BarTitle>My transactions</BarTitle>
```
8 changes: 8 additions & 0 deletions react/BarTitle/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react'
import styles from './styles.styl'

const BarTitle = ({ children }) => {
return <h1 className={styles.BarTitle}>{children}</h1>
}

export default BarTitle
8 changes: 8 additions & 0 deletions react/BarTitle/styles.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@require 'settings/typography.styl'

.BarTitle
margin 0
height 3rem
display flex
align-items center
font-size $bar-font-size
1 change: 1 addition & 0 deletions stylus/settings/typography.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

$h1-font-size=rem(24)
$h2-font-size=rem(20)
$bar-font-size=rem(18)
$h3-font-size=rem(18)
$h4-font-size=rem(16)
$text-font-size=rem(16)
Expand Down

0 comments on commit 0fe89fb

Please sign in to comment.