-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate: Source-link * Fix: JSON key moved to the end of the file * Test: Storybook snapshot test --------- Signed-off-by: Claudio Wunder <cwunder@gnome.org> Co-authored-by: Claudio Wunder <cwunder@gnome.org>
- Loading branch information
Showing
5 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
components/Api/SourceLink/__snapshots__/index.stories.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Api/SourceLink Default smoke-test 1`] = ` | ||
<p class="SourceLink_sourceLinkComponent__1vzdY"> | ||
Source Code: | ||
<a href="https://github.com/nodejs/node/blob/1.0.0/http://nodejs.org/version/1.0.0"> | ||
http://nodejs.org/version/1.0.0 | ||
</a> | ||
</p> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.sourceLinkComponent { | ||
font-size: var(--font-size-body3); | ||
font-weight: var(--font-weight-semibold); | ||
text-transform: uppercase; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import SourceLink from './index'; | ||
import type { Meta as MetaObj, StoryObj } from '@storybook/react'; | ||
|
||
type Story = StoryObj<typeof SourceLink>; | ||
type Meta = MetaObj<typeof SourceLink>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
version: '1.0.0', | ||
link: 'http://nodejs.org/version/1.0.0', | ||
}, | ||
}; | ||
|
||
export default { component: SourceLink } as Meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import styles from './index.module.scss'; | ||
import type { FC } from 'react'; | ||
|
||
type SourceLinkProps = { | ||
link: string; | ||
version: string; | ||
}; | ||
|
||
const SourceLink: FC<SourceLinkProps> = ({ version, link }) => ( | ||
<p className={styles.sourceLinkComponent}> | ||
<FormattedMessage id="components.api.sourceLink" />{' '} | ||
<a href={`https://github.com/nodejs/node/blob/${version}/${link}`}> | ||
{link} | ||
</a> | ||
</p> | ||
); | ||
|
||
export default SourceLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters