From 7df50fd44ae8349079c1e40b488494abc8386984 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 27 Apr 2020 23:18:34 +0100 Subject: [PATCH] remove styles --- src/App.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/App.js b/src/App.js index 5727ce0..5d4a2f6 100644 --- a/src/App.js +++ b/src/App.js @@ -18,13 +18,7 @@ class Shade extends React.Component { } S.Shade = styled(Shade)` -width: 100%; -height: 100%; background-color: ${props => props.color}; -display: flex; -flex-direction: row; -justify-content: center; -align-items: center; span { font-weight: bold; @@ -38,7 +32,8 @@ span { `; S.ShadeBase = styled(S.Shade)` -border: 3px solid rgba(0, 0, 0, 0.5); +border-top: 3px solid rgba(0, 0, 0, 0.5); +border-bottom: 3px solid rgba(0, 0, 0, 0.5); `; function IncDecButton(props) { @@ -179,10 +174,10 @@ Color.defaultProps = { darkenAmount: 3, scaleShadeStart: 0.2, scaleShadeEnd: 0.8, - scaleShadeStepCount: 5, + scaleShadeStepCount: 4, scaleTintStart: 0.2, scaleTintEnd: 0.8, - scaleTintStepCount: 5, + scaleTintStepCount: 4, } S.Color = styled(Color)` @@ -215,17 +210,21 @@ class Palette extends React.Component { constructor(props) { super(props); this.state = { - palette: palette[0], + palette: [], } - this.randomizePalette = this.randomizePalette.bind(this); + this.randomFivePalette = this.randomFivePalette.bind(this); } - randomizePalette() { + randomFivePalette() { const newPalette = palette[Math.floor(Math.random() * palette.length)]; this.setState({palette: newPalette}); } + componentDidMount() { + this.randomFivePalette(); + } + render() { const colors = this.state.palette.map(color =>
  • @@ -237,7 +236,7 @@ class Palette extends React.Component { ); return (
    - +
      {colors}