mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-19 19:51:37 +03:00
Merge pull request #875 from NoRedInk/bat/standardize-balloon
Bat/standardize balloon
This commit is contained in:
commit
128a7fe765
@ -7,12 +7,11 @@ module Examples.Balloon exposing (example, State, Msg)
|
|||||||
-}
|
-}
|
||||||
|
|
||||||
import Category exposing (Category(..))
|
import Category exposing (Category(..))
|
||||||
import Css
|
|
||||||
import Debug.Control as Control exposing (Control)
|
import Debug.Control as Control exposing (Control)
|
||||||
import Debug.Control.Extra as ControlExtra
|
import Debug.Control.Extra as ControlExtra
|
||||||
|
import Debug.Control.View as ControlView
|
||||||
import Example exposing (Example)
|
import Example exposing (Example)
|
||||||
import Html.Styled exposing (Html, fromUnstyled, text)
|
import Html.Styled exposing (Html, fromUnstyled, text)
|
||||||
import Html.Styled.Attributes exposing (css)
|
|
||||||
import Nri.Ui.Balloon.V1 as Balloon
|
import Nri.Ui.Balloon.V1 as Balloon
|
||||||
|
|
||||||
|
|
||||||
@ -130,20 +129,25 @@ view state =
|
|||||||
let
|
let
|
||||||
copy =
|
copy =
|
||||||
Control.currentValue state.copy
|
Control.currentValue state.copy
|
||||||
|
|
||||||
attributes =
|
|
||||||
Control.currentValue state.attributes
|
|
||||||
in
|
in
|
||||||
[ Control.view SetCopy state.copy |> fromUnstyled
|
[ Control.view SetCopy state.copy |> fromUnstyled
|
||||||
, Control.view SetAttributes state.attributes |> fromUnstyled
|
, ControlView.view
|
||||||
, Html.Styled.code [ css [ Css.display Css.block, Css.margin2 (Css.px 20) Css.zero ] ]
|
{ update = SetAttributes
|
||||||
[ text <|
|
, settings = state.attributes
|
||||||
"Balloon.balloon [ "
|
, toExampleCode =
|
||||||
++ String.join ", " (List.map Tuple.first attributes)
|
\attrs ->
|
||||||
++ " ] "
|
[ { sectionName = "Balloon"
|
||||||
++ "\""
|
, code =
|
||||||
++ copy
|
"Balloon.balloon\n [ "
|
||||||
++ "\""
|
++ String.join "\n , " (List.map Tuple.first attrs)
|
||||||
]
|
++ "\n ] "
|
||||||
, Balloon.balloon (List.map Tuple.second attributes) (text copy)
|
++ "\n (text \""
|
||||||
|
++ copy
|
||||||
|
++ "\")"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
, Balloon.balloon
|
||||||
|
(List.map Tuple.second (Control.currentValue state.attributes))
|
||||||
|
(text copy)
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user