From 424eaa9e8098cef762b1a2a7565d37944bb25306 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Mon, 21 Oct 2019 18:25:12 +0200 Subject: Add storybook --- assets/css/main.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 assets/css/main.css (limited to 'assets/css') diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..21bcffb --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,15 @@ +@import url('https://fonts.googleapis.com/css?family=Roboto+Slab&display=swap'); + +html, +body { + padding: 0; + margin: 0; +} + +* { + box-sizing: border-box; + font-family: 'Roboto Slab', serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + color: #181818; +} -- cgit 1.4.1 From 17fc6a6b4507e5535d8b6989b66da5bac323e87b Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Mon, 21 Oct 2019 19:53:02 +0200 Subject: Add PostList --- .gitignore | 1 + .storybook/decorators/index.js | 6 +++ assets/css/main.css | 3 ++ components/PostLink.stories.js | 8 +-- components/PostLink.vue | 1 + components/PostList/PostList.vue | 49 +++++++++++++++++++ components/PostList/PurePostList.stories.js | 31 ++++++++++++ components/PostList/PurePostList.vue | 76 +++++++++++++++++++++++++++++ components/PostList/index.js | 3 ++ components/PurePostList.stories.js | 16 ------ components/PurePostList.vue | 38 --------------- pages/index.vue | 19 +++++--- pages/kronika/index.vue | 33 ++----------- 13 files changed, 186 insertions(+), 98 deletions(-) create mode 100644 .storybook/decorators/index.js create mode 100644 components/PostList/PostList.vue create mode 100644 components/PostList/PurePostList.stories.js create mode 100644 components/PostList/PurePostList.vue create mode 100644 components/PostList/index.js delete mode 100644 components/PurePostList.stories.js delete mode 100644 components/PurePostList.vue (limited to 'assets/css') diff --git a/.gitignore b/.gitignore index 53c3292..6937f9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ content +static/api # Created by .ignore support plugin (hsz.mobi) ### Node template diff --git a/.storybook/decorators/index.js b/.storybook/decorators/index.js new file mode 100644 index 0000000..acea431 --- /dev/null +++ b/.storybook/decorators/index.js @@ -0,0 +1,6 @@ +export const center = () => { + return { + template: + '
' + } +} diff --git a/assets/css/main.css b/assets/css/main.css index 21bcffb..7da562e 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -8,6 +8,9 @@ body { * { box-sizing: border-box; +} + +body { font-family: 'Roboto Slab', serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; diff --git a/components/PostLink.stories.js b/components/PostLink.stories.js index 71d04ed..a824b35 100644 --- a/components/PostLink.stories.js +++ b/components/PostLink.stories.js @@ -1,4 +1,5 @@ import { storiesOf } from '@storybook/vue' +import { center } from '../.storybook/decorators' import PostLink from './PostLink' @@ -9,13 +10,6 @@ export const postLink = { route: '/kronika/2019/20/11/test' } -const center = () => { - return { - template: - '
' - } -} - storiesOf('PostLink', module) .addDecorator(center) .add('default', () => { diff --git a/components/PostLink.vue b/components/PostLink.vue index b0aeb5a..5bc5127 100644 --- a/components/PostLink.vue +++ b/components/PostLink.vue @@ -40,6 +40,7 @@ export default { margin: 20px; flex-basis: 410px; max-width: 410px; + height: 250px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25); background: #ffffff; text-align: left; diff --git a/components/PostList/PostList.vue b/components/PostList/PostList.vue new file mode 100644 index 0000000..206a73f --- /dev/null +++ b/components/PostList/PostList.vue @@ -0,0 +1,49 @@ + + + \ No newline at end of file diff --git a/components/PostList/PurePostList.stories.js b/components/PostList/PurePostList.stories.js new file mode 100644 index 0000000..cf812f7 --- /dev/null +++ b/components/PostList/PurePostList.stories.js @@ -0,0 +1,31 @@ +import { storiesOf } from '@storybook/vue' +import { center } from '../../.storybook/decorators' + +import { postLink } from '../PostLink.stories' + +import PurePostList from './PurePostList' + +export const posts = Array(5).fill(postLink) +console.log(posts) + +storiesOf('PurePostList', module) + .addDecorator(center) + .add('default', () => { + return { + components: { PurePostList }, + template: ``, + data: () => ({ posts }) + } + }) + .add('loading', () => { + return { + components: { PurePostList }, + template: `` + } + }) + .add('no posts', () => { + return { + components: { PurePostList }, + template: `` + } + }) diff --git a/components/PostList/PurePostList.vue b/components/PostList/PurePostList.vue new file mode 100644 index 0000000..7e70db8 --- /dev/null +++ b/components/PostList/PurePostList.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/components/PostList/index.js b/components/PostList/index.js new file mode 100644 index 0000000..dbb515e --- /dev/null +++ b/components/PostList/index.js @@ -0,0 +1,3 @@ +import PostList from './PostList' + +export default PostList diff --git a/components/PurePostList.stories.js b/components/PurePostList.stories.js deleted file mode 100644 index 134cd68..0000000 --- a/components/PurePostList.stories.js +++ /dev/null @@ -1,16 +0,0 @@ -import { storiesOf } from '@storybook/vue' - -import { postLink } from './PostLink.stories' - -import PurePostList from './PurePostList' - -export const posts = Array(5).fill(postLink) -console.log(posts) - -storiesOf('PurePostList', module).add('default', () => { - return { - components: { PurePostList }, - template: ``, - data: () => ({ posts }) - } -}) diff --git a/components/PurePostList.vue b/components/PurePostList.vue deleted file mode 100644 index a93360d..0000000 --- a/components/PurePostList.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/index.vue b/pages/index.vue index 736e7f4..8b093df 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,16 +1,21 @@ \ No newline at end of file diff --git a/pages/kronika/index.vue b/pages/kronika/index.vue index cff3551..d9685c1 100644 --- a/pages/kronika/index.vue +++ b/pages/kronika/index.vue @@ -1,43 +1,16 @@ -- cgit 1.4.1