Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MounirDhahri committed Oct 12, 2023
1 parent 9c67567 commit 2d4cce0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/Components/ArtworkFilter/Filters/ColorsOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const COLORS_INDEXED_BY_VALUE = COLORS.reduce(
{}
)

export const COLORS_OPTIONS: FilterData[] = COLORS.map((color) => {
export const COLOR_OPTIONS: FilterData[] = COLORS.map((color) => {
return {
// names returned by Metaphysics are actually the slugs
displayText: color.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OwnerType } from "@artsy/cohesion"
import { fireEvent, waitFor } from "@testing-library/react-native"
import {
COLORS_INDEXED_BY_VALUE,
COLORS_OPTIONS,
COLOR_OPTIONS,
} from "app/Components/ArtworkFilter/Filters/ColorsOptions"
import { SavedSearchFilterColour } from "app/Scenes/SavedSearchAlert/Components/SavedSearchFilterColour"
import {
Expand All @@ -20,7 +20,7 @@ describe("SavedSearchFilterColour", () => {
</SavedSearchStoreProvider>
)

COLORS_OPTIONS.forEach((option) => {
COLOR_OPTIONS.forEach((option) => {
expect(() =>
getByTestId(`check-icon-${COLORS_INDEXED_BY_VALUE[option.paramValue as string].name}`)
).toThrow()
Expand All @@ -34,7 +34,7 @@ describe("SavedSearchFilterColour", () => {
</SavedSearchStoreProvider>
)

COLORS_OPTIONS.forEach((option) => {
COLOR_OPTIONS.forEach((option) => {
if (option.paramValue !== "red") {
expect(() =>
getByTestId(`check-icon-${COLORS_INDEXED_BY_VALUE[option.paramValue as string].name}`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Flex, Spacer, Text, useScreenDimensions, useSpace } from "@artsy/palette-mobile"
import {
COLORS_INDEXED_BY_VALUE,
COLORS_OPTIONS,
COLOR_OPTIONS,
SWATCHES_PER_ROW,
} from "app/Components/ArtworkFilter/Filters/ColorsOptions"
import { ColorsSwatch } from "app/Components/ArtworkFilter/Filters/ColorsSwatch"
Expand Down Expand Up @@ -47,9 +47,11 @@ export const SavedSearchFilterColour = () => {
<Text px={2} variant="sm" fontWeight={500}>
Colour
</Text>

<Spacer y={1} />

<Flex flexDirection="row" flexWrap="wrap" px={1}>
{COLORS_OPTIONS.map((option, i) => {
{COLOR_OPTIONS.map((option, i) => {
const color = COLORS_INDEXED_BY_VALUE[String(option.paramValue)]

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const SavedSearchRarity = () => {
<Text variant="sm" fontWeight={500}>
Rarity
</Text>

<Spacer y={1} />

<Flex flexDirection="row" flexWrap="wrap">
{ATTRIBUTION_CLASS_OPTIONS.map((option) => {
return (
Expand Down

0 comments on commit 2d4cce0

Please sign in to comment.