Skip to content

Commit

Permalink
Fix display of color/colors galleries
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Apr 21, 2024
1 parent 380355b commit a5c66e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 4.1.0 (???)

- #35 - @tomkennedy22 rewrote the editor UI and added a ton of functionality.
- #35 - @tomkennedy22 rewrote the editor UI and added a ton of functionality. The main new features are a gallery of faces showing previews of all features you can select, and the ability to export a face in SVG or PNG format.

# 4.0.0 (2023-11-19)

Expand Down
6 changes: 5 additions & 1 deletion public/editor/overrideList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export const getOverrideListForItem = (
});
}
}
} else if (gallerySectionConfig.selectionType === "range") {
} else if (
gallerySectionConfig.selectionType === "range" ||
gallerySectionConfig.selectionType === "color" ||
gallerySectionConfig.selectionType === "colors"
) {
for (
let i = 0;
i < gallerySectionConfig.renderOptions.valuesToRender.length;
Expand Down
6 changes: 5 additions & 1 deletion public/editor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ type GallerySectionConfigRange = GallerySectionConfigBase & {
type GallerySectionConfigColor = GallerySectionConfigBase & {
selectionType: "color";
selectedValue: string;
renderOptions: {
valuesToRender: string[];
};
};

type GallerySectionConfigColors = GallerySectionConfigBase & {
selectionType: "colors";
selectedValue: string[];
renderOptions: {
colorCount: number;
valuesToRender: string[][];
};
};

Expand All @@ -79,5 +83,5 @@ export type CombinedState = FaceState & GalleryState;

export type OverrideListItem = {
override: Overrides;
value: string | number | boolean;
value: string | number | string[];
};

0 comments on commit a5c66e5

Please sign in to comment.