Skip to content

Commit

Permalink
IS-3030: fix uu nullstill button
Browse files Browse the repository at this point in the history
  • Loading branch information
ingring committed Jan 23, 2025
1 parent abfdbf5 commit 88499ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 53 deletions.
38 changes: 7 additions & 31 deletions src/sider/oversikt/filter/ClearFiltersButton.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,28 @@
import React, { ReactElement } from 'react';
import styled from 'styled-components';
import themes from '@/styles/themes';
import SlettIkon from '@/sider/oversikt/filter/SlettIkon';
import { useFilters } from '@/context/filters/FilterContext';
import { ActionType } from '@/context/filters/filterContextActions';
import { Button } from '@navikt/ds-react';
import { TrashIcon } from '@navikt/aksel-icons';

const texts = {
nullstill: 'Nullstill valg',
};

const ClearFiltersWrapper = styled.div`
display: inline-flex;
align-items: center;
box-sizing: border-box;
justify-content: flex-end;
color: ${themes.color.navBla};
font-size: 1em;
font-weight: 500;
padding: 0.5rem 0.25rem;
-webkit-user-select: none;
user-select: none;
:hover {
cursor: pointer;
}
:active {
border: 2px solid ${themes.color.navBla};
}
> svg {
margin-right: 0.25em;
}
`;

export const ClearFiltersButton = (): ReactElement => {
const { dispatch: dispatchFilterAction } = useFilters();

return (
<ClearFiltersWrapper
<Button
variant="tertiary"
size="small"
icon={<TrashIcon title="a11y-title" fontSize="1.5rem" />}
onClick={() => {
dispatchFilterAction({
type: ActionType.ResetFilters,
});
}}
>
<SlettIkon fargeKode={themes.color.navBla} />
{texts.nullstill}
</ClearFiltersWrapper>
</Button>
);
};
22 changes: 0 additions & 22 deletions src/sider/oversikt/filter/SlettIkon.tsx

This file was deleted.

0 comments on commit 88499ab

Please sign in to comment.