Browse Source

Merge pull request #148 from loeck/master

Add categories for Storybook, fix fonts for Storybook
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
2e7ef7340e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package.json
  2. 8
      scripts/publish-storybook.sh
  3. 2
      src/components/Breadcrumb/stories.js
  4. 2
      src/components/RecipientAddress/stories.js
  5. 2
      src/components/SelectAccount/stories.js
  6. 2
      src/components/TransactionsList/stories.js
  7. 2
      src/components/base/Bar/stories.js
  8. 2
      src/components/base/Box/stories.js
  9. 2
      src/components/base/Button/stories.js
  10. 2
      src/components/base/CheckBox/stories.js
  11. 2
      src/components/base/GrowScroll/stories.js
  12. 2
      src/components/base/Icon/stories.js
  13. 2
      src/components/base/Input/stories.js
  14. 2
      src/components/base/Modal/stories.js
  15. 2
      src/components/base/Pills/stories.js
  16. 2
      src/components/base/QRCode/stories.js
  17. 2
      src/components/base/Radio/stories.js
  18. 2
      src/components/base/Search/stories.js
  19. 2
      src/components/base/Select/stories.js
  20. 2
      src/components/base/Tabs/stories.js
  21. 2
      src/components/base/Text/stories.js
  22. 2
      src/components/base/Tooltip/stories.js
  23. 6
      src/helpers/staticPath.js
  24. 2
      src/stories/currencies.stories.js
  25. 72
      yarn.lock

2
package.json

@ -18,7 +18,7 @@
"publish-storybook": "bash ./scripts/publish-storybook.sh",
"release": "build",
"start": "bash ./scripts/start.sh",
"storybook": "start-storybook -s ./static -p 4444"
"storybook": "STORYBOOK_ENV=1 start-storybook -s ./static -p 4444"
},
"lint-staged": {
"*.js": [

8
scripts/publish-storybook.sh

@ -3,11 +3,17 @@
set -e
rm -rf storybook-static
./node_modules/.bin/build-storybook
STORYBOOK_ENV=1 ./node_modules/.bin/build-storybook
mkdir -p storybook-static/static/fonts/opensans storybook-static/static/fonts/rubik
cp -R static/fonts/opensans storybook-static/static/fonts
cp -R static/fonts/rubik storybook-static/static/fonts
cd storybook-static
git init
git remote add origin git@github.com:LedgerHQ/ledger-wallet-desktop.git
git add .
git commit -m 'deploy storybook'
git push -f origin master:gh-pages
printf "deployed with success!"

2
src/components/Breadcrumb/stories.js

@ -6,7 +6,7 @@ import { number } from '@storybook/addon-knobs'
import Breadcrumb from 'components/Breadcrumb'
const stories = storiesOf('Breadcrumb', module)
const stories = storiesOf('Components/Breadcrumb', module)
stories.add('basic', () => (
<Breadcrumb

2
src/components/RecipientAddress/stories.js

@ -6,7 +6,7 @@ import { boolean } from '@storybook/addon-knobs'
import RecipientAddress from 'components/RecipientAddress'
const stories = storiesOf('RecipientAddress', module)
const stories = storiesOf('Components/RecipientAddress', module)
type State = {
value: any,

2
src/components/SelectAccount/stories.js

@ -8,7 +8,7 @@ import { getCurrencyByCoinType, getDefaultUnitByCoinType } from '@ledgerhq/curre
import { SelectAccount } from 'components/SelectAccount'
const chance = new Chance()
const stories = storiesOf('SelectAccount', module)
const stories = storiesOf('Components/SelectAccount', module)
const accounts = [...Array(20)].map(() => ({
id: chance.string(),

2
src/components/TransactionsList/stories.js

@ -5,7 +5,7 @@ import { storiesOf } from '@storybook/react'
import TransactionsList from 'components/TransactionsList'
const stories = storiesOf('TransactionsList', module)
const stories = storiesOf('Components/TransactionsList', module)
const transactions = [
{

2
src/components/base/Bar/stories.js

@ -7,6 +7,6 @@ import { storiesOf } from '@storybook/react'
import Bar from 'components/base/Bar'
const stories = storiesOf('Bar', module)
const stories = storiesOf('Components/Bar', module)
stories.add('basic', () => <Bar size={number('size', 1)} color="grey" />)

2
src/components/base/Box/stories.js

@ -8,7 +8,7 @@ import styled from 'styled-components'
import Box from 'components/base/Box'
const stories = storiesOf('Box', module)
const stories = storiesOf('Components/Box', module)
const align = [
undefined,

2
src/components/base/Button/stories.js

@ -5,7 +5,7 @@ import { storiesOf } from '@storybook/react'
import Button from 'components/base/Button'
const stories = storiesOf('Button', module)
const stories = storiesOf('Components/Button', module)
stories.add('basic', () => <Button>{'Do some action'}</Button>)
stories.add('primary', () => <Button primary>{'Validate'}</Button>)

2
src/components/base/CheckBox/stories.js

@ -7,7 +7,7 @@ import { action } from '@storybook/addon-actions'
import CheckBox from 'components/base/CheckBox'
const stories = storiesOf('CheckBox', module)
const stories = storiesOf('Components/CheckBox', module)
stories.add('basic', () => (
<CheckBox isChecked={boolean('isChecked', false)} onChange={action('onChange')} />

2
src/components/base/GrowScroll/stories.js

@ -7,7 +7,7 @@ import { boolean } from '@storybook/addon-knobs'
import Box from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll'
const stories = storiesOf('GrowScroll', module)
const stories = storiesOf('Components/GrowScroll', module)
stories.add('basic', () => {
const reverseColor = boolean('reverseColor', false)

2
src/components/base/Icon/stories.js

@ -6,7 +6,7 @@ import { text, number } from '@storybook/addon-knobs'
import Icon from 'components/base/Icon'
const stories = storiesOf('Icon', module)
const stories = storiesOf('Components/Icon', module)
const Wrapper = ({ children }: { children: any }) => (
<div>

2
src/components/base/Input/stories.js

@ -5,6 +5,6 @@ import { storiesOf } from '@storybook/react'
import Input from 'components/base/Input'
const stories = storiesOf('Input', module)
const stories = storiesOf('Components/Input', module)
stories.add('basic', () => <Input placeholder="Foo bar" />)

2
src/components/base/Modal/stories.js

@ -6,7 +6,7 @@ import { boolean } from '@storybook/addon-knobs'
import { Modal, ModalBody } from 'components/base/Modal'
const stories = storiesOf('Modal', module)
const stories = storiesOf('Components/Modal', module)
stories.add('basic', () => {
const isOpened = boolean('isOpened', true)

2
src/components/base/Pills/stories.js

@ -5,7 +5,7 @@ import { storiesOf } from '@storybook/react'
import Pills from 'components/base/Pills'
const stories = storiesOf('Pills', module)
const stories = storiesOf('Components/Pills', module)
type State = {
key: string,

2
src/components/base/QRCode/stories.js

@ -7,6 +7,6 @@ import { text, number } from '@storybook/addon-knobs'
import QRCode from 'components/base/QRCode'
const stories = storiesOf('QRCode', module)
const stories = storiesOf('Components/QRCode', module)
stories.add('basic', () => <QRCode data={text('data', 'sample')} size={number('size', 200)} />)

2
src/components/base/Radio/stories.js

@ -7,7 +7,7 @@ import { boolean } from '@storybook/addon-knobs'
import Radio from 'components/base/Radio'
const stories = storiesOf('Radio', module)
const stories = storiesOf('Components/Radio', module)
stories.add('basic', () => (
<Radio isChecked={boolean('checked', false)} onChange={action('onChange')} />

2
src/components/base/Search/stories.js

@ -7,7 +7,7 @@ import { text, boolean } from '@storybook/addon-knobs'
import Search from 'components/base/Search'
const stories = storiesOf('Search', module)
const stories = storiesOf('Components/Search', module)
const items = [
{ key: 'aleksandr-grichtchouk', name: 'Aleksandr Grichtchouk' },

2
src/components/base/Select/stories.js

@ -7,7 +7,7 @@ import Box from 'components/base/Box'
import Select from 'components/base/Select'
import Text from 'components/base/Text'
const stories = storiesOf('Select', module)
const stories = storiesOf('Components/Select', module)
const itemsChessPlayers = [
{ key: 'aleksandr-grichtchouk', name: 'Aleksandr Grichtchouk' },

2
src/components/base/Tabs/stories.js

@ -8,7 +8,7 @@ import { storiesOf } from '@storybook/react'
import Tabs from 'components/base/Tabs'
const stories = storiesOf('Tabs', module)
const stories = storiesOf('Components/Tabs', module)
stories.add('basic', () => (
<Tabs

2
src/components/base/Text/stories.js

@ -10,7 +10,7 @@ import Text from 'components/base/Text'
import { fontFamilies, fontSizes } from 'styles/theme'
const stories = storiesOf('Text', module)
const stories = storiesOf('Common/Text', module)
const Title = ({ children }: { children: string }) => (
<Text style={{ fontFamily: 'monospace' }} fontSize={5}>

2
src/components/base/Tooltip/stories.js

@ -5,6 +5,6 @@ import { storiesOf } from '@storybook/react'
import Tooltip from 'components/base/Tooltip'
const stories = storiesOf('Tooltip', module)
const stories = storiesOf('Components/Tooltip', module)
stories.add('basic', () => <Tooltip render={() => <div>Oyo!</div>}>Hover me!</Tooltip>)

6
src/helpers/staticPath.js

@ -1,6 +1,8 @@
const isStorybook = !process.mainModule
const isStorybook = process.env.STORYBOOK_ENV
const isRunningInAsar = !isStorybook && process.mainModule.filename.indexOf('app.asar') !== -1
export default (__DEV__ && !isStorybook
? __static
: isRunningInAsar ? __dirname.replace(/app\.asar$/, 'static') : `${__dirname}/../static`)
: isRunningInAsar
? __dirname.replace(/app\.asar$/, 'static')
: !isStorybook ? `${__dirname}/../static` : 'static')

2
src/stories/currencies.stories.js

@ -7,7 +7,7 @@ import { getIconByCoinType } from '@ledgerhq/currencies/react'
import type { Currency } from '@ledgerhq/currencies'
const stories = storiesOf('currencies', module)
const stories = storiesOf('Common/Currencies', module)
const currencies: Array<Currency> = listCurrencies()

72
yarn.lock

@ -564,38 +564,18 @@ anymatch@^2.0.0:
micromatch "^3.1.4"
normalize-path "^2.1.1"
app-builder-bin-linux@1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/app-builder-bin-linux/-/app-builder-bin-linux-1.3.5.tgz#8ef1a839d0614b81e0f11bd593ff533a058d7c5b"
app-builder-bin-linux@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin-linux/-/app-builder-bin-linux-1.3.6.tgz#45344c4b09b3c2febc3a452e8916fa00aa645b62"
app-builder-bin-mac@1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/app-builder-bin-mac/-/app-builder-bin-mac-1.3.5.tgz#3a9d3dea92f4fd5cf531a8947571c4c67a10761b"
app-builder-bin-mac@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin-mac/-/app-builder-bin-mac-1.3.6.tgz#c7df8f4c349292c789e557a285df2279d05b8201"
app-builder-bin-win@1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/app-builder-bin-win/-/app-builder-bin-win-1.3.5.tgz#5d2a3c31e8a54991498f861b5a0cbe0227a91e9c"
app-builder-bin-win@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin-win/-/app-builder-bin-win-1.3.6.tgz#b492c0573cfa4206fb9f33756d6ab844e04ce0b8"
app-builder-bin@1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-1.3.5.tgz#70d6a16a19265cd764747779c84017abc14abce4"
optionalDependencies:
app-builder-bin-linux "1.3.5"
app-builder-bin-mac "1.3.5"
app-builder-bin-win "1.3.5"
app-builder-bin@1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-1.3.6.tgz#fbc49a3b74917f5e23632c71ea1a3ea9b083424e"
@ -2146,26 +2126,7 @@ builder-util-runtime@4.0.5, builder-util-runtime@^4.0.5, builder-util-runtime@~4
fs-extra-p "^4.5.0"
sax "^1.2.4"
builder-util@5.3.0, builder-util@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-5.3.0.tgz#595d553fe7ab69a109cbb463ff82977ff3e66f2e"
dependencies:
"7zip-bin" "~3.1.0"
app-builder-bin "1.3.5"
bluebird-lst "^1.0.5"
builder-util-runtime "^4.0.5"
chalk "^2.3.0"
debug "^3.1.0"
fs-extra-p "^4.5.0"
is-ci "^1.1.0"
js-yaml "^3.10.0"
lazy-val "^1.0.3"
semver "^5.5.0"
source-map-support "^0.5.3"
stat-mode "^0.2.2"
temp-file "^3.1.1"
builder-util@5.3.1:
builder-util@5.3.1, builder-util@^5.3.0:
version "5.3.1"
resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-5.3.1.tgz#e90831153268803962b2a96afcba31dfa4223c39"
dependencies:
@ -3385,7 +3346,7 @@ ejs@^2.5.7:
version "2.5.7"
resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a"
electron-builder-lib@20.0.7:
electron-builder-lib@20.0.7, electron-builder-lib@~20.0.5:
version "20.0.7"
resolved "https://registry.yarnpkg.com/electron-builder-lib/-/electron-builder-lib-20.0.7.tgz#d9925bb326f9db081586058bc4ff78bf2145b4be"
dependencies:
@ -3414,35 +3375,6 @@ electron-builder-lib@20.0.7:
semver "^5.5.0"
temp-file "^3.1.1"
electron-builder-lib@~20.0.5:
version "20.0.6"
resolved "https://registry.yarnpkg.com/electron-builder-lib/-/electron-builder-lib-20.0.6.tgz#1484108626312026cf5c2188aefe0c33f40bad81"
dependencies:
"7zip-bin" "~3.1.0"
app-builder-bin "1.3.5"
async-exit-hook "^2.0.1"
bluebird-lst "^1.0.5"
builder-util "5.3.0"
builder-util-runtime "4.0.5"
chromium-pickle-js "^0.2.0"
debug "^3.1.0"
ejs "^2.5.7"
electron-osx-sign "0.4.8"
electron-publish "20.0.6"
fs-extra-p "^4.5.2"
hosted-git-info "^2.5.0"
is-ci "^1.1.0"
isbinaryfile "^3.0.2"
js-yaml "^3.10.0"
lazy-val "^1.0.3"
minimatch "^3.0.4"
normalize-package-data "^2.4.0"
plist "^2.1.0"
read-config-file "3.0.0"
sanitize-filename "^1.6.1"
semver "^5.5.0"
temp-file "^3.1.1"
electron-builder@^20.0.7:
version "20.0.7"
resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-20.0.7.tgz#daaa45efb7eeff77a76362671e1dc359d9d931c1"

Loading…
Cancel
Save