-
Notifications
You must be signed in to change notification settings - Fork 8
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 #33 from bensmithett/updates
Dependency update, change dev server port, and move to MDX for stories
- Loading branch information
Showing
7 changed files
with
2,260 additions
and
1,816 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
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
33 changes: 0 additions & 33 deletions
33
src/components/TropicalCodeBlock/TropicalCodeBlock.stories.jsx
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
src/components/TropicalCodeBlock/TropicalCodeBlock.stories.mdx
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,56 @@ | ||
import { Meta, Story } from '@storybook/addon-docs' | ||
import { TropicalCodeBlock } from './TropicalCodeBlock' | ||
|
||
<Meta title='TropicalCodeBlock' component={TropicalCodeBlock} /> | ||
|
||
export const Template = (args) => <TropicalCodeBlock {...args} /> | ||
|
||
# TropicalCodeBlock | ||
|
||
This component is used to render MDX fenced code blocks (```) using <a href='https://github.com/FormidableLabs/prism-react-renderer' target='_blank'>prism-react-renderer</a> (as per the <a href='https://mdxjs.com/guides/syntax-highlighting' target='_blank'>MDX syntax highlighting guide</a>). | ||
|
||
## Customising | ||
|
||
You can change this component to suit your needs. | ||
|
||
### Theme | ||
|
||
See <a href='https://github.com/FormidableLabs/prism-react-renderer#theming'>prism-react-renderer's Theming docs</a>. | ||
|
||
### Syntaxes | ||
|
||
⚠️ prism-react-renderer only highlights <a href='https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/vendor/prism/includeLangs.js' target='_blank'>certain languages</a> by default. See prism-react-renderer's <a href='https://github.com/FormidableLabs/prism-react-renderer#faq' target='_blank'>FAQ about adding more language highlighing support</a> for instructions. | ||
|
||
## Stories | ||
|
||
### JS | ||
|
||
<Story | ||
name='JS' | ||
args={{ | ||
children: `function relax() { | ||
console.log('Welcome to Tropical') | ||
}`, | ||
language: 'javascript' | ||
}} | ||
> | ||
{Template.bind({})} | ||
</Story> | ||
|
||
### JSX | ||
|
||
<Story | ||
name='JSX' | ||
args={{ | ||
children: `function Relax ({ drink = 'Singapore Sling' }) { | ||
return ( | ||
<div> | ||
<Cocktail drink={drink} /> | ||
</div> | ||
) | ||
}`, | ||
language: 'jsx' | ||
}} | ||
> | ||
{Template.bind({})} | ||
</Story> |
16 changes: 0 additions & 16 deletions
16
src/components/TropicalPhotoButton/TropicalPhotoButton.stories.jsx
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/components/TropicalPhotoButton/TropicalPhotoButton.stories.mdx
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,16 @@ | ||
import { Meta, Story } from '@storybook/addon-docs' | ||
import { TropicalPhotoButton } from './TropicalPhotoButton' | ||
|
||
<Meta title='TropicalPhotoButton' component={TropicalPhotoButton} /> | ||
|
||
export const Template = (args) => <TropicalPhotoButton {...args} /> | ||
|
||
# TropicalPhotoButton | ||
|
||
A silly example component. You can delete this. | ||
|
||
## Stories | ||
|
||
### Normal | ||
|
||
<Story name='Normal' args={{ children: 'Click me!', alertMessage: 'Hello!' }} /> |
Oops, something went wrong.