From 55f7d9618bccaa7c5d3d5e428828a885474cad93 Mon Sep 17 00:00:00 2001 From: benstov Date: Mon, 6 May 2019 18:58:21 +0200 Subject: [PATCH] improvement: font sizes and header --- .../{RefreshButton.tsx => ActionIcon.tsx} | 12 +- dashboard/src/components/info-pane.tsx | 116 +++++++++++------- dashboard/src/components/logs.tsx | 8 +- dashboard/src/containers/graph.tsx | 4 +- dashboard/src/styles/variables.ts | 1 + 5 files changed, 84 insertions(+), 57 deletions(-) rename dashboard/src/components/{RefreshButton.tsx => ActionIcon.tsx} (76%) diff --git a/dashboard/src/components/RefreshButton.tsx b/dashboard/src/components/ActionIcon.tsx similarity index 76% rename from dashboard/src/components/RefreshButton.tsx rename to dashboard/src/components/ActionIcon.tsx index a57d8ee94d..384e57bc0a 100644 --- a/dashboard/src/components/RefreshButton.tsx +++ b/dashboard/src/components/ActionIcon.tsx @@ -13,12 +13,13 @@ import { colors } from "../styles/variables" interface Props { onClick: () => void - loading: boolean + inProgress?: boolean + iconClassName: "redo-alt" | "window-close" } const Button = styled.div` - padding: 0.3em; border-radius: 10%; + margin: .5rem; cursor: pointer; :active { opacity: 0.5; @@ -27,7 +28,6 @@ const Button = styled.div` const Icon = styled.i` color: ${colors.gardenGray}; - font-size: 1.25rem; :hover { color: ${colors.gardenPink} } @@ -48,12 +48,12 @@ const IconLoading = styled(Icon)` } ` -export const RefreshButton: React.FC = ({ loading, onClick }) => { - const IconComp = loading ? IconLoading : Icon +export const ActionIcon: React.FC = ({ inProgress, onClick, iconClassName }) => { + const IconComp = inProgress ? IconLoading : Icon return ( ) } diff --git a/dashboard/src/components/info-pane.tsx b/dashboard/src/components/info-pane.tsx index f7588748ce..dfae59a9a2 100644 --- a/dashboard/src/components/info-pane.tsx +++ b/dashboard/src/components/info-pane.tsx @@ -14,13 +14,13 @@ import styled from "@emotion/styled" import Card from "../components/card" import { colors } from "../styles/variables" import { RenderedNode } from "garden-cli/src/config-graph" -import { RefreshButton } from "./RefreshButton" import { ErrorNotification } from "./notifications" +import { ActionIcon } from "./ActionIcon" const Term = styled.div` background-color: ${colors.gardenBlack}; color: white; - border-radius: 2px; + border-radius: 0.125rem; max-height: 45rem; overflow-y: auto; padding: 1rem; @@ -34,12 +34,6 @@ const ClosePaneContainer = styled.div` display: flex; margin-left: auto; ` -const ClosePane = styled.div` - cursor: pointer; - background-size: contain; - width: 2rem; - height: 2rem; -` const IconContainer = styled.span` display: inline-block; @@ -50,6 +44,50 @@ const IconContainer = styled.span` background-repeat: no-repeat; vertical-align: top; ` + +const Key = ({ text }) => ( +
+ {text} +
+) + +const Value = ({ children }) => ( +
+ {children} +
+) +const Field = ({ children }) => ( +
+ {children} +
+) + +const Header = styled.div` + font-weight: 500; + font-size: 1.125rem; + line-height: 1.6875rem; + + color: ${colors.black}; +` + interface Props { node: RenderedNode clearGraphNodeSelection: () => void @@ -61,17 +99,6 @@ interface Props { duration?: string | null } -const Key = ({ text }) => ( -
- {text} -
-) - // TODO: Split up into something InfoPane and InfoPaneWithResults. Props are kind of messy. export const InfoPane: React.FC = ({ clearGraphNodeSelection, @@ -109,67 +136,62 @@ export const InfoPane: React.FC = ({ padding-left: .5rem; `} > -

{name} -

+ {onRefresh && ( -
- -
+ )} - +
-
+ -
+ {capitalize(type)} -
-
+ + -
+ -
{moduleName}
-
+ {moduleName} + {duration && ( -
+ -
{duration}
-
+ {duration} + )} {startedAt && ( -
+ -
{startedAt}
-
+ {startedAt} + )} {completedAt && ( -
+ -
{completedAt}
-
+ {completedAt} + )} - {(type === "test" || type === "run") && ( -
+ {(type === "test" || type === "run") && outputEl !== null && ( +
{outputEl}
-
+ )} diff --git a/dashboard/src/components/logs.tsx b/dashboard/src/components/logs.tsx index cbd4095c80..a59e4babf8 100644 --- a/dashboard/src/components/logs.tsx +++ b/dashboard/src/components/logs.tsx @@ -21,7 +21,7 @@ import { getServiceNames } from "../util/helpers" import { ServiceLogEntry } from "garden-cli/src/types/plugin/outputs" import { ConfigDump } from "garden-cli/src/garden" -import { RefreshButton } from "./RefreshButton" +import { ActionIcon } from "./ActionIcon" interface Props { config: ConfigDump @@ -119,7 +119,11 @@ class Logs extends Component {
{title} - +
{ const node = graph.data.nodes.find(n => n.key === selectedGraphNode) if (node) { moreInfoPane = ( -
+
) @@ -53,7 +53,7 @@ export default () => { return (
-
+