-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1022 from cozy/feat/AppTitle
feat: Add AppTitle component
- Loading branch information
Showing
9 changed files
with
58 additions
and
1 deletion.
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,8 @@ | ||
Displays the App title in the Cozy Bar | ||
|
||
### Default | ||
|
||
``` | ||
<AppTitle>Drive</AppTitle> | ||
``` | ||
|
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,27 @@ | ||
import React from 'react' | ||
import cx from 'classnames' | ||
import { MainTitle } from '../Text' | ||
import PropTypes from 'prop-types' | ||
import styles from './styles.styl' | ||
|
||
export const AppTitle = ({ children, className, ...restProps }) => { | ||
return ( | ||
<MainTitle | ||
tag="h1" | ||
className={cx(styles['c-apptitle'], className)} | ||
{...restProps} | ||
> | ||
{children} | ||
</MainTitle> | ||
) | ||
} | ||
|
||
AppTitle.propTypes = { | ||
className: PropTypes.string | ||
} | ||
|
||
AppTitle.defaultProps = { | ||
className: '' | ||
} | ||
|
||
export default AppTitle |
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,5 @@ | ||
@require '../../stylus/components/apptitle' | ||
|
||
.c-apptitle | ||
@extend $apptitle | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$apptitle | ||
display inline-flex | ||
align-items center | ||
margin 0 | ||
|