Created
April 1, 2019 13:39
-
-
Save ianmackenzie/bbe070d3c10bb96f030f268917359ec0 to your computer and use it in GitHub Desktop.
elm-ui bullets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (main) | |
import Element exposing (Element) | |
import Html exposing (Html) | |
type Bullet | |
= Bullet String (List Bullet) | |
bullet : Bullet | |
bullet = | |
Bullet "UPSC" | |
[ Bullet "Essay" | |
[ Bullet "If progress is not engendered it will be" [] | |
, Bullet "Poverty is worst form of violence" [] | |
, Bullet "blockchain and corruption" | |
[ Bullet "beneficiary verified public registries to" [] | |
, Bullet "corruption is often related to delayed or" [] | |
] | |
, Bullet "you can learn anything from anywhere" | |
[ Bullet "history" [] | |
, Bullet "Israel - water scarce - learn importance" [] | |
] | |
] | |
] | |
viewBullet : Bullet -> Element msg | |
viewBullet (Bullet text children) = | |
Element.row [ Element.spacing 12 ] | |
[ Element.el [ Element.alignTop ] (Element.text "•") | |
, Element.column [ Element.spacing 6 ] (Element.text text :: List.map viewBullet children) | |
] | |
main : Html Never | |
main = | |
Element.layout [] (viewBullet bullet) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment