From 850471394ef05b09b025f006612e21ed8b95540c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Sirois Date: Thu, 27 Aug 2020 13:28:59 -0400 Subject: [PATCH] ui: rework sidebar heading --- src/components/ResourcesSidebar/styles.tsx | 4 +-- src/components/Sidebar/index.tsx | 18 ++++++---- src/components/Sidebar/styles.tsx | 41 +++++++++++++++++----- src/design/themes.ts | 4 +-- 4 files changed, 47 insertions(+), 20 deletions(-) diff --git a/src/components/ResourcesSidebar/styles.tsx b/src/components/ResourcesSidebar/styles.tsx index fbf752d..edf6c22 100644 --- a/src/components/ResourcesSidebar/styles.tsx +++ b/src/components/ResourcesSidebar/styles.tsx @@ -113,7 +113,7 @@ export const ExpandIcon = styled(Expand)` export const ExpandResources = styled.div` padding-right: 15px; - margin: 20px 0; + margin-bottom: 20px; ` export const ExpandResourcesHeader = styled.div` @@ -130,13 +130,13 @@ export const ExpandResourcesHeader = styled.div` ` export const StyledResourceList = styled.div` - padding-top: 16px; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; & + & { + padding-top: 16px; margin-top: 16px; border-top: 1px solid ${(props) => transparentize(0.8, props.theme.sidebar.foreground)}; diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 6e41340..9eee85c 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -25,13 +25,17 @@ export const Sidebar: FC>> = ( return ( - - The -
- Programmer's -
- Hangout -
+ + + + + + The Programmer's +
+ Hangout +
+
+ {children} diff --git a/src/components/Sidebar/styles.tsx b/src/components/Sidebar/styles.tsx index a3dc57f..5a7c0e9 100644 --- a/src/components/Sidebar/styles.tsx +++ b/src/components/Sidebar/styles.tsx @@ -2,6 +2,7 @@ import { Link } from "gatsby" import styled, { css } from "styled-components" import { transparentize } from "polished" import { fontFamily } from "../../design/typography" +import TPHLogo from "../../images/tph-logo.svg" export const SidebarWrapper = styled.div` box-sizing: border-box; @@ -29,21 +30,43 @@ export const SidebarWrapper = styled.div` } ` -export const Title = styled(Link)` - display: block; - color: ${(props) => props.theme.sidebar.foreground}; - font-size: 30px; - line-height: 34px; - font-weight: 700; - padding: 20px 0 0 20px; +export const Header = styled(Link)` + display: flex; + align-items: stretch; text-decoration: none; - font-family: ${fontFamily.header}; - &:hover { + &:hover > * { 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` padding: 20px 0 30px 20px; ` diff --git a/src/design/themes.ts b/src/design/themes.ts index 6609925..10ee8f8 100644 --- a/src/design/themes.ts +++ b/src/design/themes.ts @@ -30,12 +30,12 @@ export const darkTheme: ITheme = { ...baseColors, name: "dark", sidebar: { - background: "#22323f", + background: "#19222A", foreground: "#FFFFFF", active: "#00FCFF", }, main: { - background: "#16212b", + background: "#202C36", foreground: "#FFFFFF", link: "#04B0A6", },