-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #513 from omnifed/512-docs-refactor-outdated-react…
…-import-snippets 512 docs refactor outdated react import snippets
- Loading branch information
Showing
14 changed files
with
70 additions
and
28 deletions.
There are no files selected for viewing
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,50 @@ | ||
import { Tabs, TabList, Tab, TabPanel } from '@cerberus-design/react' | ||
import { Code } from './Code' | ||
import { css } from '@cerberus/styled-system/css' | ||
|
||
interface BashTabsProps { | ||
code: string | ||
} | ||
|
||
export default function BashTabs(props: BashTabsProps) { | ||
return ( | ||
<Tabs active="npm" cache id="bash-tabs"> | ||
<TabList | ||
className={css({ | ||
borderColor: 'page.border.100', | ||
})} | ||
description="Bash commands" | ||
> | ||
<Tab value="npm">NPM</Tab> | ||
<Tab value="pnpm">PNPM</Tab> | ||
<Tab value="yarn">Yarn</Tab> | ||
</TabList> | ||
|
||
<div | ||
className={css({ | ||
mb: 8, | ||
mt: 4, | ||
})} | ||
> | ||
<TabPanel tab="npm"> | ||
<Code language="bash" showLineNumbers> | ||
{props.code} | ||
</Code> | ||
</TabPanel> | ||
<TabPanel tab="pnpm"> | ||
<Code language="bash" showLineNumbers> | ||
{props.code | ||
.replace('npm', 'pnpm') | ||
.replace('install', 'add') | ||
.replace('npx', 'pnpm dlx')} | ||
</Code> | ||
</TabPanel> | ||
<TabPanel tab="yarn"> | ||
<Code language="bash" showLineNumbers> | ||
{props.code.replace('npm', 'yarn').replace('install', 'add')} | ||
</Code> | ||
</TabPanel> | ||
</div> | ||
</Tabs> | ||
) | ||
} |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
File renamed without changes.