ISSUE-001 - Have tool page constructed with grid and added some basic scrolling rules for minimum UI size requirements.
This commit is contained in:
1 parent
c3b268da61
commit
4d35b57a77
7 files changed
+67
-51
No files matched your search
@@ -1,58 +1,43 @@
|
|||||||
import { Stack } from "@bedrock-layout/stack";
|
|
||||||
import { Column, Columns } from "@bedrock-layout/columns";
|
|
||||||
|
|
||||||
import { MockupBlock } from "../../Common/MockupBlock.styled";
|
import { MockupBlock } from "../../Common/MockupBlock.styled";
|
||||||
import { ExpandedStack, ExpandedBlock } from "./styles";
|
import { LayoutGrid, LayoutGridItem } from "./styles";
|
||||||
|
|
||||||
type LayoutProps = {
|
type LayoutProps = {
|
||||||
headerHeight?: number,
|
headerHeight?: number,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Layout({ headerHeight }: LayoutProps) {
|
export function Layout({ headerHeight }: LayoutProps) {
|
||||||
const headerOffset = headerHeight ? headerHeight + 5 : 0;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gutter="none">
|
<LayoutGrid headerOffset={headerHeight} columns={6} rows={10}>
|
||||||
<Columns gutter="none" columns={7} dense>
|
<LayoutGridItem column={1} row={1} rowSpan={6}>
|
||||||
<MockupBlock
|
<MockupBlock
|
||||||
color="#f7aeae"
|
color="#f7aeae"
|
||||||
minWidth="200px"
|
minWidth="200px"
|
||||||
minHeight={`calc(65vh - ${headerOffset}px)`}
|
|
||||||
>Timing Board UI</MockupBlock>
|
>Timing Board UI</MockupBlock>
|
||||||
<Column span={6}>
|
</LayoutGridItem>
|
||||||
|
|
||||||
|
<LayoutGridItem column={2} row={1} columnSpan={5} rowSpan={6} >
|
||||||
<MockupBlock
|
<MockupBlock
|
||||||
color="#c5c5c5"
|
color="#c5c5c5"
|
||||||
minHeight="100%"
|
|
||||||
>Video Feed</MockupBlock>
|
>Video Feed</MockupBlock>
|
||||||
</Column>
|
</LayoutGridItem>
|
||||||
</Columns>
|
|
||||||
<Columns gutter="none" columns={7} dense>
|
<LayoutGridItem column={1} row={7} rowSpan={3}>
|
||||||
<Column span={1}>
|
|
||||||
<ExpandedStack>
|
|
||||||
<ExpandedBlock>
|
|
||||||
<MockupBlock
|
<MockupBlock
|
||||||
color="#5576e2"
|
color="#5576e2"
|
||||||
minWidth="200px"
|
|
||||||
minHeight="200px"
|
|
||||||
height="20vh"
|
|
||||||
>Race Status UI</MockupBlock>
|
>Race Status UI</MockupBlock>
|
||||||
</ExpandedBlock>
|
</LayoutGridItem>
|
||||||
<ExpandedBlock>
|
|
||||||
|
<LayoutGridItem column={1} row={10}>
|
||||||
<MockupBlock
|
<MockupBlock
|
||||||
color="#bc62ce"
|
color="#bc62ce"
|
||||||
minHeight="40px"
|
|
||||||
height="15vh"
|
|
||||||
>Race Director UI</MockupBlock>
|
>Race Director UI</MockupBlock>
|
||||||
</ExpandedBlock>
|
</LayoutGridItem>
|
||||||
</ExpandedStack>
|
|
||||||
</Column>
|
<LayoutGridItem column={2} row={7} columnSpan={5} rowSpan={4}>
|
||||||
<Column span={6}>
|
|
||||||
<MockupBlock
|
<MockupBlock
|
||||||
color="#4d828b"
|
color="#4d828b"
|
||||||
minHeight="35vh"
|
|
||||||
>Broadcast Director UI</MockupBlock>
|
>Broadcast Director UI</MockupBlock>
|
||||||
</Column>
|
</LayoutGridItem>
|
||||||
</Columns>
|
</LayoutGrid>
|
||||||
</Stack>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,29 @@
|
|||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
export const ExpandedStack = styled.div`
|
type LayoutGridProps = {
|
||||||
display: flex;
|
columns?: number,
|
||||||
flex-flow: column;
|
rows?: number,
|
||||||
/* height: 100%; */
|
headerOffset?: number,
|
||||||
|
};
|
||||||
|
export const LayoutGrid = styled.div<LayoutGridProps>`
|
||||||
|
--columns: ${({ columns = 1 }) => columns};
|
||||||
|
--rows: ${({ rows = 1 }) => rows};
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(var(--columns), 1fr);
|
||||||
|
grid-template-rows: repeat(var(--rows), 1fr);
|
||||||
|
height: calc(100% - ${({ headerOffset = 0 }) => headerOffset}px);
|
||||||
|
width: 100%;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const ExpandedBlock = styled.div`
|
type LayoutGridItemProps = {
|
||||||
/* flex: 1 1 auto; */
|
column: number,
|
||||||
flex-grow: 1;
|
columnSpan?: number,
|
||||||
/* flex-shrink: 1;
|
row: number,
|
||||||
flex-basis: auto; */
|
rowSpan?: number,
|
||||||
|
};
|
||||||
|
export const LayoutGridItem = styled.div<LayoutGridItemProps>`
|
||||||
|
grid-column: ${({ column }) => column}
|
||||||
|
/ span ${({ columnSpan = 1 }) => columnSpan};
|
||||||
|
grid-row: ${({ row }) => row}
|
||||||
|
/ span ${({ rowSpan = 1 }) => rowSpan};;
|
||||||
`;
|
`;
|
||||||
@@ -9,11 +9,10 @@ type MockupBlockProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const MockupBlock = styled.div<MockupBlockProps>`
|
export const MockupBlock = styled.div<MockupBlockProps>`
|
||||||
display: flex;
|
|
||||||
min-height: ${({ minHeight }) => minHeight ?? "0"};
|
min-height: ${({ minHeight }) => minHeight ?? "0"};
|
||||||
min-width: ${({ minWidth }) => minWidth ?? "0"};
|
min-width: ${({ minWidth }) => minWidth ?? "0"};
|
||||||
height: ${({ height }) => height ?? "100%"};
|
height: ${({ height }) => height ?? "100%"};
|
||||||
width: ${({ width }) => width ?? "100%"};
|
width: ${({ width }) => width ?? "100%"};
|
||||||
background-color: ${({ color }) => color};
|
background-color: ${({ color }) => color};
|
||||||
flex: 1 1 auto;
|
padding: 0.3em;
|
||||||
`;
|
`;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Container } from "./styles";
|
import { HeaderBar } from "./styles";
|
||||||
|
|
||||||
type RouteHeaderProps = {
|
type RouteHeaderProps = {
|
||||||
title: string,
|
title: string,
|
||||||
@@ -7,9 +7,9 @@ type RouteHeaderProps = {
|
|||||||
|
|
||||||
export const RouteHeader = React.forwardRef<HTMLHeadElement, RouteHeaderProps>(
|
export const RouteHeader = React.forwardRef<HTMLHeadElement, RouteHeaderProps>(
|
||||||
(props, ref) => (
|
(props, ref) => (
|
||||||
<Container ref={ref}>
|
<HeaderBar ref={ref}>
|
||||||
{props.title}
|
{props.title}
|
||||||
</Container>
|
</HeaderBar>
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
RouteHeader.displayName = "RouteHeader"; // Required due to forwardRef().
|
RouteHeader.displayName = "RouteHeader"; // Required due to forwardRef().
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
export const Container = styled.header`
|
export const HeaderBar = styled.header`
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
padding: 0;
|
padding: 0 0.3em;
|
||||||
background-color: ${p => p.theme.colors.grey};
|
background-color: ${p => p.theme.colors.grey};
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
font-family: ${p => p.theme.fonts.accent};
|
||||||
|
font-size: 0.8em;
|
||||||
`;
|
`;
|
||||||
@@ -14,7 +14,7 @@ export default function Broadcast() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FullScreenContainer>
|
<FullScreenContainer minHeight={728} minWidth={1200}>
|
||||||
<RouteHeader ref={ref} title="Broadcast Page" />
|
<RouteHeader ref={ref} title="Broadcast Page" />
|
||||||
<Layout headerHeight={height} />
|
<Layout headerHeight={height} />
|
||||||
</FullScreenContainer>
|
</FullScreenContainer>
|
||||||
|
|||||||
+17
-2
@@ -1,7 +1,22 @@
|
|||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
export const FullScreenContainer = styled.div`
|
type FullScreenContainerProps = {
|
||||||
overflow: hidden;
|
minHeight?: number,
|
||||||
|
minWidth?: number,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const FullScreenContainer = styled.div < FullScreenContainerProps>`
|
||||||
|
--minHeight: ${({ minHeight = 0 }) => `${minHeight}px`};
|
||||||
|
--minWidth: ${({ minWidth = 0 }) => `${minWidth}px`};
|
||||||
|
--overflowY: ${({ minHeight }) => minHeight ? "scroll" : "hidden" };
|
||||||
|
--overflowX: ${({ minWidth }) => minWidth ? "scroll" : "hidden" };
|
||||||
|
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
/* Demand a minimum width/height and scroll to support them. */
|
||||||
|
min-height: var(--minHeight);
|
||||||
|
min-width: var(--minWidth);
|
||||||
|
overflow-y: var(--overflowY);
|
||||||
|
overflow-x: var(--overflowX);
|
||||||
`;
|
`;
|
||||||
Reference in new issue
Block a user