Skip to content

Commit

Permalink
fix options icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jsomsanith committed May 14, 2022
1 parent cbf0337 commit 2dcc9da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions addons/a11y/src/components/VisionSimulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ export const baseList = [

type Filter = Option | null;

const getFilter = (filter: Filter) => {
if (!filter) {
const getFilter = (filterName: string) => {
if (!filterName) {
return 'none';
}
if (filter.name === 'blurred vision') {
if (filterName === 'blurred vision') {
return 'blur(2px)';
}
if (filter.name === 'grayscale') {
if (filterName === 'grayscale') {
return 'grayscale(100%)';
}
return `url('#${filter}')`;
return `url('#${filterName}')`;
};

const Hidden = styled.div(() => ({
Expand All @@ -47,7 +47,7 @@ const Hidden = styled.div(() => ({
},
}));

const ColorIcon = styled.span<{ filter: Filter }>(
const ColorIcon = styled.span<{ filter: string }>(
{
background: 'linear-gradient(to right, #F44336, #FF9800, #FFEB3B, #8BC34A, #2196F3, #9C27B0)',
borderRadius: '1rem',
Expand Down Expand Up @@ -112,7 +112,7 @@ const getColorList = (active: Filter, set: (i: Filter) => void): Link[] => [
onClick: () => {
set(i);
},
right: <ColorIcon filter={i} />,
right: <ColorIcon filter={i.name} />,
active: active === i,
};
}),
Expand All @@ -126,7 +126,7 @@ export const VisionSimulator = () => {
<Global
styles={{
[`#${iframeId}`]: {
filter: getFilter(filter),
filter: getFilter(filter.name),
},
}}
/>
Expand Down

0 comments on commit 2dcc9da

Please sign in to comment.