ui: rework sidebar heading

This commit is contained in:
Jean-Philippe Sirois
2020-09-02 07:38:55 -04:00
parent 3b9f0c6367
commit 850471394e
4 changed files with 47 additions and 20 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ export const ExpandIcon = styled(Expand)`
export const ExpandResources = styled.div` export const ExpandResources = styled.div`
padding-right: 15px; padding-right: 15px;
margin: 20px 0; margin-bottom: 20px;
` `
export const ExpandResourcesHeader = styled.div` export const ExpandResourcesHeader = styled.div`
@@ -130,13 +130,13 @@ export const ExpandResourcesHeader = styled.div`
` `
export const StyledResourceList = styled.div` export const StyledResourceList = styled.div`
padding-top: 16px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
overflow: hidden; overflow: hidden;
& + & { & + & {
padding-top: 16px;
margin-top: 16px; margin-top: 16px;
border-top: 1px solid border-top: 1px solid
${(props) => transparentize(0.8, props.theme.sidebar.foreground)}; ${(props) => transparentize(0.8, props.theme.sidebar.foreground)};
+11 -7
View File
@@ -25,13 +25,17 @@ export const Sidebar: FC<PropsWithChildren<HTMLAttributes<HTMLDivElement>>> = (
return ( return (
<SC.SidebarWrapper {...restProps}> <SC.SidebarWrapper {...restProps}>
<Scrollbar> <Scrollbar>
<SC.Title to="/"> <SC.Header to="/">
The <SC.Logo>
<br /> <SC.StyledLogo />
Programmer&apos;s </SC.Logo>
<br /> <SC.Title>
Hangout The Programmer&apos;s
</SC.Title> <br />
Hangout
</SC.Title>
</SC.Header>
<SC.Inner> <SC.Inner>
{children} {children}
+32 -9
View File
@@ -2,6 +2,7 @@ import { Link } from "gatsby"
import styled, { css } from "styled-components" import styled, { css } from "styled-components"
import { transparentize } from "polished" import { transparentize } from "polished"
import { fontFamily } from "../../design/typography" import { fontFamily } from "../../design/typography"
import TPHLogo from "../../images/tph-logo.svg"
export const SidebarWrapper = styled.div` export const SidebarWrapper = styled.div`
box-sizing: border-box; box-sizing: border-box;
@@ -29,21 +30,43 @@ export const SidebarWrapper = styled.div`
} }
` `
export const Title = styled(Link)` export const Header = styled(Link)`
display: block; display: flex;
color: ${(props) => props.theme.sidebar.foreground}; align-items: stretch;
font-size: 30px;
line-height: 34px;
font-weight: 700;
padding: 20px 0 0 20px;
text-decoration: none; text-decoration: none;
font-family: ${fontFamily.header};
&:hover { &:hover > * {
opacity: 0.85; opacity: 0.85;
} }
` `
export const Logo = styled.div`
display: flex;
justify-content: center;
align-items: center;
background: #0b0f13;
width: 74px;
height: 74px;
flex: 0 0 74px;
`
export const StyledLogo = styled(TPHLogo)`
height: 50px;
`
export const Title = styled.div`
background: #263440;
display: flex;
flex: 1 0 auto;
align-items: center;
color: ${(props) => transparentize(0.1, props.theme.sidebar.foreground)};
font-size: 20px;
line-height: 24px;
font-weight: 700;
padding-left: 20px;
font-family: ${fontFamily.header};
`
export const Inner = styled.div` export const Inner = styled.div`
padding: 20px 0 30px 20px; padding: 20px 0 30px 20px;
` `
+2 -2
View File
@@ -30,12 +30,12 @@ export const darkTheme: ITheme = {
...baseColors, ...baseColors,
name: "dark", name: "dark",
sidebar: { sidebar: {
background: "#22323f", background: "#19222A",
foreground: "#FFFFFF", foreground: "#FFFFFF",
active: "#00FCFF", active: "#00FCFF",
}, },
main: { main: {
background: "#16212b", background: "#202C36",
foreground: "#FFFFFF", foreground: "#FFFFFF",
link: "#04B0A6", link: "#04B0A6",
}, },