Skip to content

Commit 495f4c6

Browse files
authored
Merge pull request #33 from bensmithett/updates
Dependency update, change dev server port, and move to MDX for stories
2 parents b67e5e9 + 9ed6de9 commit 495f4c6

File tree

7 files changed

+2260
-1816
lines changed

7 files changed

+2260
-1816
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "tropical",
3-
"version": "9.1.0",
3+
"version": "9.2.0",
44
"dependencies": {
55
"@babel/core": "^7.14.6",
66
"@mdx-js/mdx": "^1.6.22",
77
"@mdx-js/react": "^1.6.22",
8-
"@storybook/addon-actions": "^6.4.0-alpha.16",
9-
"@storybook/addon-essentials": "^6.4.0-alpha.16",
10-
"@storybook/addon-links": "^6.4.0-alpha.16",
11-
"@storybook/react": "^6.4.0-alpha.16",
8+
"@storybook/addon-actions": "^6.4.8",
9+
"@storybook/addon-essentials": "^6.4.8",
10+
"@storybook/addon-links": "^6.4.8",
11+
"@storybook/react": "^6.4.8",
1212
"@vitejs/plugin-react-refresh": "^1.3.1",
1313
"babel-loader": "^8.2.2",
1414
"dayjs": "^1.10.6",
@@ -22,7 +22,7 @@
2222
"react-fela": "^11.6.1",
2323
"react-head": "^3.4.0",
2424
"rehype-slug": "^4.0.1",
25-
"storybook-builder-vite": "^0.0.12",
25+
"storybook-builder-vite": "^0.1.10",
2626
"tropical-islands": "^0.1.2",
2727
"tropical-scaffold": "^0.1.1",
2828
"vite": "^2.4.2",

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ async function createServer() {
2727
}
2828
})
2929

30-
app.listen(5000)
30+
app.listen(3000)
3131

32-
console.log('🏝 Your Tropical site is now being served at: http://localhost:5000')
32+
console.log('🏝 Your Tropical site is now being served at: http://localhost:3000')
3333
}
3434

3535
createServer()

src/components/TropicalCodeBlock/TropicalCodeBlock.stories.jsx

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { Meta, Story } from '@storybook/addon-docs'
2+
import { TropicalCodeBlock } from './TropicalCodeBlock'
3+
4+
<Meta title='TropicalCodeBlock' component={TropicalCodeBlock} />
5+
6+
export const Template = (args) => <TropicalCodeBlock {...args} />
7+
8+
# TropicalCodeBlock
9+
10+
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>).
11+
12+
## Customising
13+
14+
You can change this component to suit your needs.
15+
16+
### Theme
17+
18+
See <a href='https://github.com/FormidableLabs/prism-react-renderer#theming'>prism-react-renderer's Theming docs</a>.
19+
20+
### Syntaxes
21+
22+
⚠️ 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.
23+
24+
## Stories
25+
26+
### JS
27+
28+
<Story
29+
name='JS'
30+
args={{
31+
children: `function relax() {
32+
console.log('Welcome to Tropical')
33+
}`,
34+
language: 'javascript'
35+
}}
36+
>
37+
{Template.bind({})}
38+
</Story>
39+
40+
### JSX
41+
42+
<Story
43+
name='JSX'
44+
args={{
45+
children: `function Relax ({ drink = 'Singapore Sling' }) {
46+
return (
47+
<div>
48+
<Cocktail drink={drink} />
49+
</div>
50+
)
51+
}`,
52+
language: 'jsx'
53+
}}
54+
>
55+
{Template.bind({})}
56+
</Story>

src/components/TropicalPhotoButton/TropicalPhotoButton.stories.jsx

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Meta, Story } from '@storybook/addon-docs'
2+
import { TropicalPhotoButton } from './TropicalPhotoButton'
3+
4+
<Meta title='TropicalPhotoButton' component={TropicalPhotoButton} />
5+
6+
export const Template = (args) => <TropicalPhotoButton {...args} />
7+
8+
# TropicalPhotoButton
9+
10+
A silly example component. You can delete this.
11+
12+
## Stories
13+
14+
### Normal
15+
16+
<Story name='Normal' args={{ children: 'Click me!', alertMessage: 'Hello!' }} />

0 commit comments

Comments
 (0)