Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SORD-158 💄 Enlarging number field, adding size to storybook. #166

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default {
argTypes: {
onValueChange: { action: 'onValueChange' },
decimal: { control: { type: 'radio' }, options: [true, false] },
size: { control: { type: 'radio' }, options: ['m', 's'] },
},

decorators: [
Expand Down Expand Up @@ -43,6 +44,7 @@ const NumberSelectorTester = (args) => {
<NumberSelector
showSoftInputOnFocus={args.showSoftInputOnFocus}
decimal={args.decimal}
size={args.size}
minValue={args.minValue}
maxValue={args.maxValue}
minusIcon={args.minusIcon}
Expand Down
2 changes: 1 addition & 1 deletion src/components/numberField/NumberField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
return;
}
refreshCurrentState();
}, [error, filled, focused]);

Check warning on line 59 in src/components/numberField/NumberField.tsx

View workflow job for this annotation

GitHub Actions / unittests / unittests

React Hook useEffect has missing dependencies: 'forcedState' and 'refreshCurrentState'. Either include them or remove the dependency array

useEffect(() => {
if (firstContentChange) {
Expand All @@ -67,7 +67,7 @@
setFilled(props.value !== firstValue);
if (numberRegex.test(props.value ?? '')) setLastValue(value);
checkContent(props.value);
}, [props.value]);

Check warning on line 70 in src/components/numberField/NumberField.tsx

View workflow job for this annotation

GitHub Actions / unittests / unittests

React Hook useEffect has missing dependencies: 'checkContent', 'firstContentChange', 'firstValue', 'numberRegex', and 'value'. Either include them or remove the dependency array. You can also replace multiple useState variables with useReducer if 'setFilled' needs the current value of 'firstValue'

useEffect(() => {
if (firstContentChange) {
Expand Down Expand Up @@ -129,7 +129,7 @@
borderColor: borderColor,

width:
size === 's' ? (decimal ? 63 : 43) : decimal ? 110 : 72,
size === 's' ? (decimal ? 63 : 48) : decimal ? 110 : 72,

color: textColor,
fontStyle: 'normal',
Expand Down
Loading