mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-04 12:47:53 +03:00
💀 remove the useSpa control
This commit is contained in:
parent
3a4d3d6faa
commit
2f20f05bff
@ -13,9 +13,10 @@ module Examples.SegmentedControl exposing
|
|||||||
import Accessibility.Styled as Html exposing (Html)
|
import Accessibility.Styled as Html exposing (Html)
|
||||||
import AtomicDesignType exposing (AtomicDesignType(..))
|
import AtomicDesignType exposing (AtomicDesignType(..))
|
||||||
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 Example exposing (Example)
|
import Example exposing (Example)
|
||||||
import Html.Styled.Attributes as Attr
|
import Html.Styled.Attributes as Attributes exposing (css)
|
||||||
import Html.Styled.Events as Events
|
import Html.Styled.Events as Events
|
||||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||||
import Nri.Ui.Colors.V1 as Colors
|
import Nri.Ui.Colors.V1 as Colors
|
||||||
@ -39,21 +40,22 @@ example =
|
|||||||
in
|
in
|
||||||
[ Control.view ChangeOptions state.optionsControl
|
[ Control.view ChangeOptions state.optionsControl
|
||||||
|> Html.fromUnstyled
|
|> Html.fromUnstyled
|
||||||
|
, Html.h3 [ css [ Css.marginBottom Css.zero ] ]
|
||||||
|
[ Html.code [] [ Html.text "view" ] ]
|
||||||
|
, Html.p [ css [ Css.marginTop (Css.px 1) ] ]
|
||||||
|
[ Html.text "Use when you need a page control." ]
|
||||||
, SegmentedControl.view
|
, SegmentedControl.view
|
||||||
{ onClick = SelectNav
|
{ onClick = SelectNav
|
||||||
, options = buildOptions "Choice " options (List.range 1 options.count) coloredIcons
|
, options = buildOptions "Choice " options (List.range 1 options.count) coloredIcons
|
||||||
, selected = state.selectedNav
|
, selected = state.selectedNav
|
||||||
, width = options.width
|
, width = options.width
|
||||||
, content = Html.text ("[Content for " ++ Debug.toString state.selectedNav ++ "]")
|
, content = Html.text ("[Content for " ++ Debug.toString state.selectedNav ++ "]")
|
||||||
, toUrl =
|
, toUrl = Just String.fromInt
|
||||||
if options.useSpa then
|
|
||||||
Just String.fromInt
|
|
||||||
|
|
||||||
else
|
|
||||||
Nothing
|
|
||||||
}
|
}
|
||||||
, Html.h3 [] [ Html.text "Select only view" ]
|
, Html.h3 [ css [ Css.marginBottom Css.zero ] ]
|
||||||
, Html.p [] [ Html.text "Used when you only need the ui element and not a page control." ]
|
[ Html.code [] [ Html.text "viewSelect" ] ]
|
||||||
|
, Html.p [ css [ Css.marginTop (Css.px 1) ] ]
|
||||||
|
[ Html.text "Use when you only need the ui element." ]
|
||||||
, SegmentedControl.viewSelect
|
, SegmentedControl.viewSelect
|
||||||
{ onClick = MaybeSelect
|
{ onClick = MaybeSelect
|
||||||
, options = buildOptions "Source " options (List.range 1 options.count) plainIcons
|
, options = buildOptions "Source " options (List.range 1 options.count) plainIcons
|
||||||
@ -135,7 +137,6 @@ init =
|
|||||||
type alias Options =
|
type alias Options =
|
||||||
{ width : SegmentedControl.Width
|
{ width : SegmentedControl.Width
|
||||||
, icon : Bool
|
, icon : Bool
|
||||||
, useSpa : Bool
|
|
||||||
, count : Int
|
, count : Int
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,12 +151,6 @@ optionsControl =
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|> Control.field "icon" (Control.bool False)
|
|> Control.field "icon" (Control.bool False)
|
||||||
|> Control.field "which view function"
|
|
||||||
(Control.choice
|
|
||||||
[ ( "view", Control.value False )
|
|
||||||
, ( "viewSpa", Control.value True )
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|> Control.field "count"
|
|> Control.field "count"
|
||||||
(Control.choice
|
(Control.choice
|
||||||
(List.map (\i -> ( String.fromInt i, Control.value i )) (List.range 2 8))
|
(List.map (\i -> ( String.fromInt i, Control.value i )) (List.range 2 8))
|
||||||
|
Loading…
Reference in New Issue
Block a user