Skip to content

Commit

Permalink
chore(#33): Remove local components and replace with `@digdir/design-…
Browse files Browse the repository at this point in the history
…system-react` components (#34)

* update designsystem, remove local `Link` and `Heading`

* remove local Link from index.ts

* remove `Body`, replace with `Paragraph` in story

---------

Co-authored-by: Øyvind Thune <oyvlei@gmail.com>
  • Loading branch information
Barsnes and Thunear authored Sep 20, 2023
1 parent 2db03a5 commit 65461f4
Show file tree
Hide file tree
Showing 21 changed files with 12 additions and 453 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';

import { Link } from '../Link';
import { Body } from '../Typography/Body';
import { Link, Paragraph } from '@digdir/design-system-react';

import { Breadcrumb } from './Breadcrumb';

Expand All @@ -18,12 +16,12 @@ const CHILDREN = [
>
Forrige side
</Link>,
<Body
<Paragraph
key={4}
size='medium'
>
Body
</Body>,
</Paragraph>,
];

export default {
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/Breadcrumb/Breadcrumb.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { render as renderRtl, screen } from '@testing-library/react';

import { Link } from '../Link';
import { Link } from '@digdir/design-system-react';

import { Breadcrumb } from './Breadcrumb';
import type { BreadcrumbProps } from './Breadcrumb';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { MagnifyingGlassIcon } from '@navikt/aksel-icons';
import { Link } from '@digdir/design-system-react';

import myLogo from '../../../../../assets/img/digdir-logo.svg';
import { Link } from '../Link/Link';

import { Header } from './Header';
import classes from './HeaderStories.module.css';
Expand Down
44 changes: 0 additions & 44 deletions packages/react/src/components/Link/Link.module.css

This file was deleted.

71 changes: 0 additions & 71 deletions packages/react/src/components/Link/Link.stories.tsx

This file was deleted.

66 changes: 0 additions & 66 deletions packages/react/src/components/Link/Link.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions packages/react/src/components/Link/index.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/react/src/components/LinkList/LinkList.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';

import { Link } from '../Link/Link';
import { Link } from '@digdir/design-system-react';

import { LinkList } from './LinkList';

Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/components/LinkList/LinkList.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { render as renderRtl, screen } from '@testing-library/react';

import { Link } from '../Link/Link';
import { Link } from '@digdir/design-system-react';

import type { LinkListProps } from './LinkList';
import { LinkList, ERRORMESSAGE } from './LinkList';
Expand Down Expand Up @@ -37,8 +36,9 @@ describe('LinkList', () => {
inverted: true,
title: 'title',
});
const list = screen.getByRole('link');
expect(list.classList).toContain('inverted');
const link = screen.getByRole('link');
// check if the link has the inverted class, it may have been scrambled by the css modules
expect(JSON.stringify(link.classList)).toContain('inverted');
});

it('throw error message, if linkTitle is true and url is undefined', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/LinkList/LinkList.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { createElement, useEffect, useState } from 'react';
import cn from 'classnames';
import type { LinkProps } from '@digdir/design-system-react';
import { Link } from '@digdir/design-system-react';

import { errorMessage } from '../../utils/helperFunctions/ThrowMessageHelper';
import type { LinkProps } from '../Link/Link';
import { Link } from '../Link/Link';

import classes from './LinkList.module.css';

Expand Down
20 changes: 0 additions & 20 deletions packages/react/src/components/Typography/Body/Body.module.css

This file was deleted.

31 changes: 0 additions & 31 deletions packages/react/src/components/Typography/Body/Body.stories.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions packages/react/src/components/Typography/Body/Body.test.tsx

This file was deleted.

43 changes: 0 additions & 43 deletions packages/react/src/components/Typography/Body/Body.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/react/src/components/Typography/Body/index.ts

This file was deleted.

Loading

0 comments on commit 65461f4

Please sign in to comment.