Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-30 Header #76

Merged
merged 6 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import React from "react";
import SchedulePage from "./components/schedule-page/schedule-page.component";
import WorkersPage from "./components/workers-page/workers-page.component";
import { CustomGlobalHotKeys } from "./components/common-components/tools/globalhotkeys.component";
import Header from "./components/common-components/header/header";

function App(): JSX.Element {
return (
<React.Fragment>
<CustomGlobalHotKeys />
<Header />
<Switch>
<Route path="/" component={SchedulePage} exact />
<Route path="/workers" component={WorkersPage} />
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/styles-all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
@import "styles/custom/tables";
@import "styles/custom/toolbar";
@import "styles/custom/add-worker-modal";
@import "styles/custom/header";
@import "styles/custom/month-switch";
18 changes: 18 additions & 0 deletions src/assets/styles/styles/custom/_header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#header {
display: flex;
flex-direction: row;
width: 100%;
height: 52px;
background-color: $primary-header-color;
padding: 0 20px 0 20px;
align-items: center;
justify-content: left;

#AssignmentIndIcon {
color: $header-text-color;
}

.filler {
flex-grow: 1;
}
}
2 changes: 1 addition & 1 deletion src/assets/styles/styles/custom/_month-switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
font-size: 16px;
letter-spacing: 1px;
* {
color: $primary-text-color;
color: $header-text-color;
}
span {
margin: 5px;
Expand Down
4 changes: 4 additions & 0 deletions src/assets/styles/styles/custom/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ $enable-transitions: true !default;
$enable-grid-classes: true !default;
$enable-print-styles: true !default;

// Header
$primary-header-color: #1d3557 !default;
$header-text-color: #ffffff !default;

// Color system

$primary: #1d3557 !default;
Expand Down
15 changes: 15 additions & 0 deletions src/components/common-components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { MonthSwitchComponent } from "../month-switch/month-switch.component";
import AssignmentIndIcon from "@material-ui/icons/AssignmentInd";

export default function Header(): JSX.Element {
return (
<>
<div id={"header"}>
<AssignmentIndIcon id={"AssignmentIndIcon"} />
<MonthSwitchComponent />
<div className={"filler"} />
</div>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { StringHelper } from "../../../helpers/string.helper";
interface MonthSwitchOpions {
key?: string;
}
export function MonthSwitchComponent(options: MonthSwitchOpions) {
export function MonthSwitchComponent(options: MonthSwitchOpions): JSX.Element {
const arrowSize = "small";
/* eslint-disable @typescript-eslint/camelcase */
const { month_number, year } = useSelector(
Expand Down