Skip to content

Commit

Permalink
[core] Fix event naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jul 29, 2024
1 parent 957ba0f commit 69a550a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions apps/pigment-css-next-app/src/app/stack/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ export default function InteractiveStack() {
const [direction, setDirection] = React.useState<StackProps['direction']>('column');
const [spacing, setSpacing] = React.useState<string | number>(2);

const handleChange = React.useCallback((ev: React.ChangeEvent<HTMLInputElement>) => {
switch (ev.target.name) {
const handleChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
switch (event.target.name) {
case 'direction': {
setDirection(ev.target.value as StackProps['direction']);
setDirection(event.target.value as StackProps['direction']);
break;
}
case 'spacing': {
setSpacing(
ev.target.value.match(/^[0-9]+\.?[0-9]*$/)
? parseFloat(ev.target.value)
: ev.target.value,
event.target.value.match(/^[0-9]+\.?[0-9]*$/)
? parseFloat(event.target.value)
: event.target.value,
);
break;
}
Expand Down
12 changes: 6 additions & 6 deletions apps/pigment-css-vite-app/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ export default function InteractiveStack() {
const [direction, setDirection] = React.useState<StackProps['direction']>('column');
const [spacing, setSpacing] = React.useState<string | number>(2);

const handleChange = React.useCallback((ev: React.ChangeEvent<HTMLInputElement>) => {
switch (ev.target.name) {
const handleChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
switch (event.target.name) {
case 'direction': {
setDirection(ev.target.value as StackProps['direction']);
setDirection(event.target.value as StackProps['direction']);
break;
}
case 'spacing': {
setSpacing(
ev.target.value.match(/^[0-9]+\.?[0-9]*$/)
? parseFloat(ev.target.value)
: ev.target.value,
event.target.value.match(/^[0-9]+\.?[0-9]*$/)
? parseFloat(event.target.value)
: event.target.value,
);
break;
}
Expand Down

0 comments on commit 69a550a

Please sign in to comment.