Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update sidebar to the latest design system
- Loading branch information
Wojciech Krysiak
authored and
Wojciech Krysiak
committed
Sep 16, 2020
1 parent
0718b3f
commit 9cdb33c
Showing
22 changed files
with
267 additions
and
196 deletions.
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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import Sidebar from './sidebar' | ||
import SidebarParent from './sidebar-parent' | ||
import groupResources from './utils/group-resources' | ||
import SidebarResource from './sidebar-resource' | ||
|
||
export * from './sidebar-resource-section' | ||
export { SidebarParent, Sidebar, groupResources, SidebarResource } | ||
export { Sidebar, groupResources } |
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 |
---|---|---|
@@ -1,44 +1,57 @@ | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
import styled from 'styled-components' | ||
import { H5 } from '@admin-bro/design-system' | ||
import { cssClass, themeGet, Text } from '@admin-bro/design-system' | ||
|
||
import ViewHelpers from '../../../../backend/utils/view-helpers' | ||
import { BrandingOptions } from '../../../../admin-bro-options.interface' | ||
import allowOverride from '../../../hoc/allow-override' | ||
|
||
const LogoLink = styled(Link)` | ||
type Props = { | ||
branding: BrandingOptions; | ||
} | ||
|
||
const StyledLogo = styled(Link)` | ||
text-align: center; | ||
display: flex; | ||
align-items: center; | ||
align-content: center; | ||
justify-content: center; | ||
flex-shrink: 0; | ||
padding: ${themeGet('space', 'lg')} ${themeGet('space', 'xxl')} ${themeGet('space', 'xxl')}; | ||
text-decoration: none; | ||
color: ${({ theme }): string => theme.colors.grey80}; | ||
& > img { | ||
margin-right: 12px; | ||
& > h1 { | ||
text-decoration: none; | ||
font-weight: ${themeGet('fontWeights', 'bolder')}; | ||
font-size: ${themeGet('fontWeights', 'bolder')}; | ||
color: ${themeGet('colors', 'grey80')}; | ||
font-size: ${themeGet('fontSizes', 'xl')}; | ||
line-height: ${themeGet('lineHeights', 'xl')}; | ||
} | ||
&:hover h1 { | ||
color: ${themeGet('colors', 'primary100')}; | ||
} | ||
` | ||
|
||
type Props = { | ||
branding: BrandingOptions; | ||
} | ||
const h = new ViewHelpers() | ||
|
||
const SidebarBranding: React.FC<Props> = (props) => { | ||
const { branding } = props | ||
const { logo, companyName } = branding | ||
const h = new ViewHelpers() | ||
return ( | ||
<H5> | ||
<LogoLink to={h.dashboardUrl()}> | ||
{logo && ( | ||
<img | ||
src={logo} | ||
alt={companyName} | ||
height="35px" | ||
/> | ||
)} | ||
<span>{companyName}</span> | ||
</LogoLink> | ||
</H5> | ||
<StyledLogo | ||
className={cssClass('Logo')} | ||
to={h.dashboardUrl()} | ||
> | ||
{logo ? ( | ||
<img | ||
src={logo} | ||
alt={companyName} | ||
/> | ||
) : <h1>companyName</h1>} | ||
</StyledLogo> | ||
) | ||
} | ||
|
||
export default SidebarBranding | ||
export default allowOverride(SidebarBranding, 'SidebarBranding') |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.