Skip to content

Commit

Permalink
PXWEB2-46 Code celanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PerIngeVaaje committed Apr 3, 2024
1 parent 3733b1d commit da96d09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
2 changes: 0 additions & 2 deletions libs/pxweb2-ui/src/lib/components/Link/Link.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
&:hover {
text-decoration: none;
background-color: var(--px-color-surface-subtle-hover);
// padding-top: 0px;
// padding-bottom: 0px;
}

&:focus {
Expand Down
23 changes: 3 additions & 20 deletions libs/pxweb2-ui/src/lib/components/Link/Link.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Meta, StoryObj, StoryFn } from '@storybook/react';

import { Link } from './Link';
import { BodyLong } from '../Typography/BodyLong/BodyLong';

Expand Down Expand Up @@ -68,21 +69,6 @@ export const inlineAndStandalone: StoryFn<typeof BodyLong> = () => {
saw a wolf, no even a little fox.
</BodyLong>

{/* <h2>small icon right:</h2>
<BodyLong size="small">
This is a story about Little Red Ridinghood. One day she went into the
wood to visit her grandmother. The day after too, She visited her every
day, every week, every month, every year. She never saw a wolf, no even
a little fox. Go to{' '}
<Link href="#" inline icon="FileText" iconPosition="right">
Statistikkbanken
</Link>{' '}
to read more This is a story about Little Red Ridinghood. One day she
went into the wood to visit her grandmother. The day after too, She
visited her every day, every week, every month, every year. She never
saw a wolf, no even a little fox.
</BodyLong> */}

<h1>Standalone link </h1>

<h2>medium without icon:</h2>
Expand All @@ -105,19 +91,16 @@ export const inlineAndStandalone: StoryFn<typeof BodyLong> = () => {
Statistikkbanken
</Link>

<h2>small icon left:</h2>
<h2>small icon left:</h2>
<Link href="#" icon="FileText" iconPosition="left" size="small">
Statistikkbanken{' '}
</Link>

<h2>small icon right:</h2>
<Link href="#" icon="FileText" iconPosition="right" size="small">
Statistikkbanken
</Link>
</Link>
<br />
</>
);
};

/* import { within } from '@storybook/testing-library';
import { expect } from '@storybook/jest'; */
3 changes: 1 addition & 2 deletions libs/pxweb2-ui/src/lib/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ export function Link({
noUnderline = false,
...rest
}: LinkProps) {

return (
<a
href={href}
className={cl(classes.link, {
[classes.no_underline]: noUnderline,
[classes.inline]: inline,
[classes[`bodylong-${size}`]]: size,
[classes[`padding-${size}`]]: size
[classes[`padding-${size}`]]: size,
})}
>
{icon && iconPosition === 'left' && (
Expand Down

0 comments on commit da96d09

Please sign in to comment.