refactor: add border radius to constants

main
Josue 4 years ago committed by Tsu-ba-me
parent fa075598b8
commit 65677c0bfb
  1. 5
      striker-ui/components/Bars/AllocationBar.tsx
  2. 11
      striker-ui/components/Bars/ProgressBar.tsx
  3. 10
      striker-ui/components/Decorator.tsx
  4. 3
      striker-ui/components/Header.tsx
  5. 4
      striker-ui/components/Panels/InnerPanel.tsx
  6. 8
      striker-ui/components/Panels/Panel.tsx
  7. 4
      striker-ui/components/Panels/PanelHeader.tsx
  8. 2
      striker-ui/lib/consts/DEFAULT_THEME.ts
  9. 5
      striker-ui/theme/index.ts

@ -5,6 +5,7 @@ import {
RED, RED,
BLUE, BLUE,
PANEL_BACKGROUND, PANEL_BACKGROUND,
BORDER_RADIUS,
} from '../../lib/consts/DEFAULT_THEME'; } from '../../lib/consts/DEFAULT_THEME';
const breakpointWarning = 70; const breakpointWarning = 70;
@ -13,13 +14,13 @@ const breakpointAlert = 90;
const BorderLinearProgress = withStyles({ const BorderLinearProgress = withStyles({
root: { root: {
height: '1em', height: '1em',
borderRadius: '2px', borderRadius: BORDER_RADIUS,
}, },
colorPrimary: { colorPrimary: {
backgroundColor: PANEL_BACKGROUND, backgroundColor: PANEL_BACKGROUND,
}, },
bar: { bar: {
borderRadius: '3px', borderRadius: BORDER_RADIUS,
}, },
})(LinearProgress); })(LinearProgress);

@ -1,19 +1,24 @@
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 { PURPLE, BLUE, PANEL_BACKGROUND } from '../../lib/consts/DEFAULT_THEME'; import {
PURPLE,
BLUE,
PANEL_BACKGROUND,
BORDER_RADIUS,
} from '../../lib/consts/DEFAULT_THEME';
const completed = 100; const completed = 100;
const BorderLinearProgress = withStyles({ const BorderLinearProgress = withStyles({
root: { root: {
height: '1em', height: '1em',
borderRadius: '2px', borderRadius: BORDER_RADIUS,
}, },
colorPrimary: { colorPrimary: {
backgroundColor: PANEL_BACKGROUND, backgroundColor: PANEL_BACKGROUND,
}, },
bar: { bar: {
borderRadius: '3px', borderRadius: BORDER_RADIUS,
}, },
})(LinearProgress); })(LinearProgress);

@ -1,5 +1,11 @@
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { BLUE, GREY, PURPLE, RED } from '../lib/consts/DEFAULT_THEME'; import {
BLUE,
GREY,
PURPLE,
RED,
BORDER_RADIUS,
} from '../lib/consts/DEFAULT_THEME';
export type Colours = 'ok' | 'off' | 'error' | 'warning'; export type Colours = 'ok' | 'off' | 'error' | 'warning';
@ -7,7 +13,7 @@ const useStyles = makeStyles(() => ({
decorator: { decorator: {
width: '1.4em', width: '1.4em',
height: '100%', height: '100%',
borderRadius: 2, borderRadius: BORDER_RADIUS,
}, },
ok: { ok: {
backgroundColor: BLUE, backgroundColor: BLUE,

@ -3,6 +3,7 @@ import AppBar from '@material-ui/core/AppBar';
import { makeStyles, createStyles } from '@material-ui/core/styles'; import { makeStyles, createStyles } from '@material-ui/core/styles';
import { Box, Button } from '@material-ui/core'; import { Box, Button } from '@material-ui/core';
import { ICONS, ICON_SIZE } from '../lib/consts/ICONS'; import { ICONS, ICON_SIZE } from '../lib/consts/ICONS';
import { BORDER_RADIUS } from '../lib/consts/DEFAULT_THEME';
import AnvilDrawer from './AnvilDrawer'; import AnvilDrawer from './AnvilDrawer';
const useStyles = makeStyles((theme) => const useStyles = makeStyles((theme) =>
@ -17,7 +18,7 @@ const useStyles = makeStyles((theme) =>
height: '2.8em', height: '2.8em',
width: '30vw', width: '30vw',
backgroundColor: theme.palette.secondary.main, backgroundColor: theme.palette.secondary.main,
borderRadius: '3px', borderRadius: BORDER_RADIUS,
}, },
barElement: { barElement: {
padding: 0, padding: 0,

@ -1,7 +1,7 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { DIVIDER } from '../../lib/consts/DEFAULT_THEME'; import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME';
type Props = { type Props = {
children: ReactNode; children: ReactNode;
@ -10,7 +10,7 @@ type Props = {
const useStyles = makeStyles(() => ({ const useStyles = makeStyles(() => ({
innerBody: { innerBody: {
borderWidth: '1px', borderWidth: '1px',
borderRadius: '3px', borderRadius: BORDER_RADIUS,
borderStyle: 'solid', borderStyle: 'solid',
borderColor: DIVIDER, borderColor: DIVIDER,
marginTop: '1.4em', marginTop: '1.4em',

@ -1,6 +1,10 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { PANEL_BACKGROUND, TEXT } from '../../lib/consts/DEFAULT_THEME'; import {
BORDER_RADIUS,
PANEL_BACKGROUND,
TEXT,
} from '../../lib/consts/DEFAULT_THEME';
type Props = { type Props = {
children: ReactNode; children: ReactNode;
@ -25,7 +29,7 @@ const useStyles = makeStyles(() => ({
border: '1px', border: '1px',
borderColor: TEXT, borderColor: TEXT,
borderWidth: '1px', borderWidth: '1px',
borderRadius: '3px', borderRadius: BORDER_RADIUS,
borderStyle: 'solid', borderStyle: 'solid',
padding: 0, padding: 0,
margin: 0, margin: 0,

@ -1,7 +1,7 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { DIVIDER } from '../../lib/consts/DEFAULT_THEME'; import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME';
type Props = { type Props = {
children: ReactNode; children: ReactNode;
@ -20,7 +20,7 @@ const useStyles = makeStyles(() => ({
content: '""', content: '""',
borderColor: DIVIDER, borderColor: DIVIDER,
borderWidth: '1px', borderWidth: '1px',
borderRadius: '3px', borderRadius: BORDER_RADIUS,
borderStyle: 'solid', borderStyle: 'solid',
width: '100%', width: '100%',
}, },

@ -12,3 +12,5 @@ export const UNSELECTED = '#666';
export const DIVIDER = '#888'; export const DIVIDER = '#888';
export const SELECTED_ANVIL = '#00ff00'; export const SELECTED_ANVIL = '#00ff00';
export const DISABLED = '#AAA'; export const DISABLED = '#AAA';
export const BORDER_RADIUS = '3px';

@ -5,6 +5,7 @@ import {
PURPLE, PURPLE,
BLUE, BLUE,
DISABLED, DISABLED,
BORDER_RADIUS,
} from '../lib/consts/DEFAULT_THEME'; } from '../lib/consts/DEFAULT_THEME';
const theme: Theme = createMuiTheme({ const theme: Theme = createMuiTheme({
@ -34,7 +35,7 @@ const theme: Theme = createMuiTheme({
padding: 8, padding: 8,
}, },
track: { track: {
borderRadius: 3, borderRadius: BORDER_RADIUS,
border: 3, border: 3,
backgroundColor: PURPLE, backgroundColor: PURPLE,
opacity: 1, opacity: 1,
@ -49,7 +50,7 @@ const theme: Theme = createMuiTheme({
}, },
thumb: { thumb: {
color: TEXT, color: TEXT,
borderRadius: 3, borderRadius: BORDER_RADIUS,
}, },
}, },
}, },

Loading…
Cancel
Save