From 4fc93005f6e422c8569419b6edf7e82c39cad374 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 26 Dec 2019 22:33:33 +0100 Subject: [PATCH] configurable theme --- web/src/FilesTabsPanel.js | 6 ++++-- web/src/Screen.js | 24 +++++++++++++----------- web/src/theme.js | 16 +++++++++++++--- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/web/src/FilesTabsPanel.js b/web/src/FilesTabsPanel.js index 2ca2f8917..bfc281f15 100644 --- a/web/src/FilesTabsPanel.js +++ b/web/src/FilesTabsPanel.js @@ -1,5 +1,6 @@ import React from "react"; import styled from "styled-components"; +import theme from "./theme"; const files = [ { name: "app.js" }, @@ -15,9 +16,10 @@ const FileTabItem = styled.div` align-items: center; cursor: pointer; &:hover { - color: #338; + color: ${theme.tabsPanel.hoverFont}; } - background-color: ${props => (props.selected ? "#eee" : "inherit")}; + background-color: ${props => + props.selected ? theme.mainArea.background : "inherit"}; `; export default function FilesTabsPanel() { diff --git a/web/src/Screen.js b/web/src/Screen.js index 2b654e5a3..13c7872d4 100644 --- a/web/src/Screen.js +++ b/web/src/Screen.js @@ -6,10 +6,10 @@ import FilesTabsPanel from "./FilesTabsPanel"; const BodyDiv = styled.div` position: fixed; top: ${theme.tabsPanel.height}px; - left: ${theme.widgetMenu.iconSize + theme.widgetMenu.panelWidth}px; + left: ${theme.widgetMenu.iconSize + theme.leftPanel.width}px; bottom: ${theme.statusBar.height}px; right: 0; - background-color: #eee; + background-color: ${theme.mainArea.background}; `; const IconBar = styled.div` @@ -18,26 +18,26 @@ const IconBar = styled.div` left: 0; bottom: ${theme.statusBar.height}px; width: ${theme.widgetMenu.iconSize}px; - background-color: #222; + background-color: ${theme.widgetMenu.background}; `; -const LeftMenu = styled.div` +const LeftPanel = styled.div` position: fixed; top: 0; left: ${theme.widgetMenu.iconSize}px; bottom: ${theme.statusBar.height}px; - width: ${theme.widgetMenu.panelWidth}px; - background-color: #ccc; + width: ${theme.leftPanel.width}px; + background-color: ${theme.leftPanel.background}; `; const TabsPanel = styled.div` display: flex; position: fixed; top: 0; - left: ${theme.widgetMenu.iconSize + theme.widgetMenu.panelWidth}px; + left: ${theme.widgetMenu.iconSize + theme.leftPanel.width}px; height: ${theme.tabsPanel.height}px; right: 0; - background-color: #ddd; + background-color: ${theme.tabsPanel.background}; `; const StausBar = styled.div` @@ -46,15 +46,17 @@ const StausBar = styled.div` left: 0; right: 0; bottom: 0; - background-color: #00c; + background-color: ${theme.statusBar.background}; `; export default function Screen({ children }) { return ( <> - - + + + + {children} diff --git a/web/src/theme.js b/web/src/theme.js index 416621afc..a9e31f07d 100644 --- a/web/src/theme.js +++ b/web/src/theme.js @@ -1,12 +1,22 @@ export default { widgetMenu: { iconSize: 80, - panelWidth: 300 + background: "#222" + }, + leftPanel: { + width: 300, + background: "#ccc" }, tabsPanel: { - height: 30 + height: 30, + background:'#ddd', + hoverFont: '#338' }, statusBar: { - height: 20 + height: 20, + background: "#00c" + }, + mainArea: { + background: "#eee" } };