mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-01 19:09:01 +03:00
Add a helper for the close button
This commit is contained in:
parent
1c184d8179
commit
1eda22c565
@ -164,12 +164,7 @@ makeFocusManager settings =
|
||||
, Button.large
|
||||
, Button.custom [ modalOptions.autofocusElement ]
|
||||
]
|
||||
, ClickableText.button "Close"
|
||||
[ ClickableText.onClick ForceClose
|
||||
, ClickableText.large
|
||||
, ClickableText.custom modalOptions.lastFocusableElement
|
||||
, ClickableText.css [ Css.marginTop (Css.px 12) ]
|
||||
]
|
||||
, closeClickableText modalOptions.lastFocusableElement
|
||||
]
|
||||
}
|
||||
|
||||
@ -181,12 +176,7 @@ makeFocusManager settings =
|
||||
, viewModalContent settings.content
|
||||
]
|
||||
, footer =
|
||||
[ ClickableText.button "Close"
|
||||
[ ClickableText.onClick ForceClose
|
||||
, ClickableText.large
|
||||
, ClickableText.custom (modalOptions.autofocusElement :: modalOptions.lastFocusableElement)
|
||||
, ClickableText.css [ Css.marginTop (Css.px 12) ]
|
||||
]
|
||||
[ closeClickableText (modalOptions.autofocusElement :: modalOptions.lastFocusableElement)
|
||||
]
|
||||
}
|
||||
|
||||
@ -229,12 +219,7 @@ makeFocusManager settings =
|
||||
, Button.custom (modalOptions.autofocusElement :: modalOptions.firstFocusableElement)
|
||||
, Button.large
|
||||
]
|
||||
, ClickableText.button "Close"
|
||||
[ ClickableText.onClick ForceClose
|
||||
, ClickableText.large
|
||||
, ClickableText.custom modalOptions.lastFocusableElement
|
||||
, ClickableText.css [ Css.marginTop (Css.px 12) ]
|
||||
]
|
||||
, closeClickableText modalOptions.lastFocusableElement
|
||||
]
|
||||
}
|
||||
|
||||
@ -243,12 +228,7 @@ makeFocusManager settings =
|
||||
(\{ onlyFocusableElement } ->
|
||||
{ content = [ viewModalContent settings.content ]
|
||||
, footer =
|
||||
[ ClickableText.button "Close"
|
||||
[ ClickableText.onClick ForceClose
|
||||
, ClickableText.large
|
||||
, ClickableText.custom onlyFocusableElement
|
||||
, ClickableText.css [ Css.marginTop (Css.px 12) ]
|
||||
]
|
||||
[ closeClickableText onlyFocusableElement
|
||||
]
|
||||
}
|
||||
)
|
||||
@ -286,6 +266,16 @@ viewModalContent content =
|
||||
]
|
||||
|
||||
|
||||
closeClickableText : List (Html.Attribute Msg) -> Html Msg
|
||||
closeClickableText attributes =
|
||||
ClickableText.button "Close"
|
||||
[ ClickableText.onClick ForceClose
|
||||
, ClickableText.large
|
||||
, ClickableText.custom attributes
|
||||
, ClickableText.css [ Css.marginTop (Css.px 15) ]
|
||||
]
|
||||
|
||||
|
||||
{-| -}
|
||||
type Msg
|
||||
= OpenModal String
|
||||
|
Loading…
Reference in New Issue
Block a user