Skip to content

Commit

Permalink
refactor: change to new menu api, use new popper crate
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Jul 21, 2023
1 parent 2ef5ab8 commit c625dca
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 100 deletions.
75 changes: 49 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ repository = "https://github.com/ctron/patternfly-yew-quickstart"

[dependencies]
browser-panic-hook = "0.2"
chrono = { version = "0.4", default-features = false, features = ["wasmbind"] }
chrono = { version = "0.4.26", default-features = false, features = ["wasmbind"] }
gloo-utils = "0.1"
log = "0.4"
patternfly-yew = { version = "0.5.0-alpha.2", features = ["icons-fab", "tree"] }
popper-rs = { version = "0.1.0-alpha.3", features = ["yew"] }
serde_json = "1"
strum = "0.25"
wasm-bindgen = "0.2"
Expand All @@ -32,11 +33,12 @@ features = [
]

[patch.crates-io]
#patternfly-yew = { path = "../patternfly-yew" }
patternfly-yew = { git = "https://github.com/ctron/patternfly-yew", rev = "5ba924c4419bc2d196821cba0f6adeef052f86cf" } # FIXME: awaiting release
patternfly-yew = { path = "../patternfly-yew" }
#patternfly-yew = { git = "https://github.com/ctron/patternfly-yew", rev = "b13c34c00fce5da61cbfa7a6a36d30e03d7420ed" } # FIXME: awaiting release
#yew-nested-router = { path = "../yew-nested-router" }
#yew-more-hooks = { git = "https://github.com/ctron/yew-more-hooks", rev = "9f39517aabe25cfadae48f2d225daa1c3a608c20" } # FIXME: awaiting release
#yew-more-hooks = { path = "../yew-more-hooks" }
popper-rs = { git = "https://github.com/ctron/popper-rs", rev = "f23e1960f792ed3d1ce597a1f4ded661f72ee903" }

# release profile settings to reduce the final binary size
[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ fn page(props: &PageProps) -> Html {
icon={Icon::QuestionCircle}
variant={MenuToggleVariant::Plain}
>
<MenuAction onclick={onabout} text="About" />
<MenuAction onclick={onabout}>{"About"}</MenuAction>
</Dropdown>
</ToolbarItem>
</ToolbarGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/components/dropdown/dropdown.1.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ html!(
<Dropdown
text="Foo"
>
<MenuAction text="Foo" onclick={ctx.link().callback(|_|Msg::ShowToast("Clicked Foo".into()))} />
<MenuAction onclick={ctx.link().callback(|_|Msg::ShowToast("Clicked Foo".into()))}>{"Foo"}</MenuAction>
<ListDivider/>
<MenuAction text="Bar" onclick={ctx.link().callback(|_|Msg::ShowToast("Clicked Bar".into()))} />
<MenuAction icon={Icon::Cubes} onclick={ctx.link().callback(|_|Msg::ShowToast("Clicked Bar".into()))}>{"Bar"}</MenuAction>
<ListDivider/>
<MenuLink text="PatternFly" icon={Icon::ExternalLinkAlt} href="https://patternfly.org" target="_blank" />
<MenuLink href="https://patternfly.org" target="_blank">{"PatternFly"} {Icon::ExternalLinkAlt}</MenuLink>
</Dropdown>
)
}
4 changes: 2 additions & 2 deletions src/components/dropdown/dropdown.2.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ html!(
variant={MenuToggleVariant::Plain}
icon={Icon::EllipsisV}
>
<MenuAction text="Foo" />
<MenuAction>{"Foo"}</MenuAction>
<ListDivider/>
<MenuAction text="Bar"/>
<MenuAction>{"Bar"}</MenuAction>
</Dropdown>
)
}
6 changes: 3 additions & 3 deletions src/components/dropdown/dropdown.3.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ html!{
</div>
</div>
</Raw>
<MenuAction text="Foo" />
<MenuAction>{"Foo"}</MenuAction>
</MenuGroup>
<ListDivider/>
<MenuGroup title="Group 1">
<MenuAction text="Bar" />
<MenuAction text="Foo" />
<MenuAction>{"Bar"}</MenuAction>
<MenuAction>{"Foo"}</MenuAction>
</MenuGroup>
</Dropdown>
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/hint/hint.1.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
position={Position::Right}
variant={MenuToggleVariant::Plain}
>
<MenuAction text="Link" key="link" />
<MenuAction text="Action" key="action" />
<MenuAction key="link">{ "Link" }</MenuAction>
<MenuAction key="action">{ "Action" }</MenuAction>
<ListDivider />
<MenuAction text="Separated Link" key="separated link" />
<MenuAction text="Separated Action" key="separated action" />
<MenuAction key="separated link">{ "Separated Link" }</MenuAction>
<MenuAction key="separated action">{ "Separated Action" }</MenuAction>
</Dropdown>
};

Expand Down
10 changes: 5 additions & 5 deletions src/components/menu/menu.2.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
html!(
<Menu>
<MenuAction text="Action" />
<MenuLink text="Link" href="/" />
<MenuAction text="Action (disabled)" disabled=true />
<MenuLink text="Link (disabled)" disabled=true href="/" />
<MenuAction >{ "Action" }</MenuAction>
<MenuLink href="/">{ "Link" }</MenuLink>
<MenuAction disabled=true>{ "Action (disabled)" }</MenuAction>
<MenuLink disabled=true href="/">{ "Link (disabled)" }</MenuLink>
<ListDivider />
<MenuAction text="Action" danger=true />
<MenuAction danger=true>{ "Action" }</MenuAction>
</Menu>
)
Loading

0 comments on commit c625dca

Please sign in to comment.