5import Data.Maybe (Maybe(..), fromMaybe)
6import Data.Tuple.Nested ((/\))
9import MDXProvider (MdxProviderProps)
10import Milkis.Impl (FetchImpl)
11import React.Basic (ReactComponent)
12import React.Basic.DOM as R
13import React.Basic.Emotion as Emotion
14import React.Basic.Hooks (ReactChildren, element, reactComponentWithChildren, useState')
15import React.Basic.Hooks as React
16import Yoga ((/>), (</), (</*))
18import Yoga.Block as Block
19import Yoga.Block.Atom.Toggle.Types (TogglePosition(..))
20import Yoga.Block.Container as Container
21import Yoga.Block.Container.Style (DarkOrLightMode(..), colour)
22import Yoga.Block.Icon.SVG as Icon
23import Yoga.Block.Internal (_0)
24import Yoga.Block.Modal as Modal
29 , menuLinks ∷ Array { name ∷ String, link ∷ String }
34 = ShowModal Modal.Props
41 { children ∷ ReactChildren MDX
42 , siteInfo ∷ SiteQueryResult
43 , mdxProviderComponent ∷ ReactComponent MdxProviderProps
46mkLayout fetchImpl = do
47 reactComponentWithChildren "MDXLayout" \{ children, siteInfo, mdxProviderComponent } -> React.do
48 darkOrLightMode /\ setDarkOrLightMode <- useState' Nothing
49 togglePosition /\ setTogglePosition <- useState' ToggleIsLeft
51 themeToMaybeTogglePosition =
54 DarkMode -> ToggleIsRight
55 LightMode -> ToggleIsLeft
59 { className: "dark-light-toggle"
62 { marginRight: Emotion.str "0"
63 , marginLeft: Emotion.str "auto"
67 ToggleIsLeft -> setDarkOrLightMode (Just LightMode)
68 ToggleIsRight -> setDarkOrLightMode (Just DarkMode)
69 , togglePosition: themeToMaybeTogglePosition # fromMaybe togglePosition
74 , stroke: Emotion.str "#eef"
80 , stroke: Emotion.str "yellow"
83 Color.hsl 205.0 1.0 0.80
85 Color.hsl 250.0 1.0 0.1
86 , ariaLabel: "Use dark mode"
90 </ { className: "top-box"
93 { background: Emotion.str colour.background
97 </* { justify: "space-between"
100 , css: Emotion.css { width: Emotion.percent 100.0 }
105 { className: "blog-header"
108 { fontSize: Emotion.str "min(var(--s3), calc(var(--s1) + 1vw))"
109 , textTransform: Emotion.str "uppercase"
110 , letterSpacing: Emotion.str "calc(min(var(--s0) + 3vw), var(--s2) * -1.7)"
111 , fontWeight: Emotion.str "300"
112 , color: Emotion.str colour.text
115 [ R.text siteInfo.siteMetadata.title ]
120 $ element Container.component
121 { themeVariant: darkOrLightMode
122 , onPreferredSystemThemeChange:
124 LightMode -> setTogglePosition ToggleIsLeft
125 DarkMode -> setTogglePosition ToggleIsRight
128 { className: "blog-content"
133 { minHeight: Emotion.vh 100.0
134 , background: Emotion.str colour.background
135 , borderRadius: Emotion.str "0 var(--s1) var(--s1) 0"
140 </* { className: "centre"
145 { maxWidth: Emotion.ch 90.0
146 , fontSize: Emotion.str "calc( min( (var(--s-1) * 1.7) + 0.7vw , var(--s0)*1.1 ) )"
151 { padding: Emotion.px 16
154 { "& > p:first-of-type":
157 { minHeight: Emotion.str "min(calc(var(--s-1) + 2px + 3vw), var(--s3))"
161 { overflow: Emotion.str "visible"
162 , display: Emotion.inlineBlock
163 , float: Emotion.str "left"
164 , fontSize: Emotion.str "min(calc(var(--s0) * 1 + 8.03vw), var(--s5))"
165 , fontFamily: Emotion.str "Cormorant Garamond"
166 , lineHeight: Emotion.str "min(calc(var(--s-1) + 2px + 3vw), var(--s3))"
167 , marginTop: Emotion.str "min(calc(var(--s-1) + 1.5vw), var(--s2))"
168 , marginRight: Emotion.var "--s-2"
173 /> [ element mdxProviderComponent { children } ]
176 { className: "blog-footer"
179 { background: Emotion.str colour.backgroundLayer1
180 , borderTop: Emotion.str $ "1px solid " <> colour.backgroundLayer3
181 , color: Emotion.str colour.text
184 [ R.text "Mark Eibes" ]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list