diff --git a/package.json b/package.json index 4ec7d9f..f823b59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sha-el-design", - "version": "0.2.7", + "version": "0.2.8", "description": "React Components", "main": "./lib/", "typings": "./lib/", diff --git a/src/components/NavBar/NavBar.stories.tsx b/src/components/NavBar/NavBar.stories.tsx index 7eb21d8..2552749 100644 --- a/src/components/NavBar/NavBar.stories.tsx +++ b/src/components/NavBar/NavBar.stories.tsx @@ -3,6 +3,7 @@ import { Story, Meta } from '@storybook/react'; import { NavBar, NavBarProps } from './NavBar'; import { Md3DRotation } from 'react-icons/md'; +import { Col, Row } from '../Grid'; export default { title: 'Navigation/NavBar', @@ -12,13 +13,6 @@ export default { export const Basic: Story = (args) => ; Basic.args = { - icon: ( - - ), - title: 'Title', style: { position: 'fixed', top: 0, @@ -26,5 +20,20 @@ Basic.args = { right: 0, width: '100%', }, - action: , + children: ( + + + + + + Title + + + + + + ), }; diff --git a/src/components/NavBar/NavBar.tsx b/src/components/NavBar/NavBar.tsx index c55cb6c..5c4010f 100644 --- a/src/components/NavBar/NavBar.tsx +++ b/src/components/NavBar/NavBar.tsx @@ -1,16 +1,10 @@ import React from 'react'; import { classes } from '../../helpers'; import { elevationCss } from '../../helpers/elevations'; -import { Col, Row } from '../Grid'; import { Theme, useTheme } from '../Theme/Theme'; import { style } from './style'; export interface NavBarProps { - /** - * Brand Icon - */ - icon?: React.ReactNode; - /** * Style */ @@ -22,41 +16,24 @@ export interface NavBarProps { */ bgColor?: keyof Theme | string; - /** - * action to be displayed on right - */ - action?: React.ReactNode; - - /** - * Title - */ - title?: React.ReactNode; - /** * Elevation for shadow */ elevation?: number; /** - * Title text align + * Nav bar content */ - alignTitle?: React.CSSProperties['textAlign']; + children?: React.ReactNode; } export const NavBar: React.FC = (props) => { - const { icon, title, action } = props; const theme = useTheme(); const css = style(theme, props); return (
- - {icon} - - {title} - - {action} - + {props.children}
); }; @@ -64,5 +41,4 @@ export const NavBar: React.FC = (props) => { NavBar.defaultProps = { bgColor: 'primary', elevation: 12, - alignTitle: 'center', }; diff --git a/src/components/NavBar/style.ts b/src/components/NavBar/style.ts index 9580de9..f9c6e0b 100644 --- a/src/components/NavBar/style.ts +++ b/src/components/NavBar/style.ts @@ -12,10 +12,5 @@ export const style = (theme: Theme, props: NavBarProps) => { color: getColor(theme[props.bgColor] || props.bgColor), fontSize: '24px', }), - title: css({ - textAlign: props.alignTitle, - fontSize: '36px', - fontWeight: 300, - }), }; };