Skip to content

Commit 33e8a05

Browse files
committed
refactor: Rename actions
1 parent 9747b09 commit 33e8a05

14 files changed

Lines changed: 42 additions & 26 deletions

app/components/chart-preview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ const ChartPreviewInner = ({
516516
configuring
517517
? () =>
518518
dispatch({
519-
type: "CHART_ACTIVE_FIELD_CHANGED",
519+
type: "CHART_ACTIVE_FIELD_CHANGE",
520520
value: "title",
521521
})
522522
: undefined
@@ -548,7 +548,7 @@ const ChartPreviewInner = ({
548548
configuring
549549
? () => {
550550
dispatch({
551-
type: "CHART_ACTIVE_FIELD_CHANGED",
551+
type: "CHART_ACTIVE_FIELD_CHANGE",
552552
value: "description",
553553
});
554554
}

app/components/chart-selection-tabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ const TabsEditable = (props: TabsEditableProps) => {
279279
onClick={() => {
280280
switchChart(tabsState.activeChartKey);
281281
dispatch({
282-
type: "CHART_ACTIVE_FIELD_CHANGED",
282+
type: "CHART_ACTIVE_FIELD_CHANGE",
283283
value: "label",
284284
});
285285
handleClose();
@@ -646,7 +646,7 @@ const TabContent = (props: {
646646

647647
if (editable) {
648648
dispatch({
649-
type: "CHART_ACTIVE_FIELD_CHANGED",
649+
type: "CHART_ACTIVE_FIELD_CHANGE",
650650
value: undefined,
651651
});
652652
}

app/components/dashboard-shared.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const BlockMoreButton = ({ blockKey }: { blockKey: string }) => {
3939
},
4040
});
4141
dispatch({
42-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
42+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
4343
value: key,
4444
});
4545
});
@@ -54,7 +54,7 @@ export const BlockMoreButton = ({ blockKey }: { blockKey: string }) => {
5454

5555
if (layout.activeField === blockKey) {
5656
dispatch({
57-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
57+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
5858
value: undefined,
5959
});
6060
}

app/components/text-block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const TextBlock = forwardRef<
5959
}
6060

6161
dispatch({
62-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
62+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
6363
value: block.key,
6464
});
6565
});

app/configurator/components/annotator-options.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const AnnotatorOptions = ({
6161
dispatch({
6262
type:
6363
type === "chart"
64-
? "CHART_ACTIVE_FIELD_CHANGED"
65-
: "LAYOUT_ACTIVE_FIELD_CHANGED",
64+
? "CHART_ACTIVE_FIELD_CHANGE"
65+
: "LAYOUT_ACTIVE_FIELD_CHANGE",
6666
value: undefined,
6767
});
6868
});

app/configurator/components/block-options-selector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const LayoutBlocksSelector = () => {
3434

3535
const handleClosePanel = useEvent(() => {
3636
dispatch({
37-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
37+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
3838
value: undefined,
3939
});
4040
});

app/configurator/components/chart-annotations/add-annotation-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const AddAnnotationButton = () => {
4040
value: annotation,
4141
});
4242
dispatch({
43-
type: "CHART_ACTIVE_FIELD_CHANGED",
43+
type: "CHART_ACTIVE_FIELD_CHANGE",
4444
value: annotation.key,
4545
});
4646
});

app/configurator/components/chart-annotations/chart-annotations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const ChartAnnotationTab = ({ annotation }: { annotation: Annotation }) => {
5757

5858
const handleClick = useEvent(() => {
5959
dispatch({
60-
type: "CHART_ACTIVE_FIELD_CHANGED",
60+
type: "CHART_ACTIVE_FIELD_CHANGE",
6161
value: annotation.key,
6262
});
6363
});

app/configurator/components/chart-controls/section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,14 @@ export const SectionTitle = ({
241241

242242
if (isConfiguring(state)) {
243243
return dispatch({
244-
type: "CHART_ACTIVE_FIELD_CHANGED",
244+
type: "CHART_ACTIVE_FIELD_CHANGE",
245245
value: undefined,
246246
});
247247
}
248248

249249
if (isLayouting(state)) {
250250
return dispatch({
251-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
251+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
252252
value: undefined,
253253
});
254254
}

app/configurator/components/configurator.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,10 @@ const ConfigureChartStep = () => {
398398
const chartConfig = getChartConfig(state);
399399
const router = useRouter();
400400
const handleClosePanel = useEvent(() => {
401-
dispatch({ type: "CHART_ACTIVE_FIELD_CHANGED", value: undefined });
401+
dispatch({
402+
type: "CHART_ACTIVE_FIELD_CHANGE",
403+
value: undefined,
404+
});
402405
});
403406
const handlePrevious = useEvent(() => {
404407
if (!configuring) {
@@ -502,12 +505,16 @@ const LayoutingStep = () => {
502505
const locale = useLocale();
503506
const [state, dispatch] = useConfiguratorState(isLayouting);
504507
const handleClosePanel = useEvent(() => {
505-
dispatch({ type: "LAYOUT_ACTIVE_FIELD_CHANGED", value: undefined });
508+
dispatch({
509+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
510+
value: undefined,
511+
});
506512
});
507513
const handlePrevious = useEvent(() => {
508514
if (state.state !== "LAYOUTING") {
509515
return;
510516
}
517+
511518
dispatch({ type: "STEP_PREVIOUS" });
512519
});
513520

@@ -710,7 +717,7 @@ const LayoutingStep = () => {
710717
onClick={() => {
711718
if (state.layout.activeField !== "title") {
712719
dispatch({
713-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
720+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
714721
value: "title",
715722
});
716723
}
@@ -721,7 +728,7 @@ const LayoutingStep = () => {
721728
onClick={() => {
722729
if (state.layout.activeField !== "description") {
723730
dispatch({
724-
type: "LAYOUT_ACTIVE_FIELD_CHANGED",
731+
type: "LAYOUT_ACTIVE_FIELD_CHANGE",
725732
value: "description",
726733
});
727734
}

0 commit comments

Comments
 (0)