diff --git a/docs/styleguide.config.js b/docs/styleguide.config.js index 05f4508252..eea1c4e573 100644 --- a/docs/styleguide.config.js +++ b/docs/styleguide.config.js @@ -56,7 +56,8 @@ module.exports = { '../react/Well/index.jsx', '../react/Infos/index.jsx', '../react/ContextHeader/index.jsx', - '../react/Filename/index.jsx' + '../react/Filename/index.jsx', + '../react/AppTitle/index.jsx' ] }, { diff --git a/react/AppTitle/Readme.md b/react/AppTitle/Readme.md new file mode 100644 index 0000000000..bb059261d6 --- /dev/null +++ b/react/AppTitle/Readme.md @@ -0,0 +1,8 @@ +Displays the App title in the Cozy Bar + +### Default + +``` +Drive +``` + diff --git a/react/AppTitle/index.jsx b/react/AppTitle/index.jsx new file mode 100644 index 0000000000..89ca72b957 --- /dev/null +++ b/react/AppTitle/index.jsx @@ -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 ( + + {children} + + ) +} + +AppTitle.propTypes = { + className: PropTypes.string +} + +AppTitle.defaultProps = { + className: '' +} + +export default AppTitle diff --git a/react/AppTitle/styles.styl b/react/AppTitle/styles.styl new file mode 100644 index 0000000000..5e4a66b6f5 --- /dev/null +++ b/react/AppTitle/styles.styl @@ -0,0 +1,5 @@ +@require '../../stylus/components/apptitle' + +.c-apptitle + @extend $apptitle + diff --git a/react/__snapshots__/examples.spec.jsx.snap b/react/__snapshots__/examples.spec.jsx.snap index 76a844165c..1c1161380d 100644 --- a/react/__snapshots__/examples.spec.jsx.snap +++ b/react/__snapshots__/examples.spec.jsx.snap @@ -12,6 +12,12 @@ exports[`ActionMenu should render examples: ActionMenu 2`] = ` " `; +exports[`AppTitle should render examples: AppTitle 1`] = ` +"
+

Drive

+
" +`; + exports[`Avatar should render examples: Avatar 1`] = ` "
diff --git a/react/examples.spec.jsx b/react/examples.spec.jsx index ad49ef082b..9c955ef675 100644 --- a/react/examples.spec.jsx +++ b/react/examples.spec.jsx @@ -21,6 +21,7 @@ testComponent('MuiCozyTheme/Buttons') testComponent('MuiCozyTheme/Menus') testComponent('MuiCozyTheme/ExpansionPanel') testComponent('ActionMenu') +testComponent('AppTitle') testComponent('Avatar') testComponent('Badge') testComponent('BarButton') diff --git a/react/index.js b/react/index.js index 57fce880c3..dfcf6c95fb 100644 --- a/react/index.js +++ b/react/index.js @@ -67,6 +67,7 @@ export { default as Counter } from './Counter' export { default as Well } from './Well' export { default as Infos } from './Infos' export { default as AppIcon } from './AppIcon' +export { default as AppTitle } from './AppTitle' export { default as Filename } from './Filename' export { default as Viewer } from './Viewer/ViewerExposer' export { default as FileInput } from './FileInput' diff --git a/react/testFromStyleguidist.js b/react/testFromStyleguidist.js index ff0d1e4066..da84b5929c 100644 --- a/react/testFromStyleguidist.js +++ b/react/testFromStyleguidist.js @@ -15,6 +15,7 @@ import pretty from 'pretty' */ import ActionMenu from './ActionMenu' import Alerter from './Alerter' +import AppTitle from './AppTitle' import Avatar from './Avatar' import Badge from './Badge' import BarButton from './BarButton' @@ -69,6 +70,7 @@ const testFromStyleguidist = (name, markdown, require) => { 'content', 'ActionMenu', 'Alerter', + 'AppTitle', 'Avatar', 'Badge', 'BarButton', @@ -117,6 +119,7 @@ const testFromStyleguidist = (name, markdown, require) => { content, ActionMenu, Alerter, + AppTitle, Avatar, Badge, BarButton, diff --git a/stylus/components/apptitle.styl b/stylus/components/apptitle.styl new file mode 100644 index 0000000000..bb20e23ba0 --- /dev/null +++ b/stylus/components/apptitle.styl @@ -0,0 +1,5 @@ +$apptitle + display inline-flex + align-items center + margin 0 +