refactor: use better naming for colours

main
Josue 4 years ago committed by Tsu-ba-me
parent 46e9661152
commit 05786d444b
  1. 8
      striker-ui/components/Bars/AllocationBar.tsx
  2. 8
      striker-ui/components/Bars/ProgressBar.tsx
  3. 6
      striker-ui/components/Decorator.tsx
  4. 5
      striker-ui/lib/consts/DEFAULT_THEME.ts
  5. 4
      striker-ui/theme/index.ts

@ -1,8 +1,8 @@
import { makeStyles, withStyles } from '@material-ui/core/styles'; import { makeStyles, withStyles } from '@material-ui/core/styles';
import { LinearProgress } from '@material-ui/core'; import { LinearProgress } from '@material-ui/core';
import { import {
PURPLE_OFF, PURPLE,
RED_ON, RED,
BLUE, BLUE,
PANEL_BACKGROUND, PANEL_BACKGROUND,
} from '../../lib/consts/DEFAULT_THEME'; } from '../../lib/consts/DEFAULT_THEME';
@ -28,10 +28,10 @@ const useStyles = makeStyles(() => ({
backgroundColor: BLUE, backgroundColor: BLUE,
}, },
barWarning: { barWarning: {
backgroundColor: PURPLE_OFF, backgroundColor: PURPLE,
}, },
barAlert: { barAlert: {
backgroundColor: RED_ON, backgroundColor: RED,
}, },
})); }));

@ -1,10 +1,6 @@
import { makeStyles, withStyles } from '@material-ui/core/styles'; import { makeStyles, withStyles } from '@material-ui/core/styles';
import { LinearProgress } from '@material-ui/core'; import { LinearProgress } from '@material-ui/core';
import { import { PURPLE, BLUE, PANEL_BACKGROUND } from '../../lib/consts/DEFAULT_THEME';
PURPLE_OFF,
BLUE,
PANEL_BACKGROUND,
} from '../../lib/consts/DEFAULT_THEME';
const completed = 100; const completed = 100;
@ -26,7 +22,7 @@ const useStyles = makeStyles(() => ({
backgroundColor: BLUE, backgroundColor: BLUE,
}, },
barInProgress: { barInProgress: {
backgroundColor: PURPLE_OFF, backgroundColor: PURPLE,
}, },
})); }));

@ -1,5 +1,5 @@
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { BLUE, GREY, PURPLE_OFF, RED_ON } from '../lib/consts/DEFAULT_THEME'; import { BLUE, GREY, PURPLE, RED } from '../lib/consts/DEFAULT_THEME';
export type Colours = 'ok' | 'off' | 'error' | 'warning'; export type Colours = 'ok' | 'off' | 'error' | 'warning';
@ -13,10 +13,10 @@ const useStyles = makeStyles(() => ({
backgroundColor: BLUE, backgroundColor: BLUE,
}, },
warning: { warning: {
backgroundColor: PURPLE_OFF, backgroundColor: PURPLE,
}, },
error: { error: {
backgroundColor: RED_ON, backgroundColor: RED,
}, },
off: { off: {
backgroundColor: GREY, backgroundColor: GREY,

@ -1,11 +1,10 @@
// Colour Palette // Colour Palette
export const RED_ON = '#D02724'; export const RED = '#D02724';
export const BORDER_GREY = '#E5E5E5';
export const TEXT = '#F2F2F2'; export const TEXT = '#F2F2F2';
export const PANEL_BACKGROUND = '#343434'; export const PANEL_BACKGROUND = '#343434';
export const PANEL_BORDER = '#000000'; export const PANEL_BORDER = '#000000';
export const PURPLE_OFF = '#7353BA'; export const PURPLE = '#7353BA';
export const BLUE = '#4785FF'; export const BLUE = '#4785FF';
export const GREY = '#E5E5E5'; export const GREY = '#E5E5E5';
export const HOVER = '#444'; export const HOVER = '#444';

@ -2,7 +2,7 @@ import createMuiTheme, { Theme } from '@material-ui/core/styles/createMuiTheme';
import { import {
PANEL_BACKGROUND, PANEL_BACKGROUND,
TEXT, TEXT,
PURPLE_OFF, PURPLE,
BLUE, BLUE,
} from '../lib/consts/DEFAULT_THEME'; } from '../lib/consts/DEFAULT_THEME';
@ -35,7 +35,7 @@ const theme: Theme = createMuiTheme({
track: { track: {
borderRadius: 0, borderRadius: 0,
border: 3, border: 3,
backgroundColor: PURPLE_OFF, backgroundColor: PURPLE,
'$checked$checked + &': { '$checked$checked + &': {
// Controls checked color for the track // Controls checked color for the track
backgroundColor: BLUE, backgroundColor: BLUE,

Loading…
Cancel
Save