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