mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-09-21 04:07:54 +03:00
Adds linkExternal option
This commit is contained in:
parent
a4933a657d
commit
21b9966d77
@ -81,6 +81,7 @@ init =
|
|||||||
(Control.choice
|
(Control.choice
|
||||||
[ ( "button", Control.value Button )
|
[ ( "button", Control.value Button )
|
||||||
, ( "link", Control.value Link )
|
, ( "link", Control.value Link )
|
||||||
|
, ( "linkExternal", Control.value LinkExternal )
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|> Control.field "label" (Control.string "Clickable Text")
|
|> Control.field "label" (Control.string "Clickable Text")
|
||||||
@ -139,6 +140,7 @@ type alias Settings msg =
|
|||||||
type Type
|
type Type
|
||||||
= Button
|
= Button
|
||||||
| Link
|
| Link
|
||||||
|
| LinkExternal
|
||||||
|
|
||||||
|
|
||||||
{-| -}
|
{-| -}
|
||||||
@ -211,6 +213,16 @@ viewExamples ellieLinkConfig (State control) =
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
LinkExternal ->
|
||||||
|
[ { sectionName = "Link"
|
||||||
|
, code =
|
||||||
|
toCode "link"
|
||||||
|
[ Code.fromModule moduleName "linkExternal "
|
||||||
|
++ Code.string "https://www.google.com"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
, Heading.h2
|
, Heading.h2
|
||||||
[ Heading.plaintext "Customizable Example"
|
[ Heading.plaintext "Customizable Example"
|
||||||
@ -236,6 +248,12 @@ viewExamples ellieLinkConfig (State control) =
|
|||||||
(ClickableText.href "/"
|
(ClickableText.href "/"
|
||||||
:: List.map Tuple.second settings.attributes
|
:: List.map Tuple.second settings.attributes
|
||||||
)
|
)
|
||||||
|
|
||||||
|
LinkExternal ->
|
||||||
|
ClickableText.link settings.label
|
||||||
|
(ClickableText.linkExternal "https://www.google.com"
|
||||||
|
:: List.map Tuple.second settings.attributes
|
||||||
|
)
|
||||||
]
|
]
|
||||||
, Heading.h2
|
, Heading.h2
|
||||||
[ Heading.plaintext "Set Sizes Examples"
|
[ Heading.plaintext "Set Sizes Examples"
|
||||||
@ -395,7 +413,7 @@ sizeExamples settings =
|
|||||||
}
|
}
|
||||||
, Table.custom
|
, Table.custom
|
||||||
{ header = text "External link"
|
{ header = text "External link"
|
||||||
, view = \{ size } -> sizeExamplesFor ClickableText.link [ size, ClickableText.linkExternal "google.com" ]
|
, view = \{ size } -> sizeExamplesFor ClickableText.link [ size, ClickableText.linkExternal "https://www.google.com" ]
|
||||||
, width = Css.px 10
|
, width = Css.px 10
|
||||||
, cellStyles =
|
, cellStyles =
|
||||||
always
|
always
|
||||||
|
Loading…
Reference in New Issue
Block a user