From 154a71574d9676f01542f21def55fdfa69c596cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Sun, 25 Oct 2020 22:25:55 +0100 Subject: [PATCH] Moving more css aside components --- webapp/src/components/sidebar.scss | 64 ++++++++++++++++ webapp/src/components/sidebar.tsx | 6 +- webapp/src/components/workspaceComponent.scss | 6 ++ webapp/src/components/workspaceComponent.tsx | 4 +- webapp/static/main.css | 73 ------------------- 5 files changed, 77 insertions(+), 76 deletions(-) create mode 100644 webapp/src/components/sidebar.scss create mode 100644 webapp/src/components/workspaceComponent.scss diff --git a/webapp/src/components/sidebar.scss b/webapp/src/components/sidebar.scss new file mode 100644 index 000000000..55c4b96a1 --- /dev/null +++ b/webapp/src/components/sidebar.scss @@ -0,0 +1,64 @@ +.Sidebar { + flex: 0 0 230px; + + display: flex; + flex-direction: column; + + min-height: 100%; + background-color: rgb(247, 246, 243); + padding: 10px 0; + + &.hidden { + position: absolute; + top: 0; + left: 0; + z-index: 15; + min-height: 0; + height: 50px; + width: 50px; + background: none; + padding: 0; + > div { + padding: 0; + margin: auto; + } + } + + .octo-sidebar-header { + display: flex; + flex-direction: row; + + font-weight: 600; + padding: 3px 20px; + margin-bottom: 5px; + } + + .octo-sidebar-item { + display: flex; + flex-direction: row; + + font-weight: 500; + padding: 3px 20px; + &.subitem { + color: rgba(25, 23, 18, 0.6); + font-weight: 400; + margin-left: 20px; + } + } + + .octo-sidebar-title { + cursor: pointer; + flex-grow: 1; + } + + .octo-sidebar-item { + &:hover { + background-color: rgba(0, 0, 0, 0.05); + } + .octo-button { + &:hover { + background-color: rgba(0, 0, 0, 0.1); + } + } + } +} diff --git a/webapp/src/components/sidebar.tsx b/webapp/src/components/sidebar.tsx index 0f7779c86..1aa84fece 100644 --- a/webapp/src/components/sidebar.tsx +++ b/webapp/src/components/sidebar.tsx @@ -12,6 +12,8 @@ import MenuWrapper from '../widgets/menuWrapper' import {WorkspaceTree} from '../viewModel/workspaceTree' import {BoardView} from '../blocks/boardView' +import './sidebar.scss' + type Props = { showBoard: (id: string) => void showView: (id: string, boardId?: string) => void @@ -45,7 +47,7 @@ class Sidebar extends React.Component { if (this.state.isHidden) { const hamburgerRef = React.createRef() return ( -
+
{ } return ( -
+
{'OCTO'}
diff --git a/webapp/src/components/workspaceComponent.scss b/webapp/src/components/workspaceComponent.scss new file mode 100644 index 000000000..8a1ed13c8 --- /dev/null +++ b/webapp/src/components/workspaceComponent.scss @@ -0,0 +1,6 @@ +.WorkspaceComponent { + flex: 1 1 auto; + display: flex; + flex-direction: row; + overflow: auto; +} diff --git a/webapp/src/components/workspaceComponent.tsx b/webapp/src/components/workspaceComponent.tsx index 94c2c25c6..3d2de367c 100644 --- a/webapp/src/components/workspaceComponent.tsx +++ b/webapp/src/components/workspaceComponent.tsx @@ -10,6 +10,8 @@ import BoardComponent from './boardComponent' import {Sidebar} from './sidebar' import {TableComponent} from './tableComponent' +import './workspaceComponent.scss' + type Props = { workspaceTree: WorkspaceTree boardTree?: BoardTree @@ -25,7 +27,7 @@ class WorkspaceComponent extends React.Component { Utils.assert(workspaceTree) const element = - (
+ (
div { - padding: 0; - margin: auto; -} - -.octo-sidebar-header { - display: flex; - flex-direction: row; - - font-weight: 600; - padding: 3px 20px; - margin-bottom: 5px; -} - -.octo-sidebar-item { - display: flex; - flex-direction: row; - - font-weight: 500; - padding: 3px 20px; -} - -.octo-sidebar-item.subitem { - color: rgba(25, 23, 18, 0.6); - font-weight: 400; - margin-left: 20px; -} - -.octo-sidebar-title { - cursor: pointer; - flex-grow: 1; -} - -.octo-sidebar-item:hover { - background-color: rgba(0, 0, 0, 0.05); -} - -.octo-sidebar-item .octo-button:hover { - background-color: rgba(0, 0, 0, 0.1); -} - /* Main app */ .octo-app {