Add sidebar component#177
Conversation
|
Preview available at https://dioxuslabs.github.io/components/pr-preview/pr-177/ |
ealmloff
left a comment
There was a problem hiding this comment.
Thanks for working on this, the sidebar itself mostly looks right, but some of these changes will make the components harder to maintain in the long run.
Adding as everywhere is useful, but makes the attributes significantly harder to maintain. I would rather add support for some of this in core. An attributes macro that accepts the same syntax as the element body but expands to Vec<Attribut> would make this a lot easier to maintain:
attributes!{
width: 100,
onclick,
}This will also need some playright tests for the sidebar behavior before it can be merged
e0c3613 to
af5011d
Compare
9e0b4e7 to
673dd63
Compare
|
@ealmloff sidebar has done some optimization and added playwright test now. I keep the sheet/sidebar separation for the reason I replied. There is still a Clippy check errors about For the inscaleble |
|
It might make sense to upstream into dioxus itself at some point, but for now the macro is fine in the component library. As a slightly odd consequence of how we type check attributes, you still need to put the element name you expect to spread into |
ealmloff
left a comment
There was a problem hiding this comment.
Sorry it took so long to get to this. I would like to move some of this logic into core eventually, but the component itself looks great!
related: #160
A new
sidebarcomponent is added with followed changes:r#asandmerged_attributein multiple componentsprimitive/lib.rs, addmeged_attributefor component withr#as, handle class/props of component(TODO: event handler)collapsible,tooltip,dropdown_menuseparatorgapin dropdown menu itemSidebarProviderand othersuse_sidebarhookuse_is_mobilehook (considering the right position in a shared module)playwright test)preview/src/main.rs,preview/src/mod.rsto allow block component display, by:- 2.1 extend
example!macro- 2.2 add Route and component for block component, implement isolate envrionment by
iframe(Only work in web platform now, notDesktop supported)- 2.3 refactoring
theme sync, addtheme.rsby set theme cookies and sychronize theme change across mutilple iframe byBroadcastChannel- 2.4 extractor html (--dark/--light) logic from
main.csstodx-component-theme.csslacks:
Big changes with
r#asin others component, sry about that