Skip to content

Commit a0123ca

Browse files
Merge pull request #1748 from FoxComm/refactor/core-swatch-input
Refactor: core SwatchInput
2 parents f9cd892 + 6449dc7 commit a0123ca

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

ashes/src/components/core/swatch-input/swatch-input.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
color: #BFBFBF;
1111
}
1212

13-
& :global(input[type=text].fc-text-input) {
13+
& .input {
1414
width: 130px;
15+
height: 40px;
1516
padding-left: 30px;
16-
}
17-
18-
& input {
1917
text-transform: uppercase;
2018
}
2119
}

ashes/src/components/core/swatch-input/swatch-input.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import React, { Component, Element } from 'react';
77
import { autobind } from 'core-decorators';
88

9+
// components
10+
import TextInput from 'components/forms/text-input';
11+
912
// styles
1013
import s from './swatch-input.css';
1114

@@ -37,8 +40,8 @@ class SwatchInput extends Component {
3740
};
3841

3942
@autobind
40-
handleChange({ target }: EventTarget) {
41-
this.props.onChange(target.value);
43+
handleChange(value: string) {
44+
this.props.onChange(value);
4245
}
4346

4447
render() {
@@ -49,11 +52,11 @@ class SwatchInput extends Component {
4952

5053
return (
5154
<div className={s.swatchInput}>
52-
<input
55+
<TextInput
5356
id="swatch-fld"
5457
type="text"
5558
maxLength="6"
56-
className="fc-text-input"
59+
className={s.input}
5760
onChange={this.handleChange}
5861
value={hexCode}
5962
/>

0 commit comments

Comments
 (0)