-
Notifications
You must be signed in to change notification settings - Fork 4
[WIP] Add Banner component #112
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
Conversation
} | ||
|
||
actionBanner :: Array JSX -> PropsModifier BannerProps | ||
actionBanner actions f = |
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.
I wonder if this would be better as a LumiComponent
instead of a PropsModifier
.
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.
This does seem like a strange way to use it.. hmm
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.
Yeah, I think so too. Would you prefer having it as a LumiComponent
?
data Banner = Banner | ||
|
||
type BannerProps = | ||
( component :: Banner |
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.
We don't export the single constructor of the Banner
data type so a banner can be identified in a PropsModifier
as forall props. PropsModifier (component :: Banner | props)
.
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.
This is an interesting idea, but I'm not sure it's really necessary.
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.
It is necessary if actionBanner
is a LumiComponent
, so that we can apply all of the modifiers that work on banner
on it too.
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.
I'm not sure I follow.. wouldn't it work on any component with the same prop shape?
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.
Yes, but actionBanner
wouldn't have the same prop shape as banner
if it were a LumiComponent
:
type BannerProps =
( dismissable :: Boolean
, content :: Array JSX
)
type ActionBannerProps =
( dismissable :: Boolean
, actions :: Array JSX
, content :: Array JSX
)
data Banner = Banner | ||
|
||
type BannerProps = | ||
( component :: Banner |
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.
This is an interesting idea, but I'm not sure it's really necessary.
} | ||
|
||
actionBanner :: Array JSX -> PropsModifier BannerProps | ||
actionBanner actions f = |
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.
This does seem like a strange way to use it.. hmm
, desktopQuery $ css | ||
{ padding: str "12px 24px" | ||
} | ||
] |
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.
Nice, this api really shines here
src/Lumi/Styles/Responsive.purs
Outdated
{ "@media (min-width: 860px)": nested style | ||
} | ||
|
||
onDesktop :: forall props. PropsModifier () -> PropsModifier props |
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.
Should props
be passed to both of these types, or props1
and props2
? The empty row seems restrictive.
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.
We can't have an open row here, otherwise we wouldn't be able to apply the argument to the props set, because we don't know what it is. It's not restrictive given that this should only work for styles anyway, and style modifiers are always forall props. PropsModifier props
.
f96fc10
to
f2bf70e
Compare
Closing this since the work is being done in #143 now |
No description provided.