git.iko.soy/rowtype-yoga/psfp
on 9e23a92 help sign in
rowtype-yoga/psfp/stories/CardStories.purs
44 lines 1.6 kB history raw
1module CardStories where
3import Prelude hiding (add)
5import Card.Component (mkCard, mkCardContent, mkCardSubtitle, mkCardTitle)
6import Decorator.FullScreen (fullScreenDecorator)
7import Effect (Effect)
8import React.Basic.DOM as R
9import React.Basic.Hooks (component, element)
10import Storybook.React (Storybook, add, addDecorator, storiesOf)
12stories ∷ Effect Storybook
13stories =
14 storiesOf "Card" do
15 addDecorator fullScreenDecorator
16 add "Example card" mkExample
17 [ { title: "An example card"
18 , subtitle: "It says some more"
19 , content: R.text loremIpsum
20 }
21 ]
22 where
23 mkExample = do
24 card <- mkCard
25 cardTitle <- mkCardTitle
26 cardSubtitle <- mkCardSubtitle
27 cardContent <- mkCardContent
28 component "ExampleCard" \{ title, subtitle, content } -> React.do
29 pure
30 $ element card
31 { children:
32 [ element cardTitle { children: [ R.text title ] }
33 , element cardSubtitle { children: [ R.text subtitle ] }
34 , element cardContent { children: [ content ] }
35 ]
36 }
38loremIpsum ∷ String
39loremIpsum =
40 """PureScript is a strongly-typed, purely-functional programming language that compiles"""
41 <> """ to JavaScript. It can be used to develop web applications, server side apps, and al"""
42 <> """so desktop applications with use of Electron. Its syntax is mostly comparable to tha"""
43 <> """t of Haskell. In addition, it introduces row polymorphism and extensible records.[2]"""
44 <> """ Also, contrary to Haskell, PureScript adheres to a strict evaluation strategy."""