Skip to content

Commit

Permalink
fix(playlist): change filters color and style
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Jun 18, 2021
1 parent abe95c2 commit 83fa7ac
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ type Props = {
startIcon?: JSX.Element;
variant?: Variant;
onClick?: () => void;
tabIndex?: number;
to?: string;
};
role?: string;
} & React.AriaAttributes;

const Button: React.FC<Props & React.AriaAttributes> = ({
const Button: React.FC<Props> = ({
label,
color = 'default',
startIcon,
Expand Down
8 changes: 4 additions & 4 deletions src/components/Dropdown/Dropdown.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ $select-focus: theme.$primary-color;
position: relative;
display: grid;
align-items: center;
min-width: 10ch;
max-width: 20ch;
width: 140px;
margin-left: 24px;
font-size: 1.25rem;
line-height: 1.1;
Expand All @@ -37,8 +36,9 @@ $select-focus: theme.$primary-color;
z-index: 1;
width: 100%;
margin: 0;
padding: 9px;
color: var(--highlight-color, white);
padding: 9px 24px 9px 9px;
text-overflow: ellipsis;
color: variables.$white;
font-family: inherit;
font-weight: 700;
font-size: 1rem;
Expand Down
1 change: 0 additions & 1 deletion src/components/Filter/Filter.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
display: flex;
align-items: center;
margin-left: 16px;
padding-top: 8px;

> button {
margin: 0 4px;
Expand Down
13 changes: 10 additions & 3 deletions src/components/Filter/Filter.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Fragment, FC } from 'react';
import { useTranslation } from 'react-i18next';

import Dropdown from '../Dropdown/Dropdown';
import Button from '../Button/Button';
import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint';

import styles from './Filter.module.scss';
import { useTranslation } from 'react-i18next';

type Props = {
name: string;
Expand All @@ -30,16 +30,23 @@ const Filter: FC<Props> = ({ name, value, defaultLabel, options, setValue, value
return (
<Fragment>
{showFilterRow ? (
<div className={styles.filterRow}>
<div className={styles.filterRow} role="listbox">
{options.map((option) => (
<Button
label={`${valuePrefix}${option}`}
onClick={() => setValue(option)}
key={option}
active={value === option}
role="option"
/>
))}
<Button label={defaultLabel} onClick={() => setValue('')} active={value === ''} key={defaultLabel} />
<Button
label={defaultLabel}
onClick={() => setValue('')}
active={value === ''}
key={defaultLabel}
role="option"
/>
</div>
) : (
<Dropdown
Expand Down
5 changes: 5 additions & 0 deletions src/components/Filter/__snapshots__/Filter.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,35 @@ exports[`<Filter> renders Filter 1`] = `
<div>
<div
class="filterRow"
role="listbox"
>
<button
class="button default outlined"
role="option"
>
<span>
x
</span>
</button>
<button
class="button default outlined"
role="option"
>
<span>
y
</span>
</button>
<button
class="button default outlined"
role="option"
>
<span>
z
</span>
</button>
<button
class="button default outlined"
role="option"
>
<span>
bb
Expand Down

0 comments on commit 83fa7ac

Please sign in to comment.