-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump version of spor-icon-elm in spor-elm #777
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,15 +24,13 @@ import Css exposing (Color, Style) | |
import Css.Global | ||
import Html.Styled as Html exposing (Html) | ||
import Html.Styled.Attributes as Attributes | ||
import Spor.Icon.Feedback as Feedback | ||
import Spor.Icon as Icon | ||
import Spor.LineTag.LineIcon as LineIcon | ||
import Spor.LineTag.LineText as LineText | ||
import Spor.LineTag.Types exposing (DeviationLevel(..), Size(..), Variant(..)) | ||
import Spor.Token.Color.Alias as Alias | ||
import Spor.Token.Color.Linjetag as Linjetag | ||
import Spor.Token.Size.Spacing as Spacing | ||
import Svg.Styled as Svg | ||
import Svg.Styled.Attributes as SvgAttributes | ||
|
||
|
||
{-| A component for displaying travel tags | ||
|
@@ -267,22 +265,27 @@ backgroundColor variant = | |
|
||
deviationIcon : Maybe DeviationLevel -> Html msg | ||
deviationIcon maybeDeviationLevel = | ||
let | ||
feedbackIcon type_ = | ||
Icon.icon Icon.Size18 Icon.Fill type_ | ||
in | ||
case maybeDeviationLevel of | ||
Just deviationLevel -> | ||
Html.span | ||
[ Attributes.css [ deviationStyle deviationLevel ] ] | ||
[ case deviationLevel of | ||
Critical -> | ||
Svg.fromUnstyled <| Feedback.errorFill18X18 [] | ||
[ Icon.toHtml <| | ||
case deviationLevel of | ||
Critical -> | ||
feedbackIcon Icon.Error | ||
|
||
Major -> | ||
warningFill18x18 | ||
Major -> | ||
feedbackIcon Icon.Warning | ||
|
||
Minor -> | ||
warningFill18x18 | ||
Minor -> | ||
feedbackIcon Icon.Warning | ||
|
||
Info -> | ||
Svg.fromUnstyled <| Feedback.informationFill18X18 [] | ||
Info -> | ||
feedbackIcon Icon.Information | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Her kan vi fjerne feedbackIcon fra alle casene og heller sette foran case-statementen. E.g. feedbackIcon <| case deviationLevel of
... |
||
] | ||
|
||
Nothing -> | ||
|
@@ -335,34 +338,6 @@ deviationStyle deviationLevel = | |
] | ||
|
||
|
||
warningFill18x18 : Html msg | ||
warningFill18x18 = | ||
Svg.svg | ||
[ SvgAttributes.width "18" | ||
, SvgAttributes.height "18" | ||
, SvgAttributes.fill "none" | ||
, SvgAttributes.stroke "#fff" | ||
, Attributes.attribute "stroke-width" "2" | ||
, Attributes.attribute "paint-order" "stroke" | ||
] | ||
[ Svg.path | ||
[ SvgAttributes.fillRule "evenodd" | ||
, SvgAttributes.clipRule "evenodd" | ||
, SvgAttributes.d "M7.897 1.506a1.25 1.25 0 0 1 2.206 0l6.75 12.656A1.25 1.25 0 0 1 15.75 16H2.25a1.25 1.25 0 0 1-1.103-1.838l6.75-12.656ZM9 6a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0v-4A.5.5 0 0 1 9 6Zm.625 6.375a.625.625 0 1 1-1.25 0 .625.625 0 0 1 1.25 0Z" | ||
, SvgAttributes.fill "#E5A80C" | ||
] | ||
[] | ||
, Svg.path | ||
[ SvgAttributes.fillRule "evenodd" | ||
, SvgAttributes.clipRule "evenodd" | ||
, SvgAttributes.d "M9.5 6.5a.5.5 0 0 0-1 0v4a.5.5 0 0 0 1 0v-4ZM9 13a.625.625 0 1 0 0-1.25A.625.625 0 0 0 9 13Z" | ||
, SvgAttributes.fill "#2B2B2C" | ||
, SvgAttributes.stroke "none" | ||
] | ||
[] | ||
] | ||
|
||
|
||
deviationBorderStyle : Maybe DeviationLevel -> Style | ||
deviationBorderStyle maybeDeviationLevel = | ||
case maybeDeviationLevel of | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hva med å lage en sizeToIconSize i let...in, så kan man i stedet si
osv..? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvis et case også har unikt ikon for sin variant kan egentlig ikonfunksjone bare ligge i den casen også!