added optional breadcrumbs; page layout refactoring; other chages

This commit is contained in:
tmshv committed 2020-02-23 02:31:05 +03:00
1 parent 1dbbe04d59
commit db485056e0
12 files changed
+140 -63

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
import './styles.css'
import { IBreadcumbsPart } from 'src/types'
import { Button } from '../Button'
export type BreadcrumbsProps = {
style?: React.CSSProperties
path: IBreadcumbsPart[]
}
export const Breadcrumbs: React.FC<BreadcrumbsProps> = props => {
return (
<nav className={'breadcrumbs'} style={props.style}>
{props.path.map((x, i) => (
<li key={x.href}>
<Button
href={x.href}
theme={'ghost'}
size={'small'}
>
{x.name}
</Button>
{!(i < props.path.length - 1) ? null : (
<span style={{ margin: '0 var(--size-xs)' }}>/</span>
)}
</li>
))}
</nav>
)
}
+7
View File
@@ -0,0 +1,7 @@
.breadcrumbs {
display: flex;
list-style: none;
position: relative;
right: var(--size-s);
}