From fbed04a8257d8927522deee1806a98331c86afe7 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Thu, 9 Apr 2020 10:36:53 -0700 Subject: [PATCH 1/2] Update on icons --- .../clue/__snapshots__/Clue.spec.tsx.snap | 188 +++++++----------- src/view/components/microbit/Microbit.tsx | 2 +- .../__snapshots__/Microbit.spec.tsx.snap | 117 +++-------- .../device/__snapshots__/Device.spec.tsx.snap | 117 +++-------- src/view/svgs/toolbar_svg.tsx | 174 ++++++---------- 5 files changed, 196 insertions(+), 402 deletions(-) diff --git a/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap b/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap index 812c851c8..40de21d57 100644 --- a/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap +++ b/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap @@ -1680,7 +1680,7 @@ Array [ - - - - - - - - + + + + @@ -1802,7 +1770,7 @@ Array [ - + + + + + + + + + + - - @@ -1882,36 +1851,33 @@ Array [ fill-rule="evenodd" id="gesture" > - - + + + + + + + + + + + + + + diff --git a/src/view/components/microbit/Microbit.tsx b/src/view/components/microbit/Microbit.tsx index c1380ec99..b85565e67 100644 --- a/src/view/components/microbit/Microbit.tsx +++ b/src/view/components/microbit/Microbit.tsx @@ -116,7 +116,7 @@ const MICROBIT_TOOLBAR_BUTTONS: Array<{ label: string; image: JSX.Element }> = [ label: MICROBIT_TOOLBAR_ICON_ID.GPIO, }, { - image: TOOLBAR_SVG.GYROSCOPE_SVG, + image: TOOLBAR_SVG.COMPASS_SVG, label: MICROBIT_TOOLBAR_ICON_ID.COMPASS, }, { diff --git a/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap b/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap index 7a5bf878a..8dc222774 100644 --- a/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap +++ b/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap @@ -3005,36 +3005,33 @@ Array [ fill-rule="evenodd" id="gesture" > - - + + + + + + + + + + + + + + @@ -3129,64 +3126,10 @@ Array [ - - - - - - - - diff --git a/src/view/container/device/__snapshots__/Device.spec.tsx.snap b/src/view/container/device/__snapshots__/Device.spec.tsx.snap index 2e9d20d09..bce966d43 100644 --- a/src/view/container/device/__snapshots__/Device.spec.tsx.snap +++ b/src/view/container/device/__snapshots__/Device.spec.tsx.snap @@ -3007,36 +3007,33 @@ exports[`Device component should render correctly 1`] = ` fill-rule="evenodd" id="gesture" > - - + + + + + + + + + + + + + + @@ -3131,64 +3128,10 @@ exports[`Device component should render correctly 1`] = ` - - - - - - - - diff --git a/src/view/svgs/toolbar_svg.tsx b/src/view/svgs/toolbar_svg.tsx index 568f13a17..22c4ee285 100644 --- a/src/view/svgs/toolbar_svg.tsx +++ b/src/view/svgs/toolbar_svg.tsx @@ -516,36 +516,20 @@ export const GESTURE_SVG = ( viewBox="25 35 165 165" > - - + + + + + + + + + + + + + + ); @@ -608,83 +592,31 @@ export const PRESSURE_SVG = ( y="0px" width="16px" height="16px" - viewBox="0 35 181 181" + viewBox="35 35 160 181" > - + - + + + + + + + + + - + - - - - - - - - - - - - + + ); @@ -697,7 +629,7 @@ export const PROXIMITY_SVG = ( y="0px" width="16px" height="16px" - viewBox="0 35 200 181" + viewBox="0 45 200 170" > - + - + + + + + + + + + + + - - ); @@ -810,3 +736,19 @@ export const GYROSCOPE_SVG = ( ); +export const COMPASS_SVG = ( + + + + + +); From ada67ac2e91dc9be669462c954fa84cc3a6eb755 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Thu, 9 Apr 2020 13:13:14 -0700 Subject: [PATCH 2/2] Make max number of digit dynamic --- src/view/components/toolbar/InputSlider.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/view/components/toolbar/InputSlider.tsx b/src/view/components/toolbar/InputSlider.tsx index 2b960c809..1e293ebaa 100644 --- a/src/view/components/toolbar/InputSlider.tsx +++ b/src/view/components/toolbar/InputSlider.tsx @@ -30,7 +30,9 @@ class InputSlider extends React.Component { value={this.props.value} onInput={this.handleOnChange} defaultValue={this.props.minValue.toLocaleString()} - pattern="^-?[0-9]{0,4}$" + pattern={`^-?[0-9]{0,${ + this.props.maxValue.toString().length + }}$`} onKeyUp={this.handleOnChange} aria-label={`${this.props.type} sensor input ${this.props.axisLabel}`} />