Skip to content

Commit 5b4cf52

Browse files
fix: resolve image and font access, improve render, use new Trunk
1 parent e995af7 commit 5b4cf52

9 files changed

Lines changed: 33 additions & 83 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ browser-panic-hook = "0.2"
1313
chrono = { version = "0.4.30", default-features = false, features = ["wasmbind"] }
1414
gloo-utils = "0.2"
1515
log = "0.4"
16-
patternfly-yew = { version = "0.7", features = ["tree", "icons-fab"] }
16+
patternfly-yew = { version = "0.7.3", features = ["tree", "icons-fab"] }
1717
popper-rs = { version = "0.4", features = ["yew", "debug"] }
1818
serde_json = "1"
1919
strum = { version = "0.27", features = ["derive"] }

assets/initializer.mjs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ export default function initializer() {
55
console.time("trunk-initializer");
66

77
document.body.insertAdjacentHTML("afterbegin", `
8-
<div class="pf-v5-l-bullseye">
9-
<div class="pf-v5-l-bullseye__item" style="width: 50%;">
10-
<div id="initializer" class="pf-v5-c-progress">
8+
<div class="pf-v6-l-bullseye">
9+
<div class="pf-v6-l-bullseye__item" style="width: 50%;">
10+
<div id="initializer" class="pf-v6-c-progress">
1111
<div
12-
class="pf-v5-c-progress__description"
12+
class="pf-v6-c-progress__description"
1313
id="initializerState"
1414
>Loading</div>
15-
<div id="initializerStatus" class="pf-v5-c-progress__status" aria-hidden="true">
16-
<span id="initializerLabel" class="pf-v5-c-progress__measure">0%</span>
15+
<div id="initializerStatus" class="pf-v6-c-progress__status" aria-hidden="true">
16+
<span id="initializerLabel" class="pf-v6-c-progress__measure">0%</span>
1717
</div>
1818
<div
19-
class="pf-v5-c-progress__bar"
19+
class="pf-v6-c-progress__bar"
2020
id="initializerBar"
2121
role="progressbar"
2222
aria-valuemin="0"
2323
aria-valuemax="100"
2424
aria-valuenow="0"
2525
aria-labelledby="progress-simple-example-description"
2626
>
27-
<div id="initializerValue" class="pf-v5-c-progress__indicator" style="width:0;"></div>
27+
<div id="initializerValue" class="pf-v6-c-progress__indicator" style="width:0;"></div>
2828
</div>
2929
</div>
30-
<div id="initializerHelper" class="pf-v5-c-progress__helper-text pf-m-hidden">
31-
<div class="pf-v5-c-helper-text">
32-
<div class="pf-v5-c-helper-text__item">
33-
<span id="initializerHelperText" class="pf-v5-c-helper-text__item-text"></span>
30+
<div id="initializerHelper" class="pf-v6-c-progress__helper-text pf-m-hidden">
31+
<div class="pf-v6-c-helper-text">
32+
<div class="pf-v6-c-helper-text__item">
33+
<span id="initializerHelperText" class="pf-v6-c-helper-text__item-text"></span>
3434
</div>
3535
</div>
3636
</div>
@@ -93,7 +93,7 @@ function setState(value, helperText) {
9393
}
9494
const status = document.getElementById("initializerStatus");
9595
status.innerHTML = `
96-
<span class="pf-v5-c-progress__status-icon">
96+
<span class="pf-v6-c-progress__status-icon">
9797
<i class="fas fa-fw fa-times-circle" aria-hidden="true"></i>
9898
</span>
9999
`;

assets/style.scss

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
// only required if you are using the icons-far or icons-fab feature
22
// $fa-font-path: "webfonts";
3-
@import "../node_modules/@fortawesome/fontawesome-free/scss/fontawesome";
4-
@import "../node_modules/@fortawesome/fontawesome-free/scss/brands";
3+
@import "../target/node_modules/@fortawesome/fontawesome-free/7.1.0/scss/fontawesome";
4+
@import "../target/node_modules/@fortawesome/fontawesome-free/7.1.0/scss/brands";
55

66
// PatternFly styles
7-
@import "../node_modules/@patternfly/patternfly/patternfly.scss";
8-
@import "../node_modules/@patternfly/patternfly/patternfly-addons.scss";
7+
@import "../target/node_modules/@patternfly/patternfly/6.4.0/patternfly.scss";
8+
@import "../target/node_modules/@patternfly/patternfly/6.4.0/patternfly-addons.scss";
9+
10+
@font-face {
11+
font-family: "Font Awesome 7 Brands";
12+
font-style: normal;
13+
font-weight: 400;
14+
font-display: block;
15+
src: url("./webfonts/fa-brands-400.woff2");
16+
}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
<link data-trunk rel="scss" href="assets/style.scss">
1414
<!-- This path needs to be here, otherwise icons won't render correctly -->
15-
<link data-trunk rel="copy-dir" href="node_modules/@patternfly/patternfly/assets" data-target-path="assets/">
15+
<link data-trunk rel="copy-dir" href="target/node_modules/@patternfly/patternfly/6.4.0/assets" data-target-path="assets/">
1616
<link data-trunk rel="copy-dir" href="assets/images">
1717

1818
<!-- include when using the icons-far or icons-fab feature -->
1919
<!-- also requires includes in the assets/styles.scss file -->
20-
<link data-trunk rel="copy-dir" href="node_modules/@fortawesome/fontawesome-free/webfonts">
20+
<link data-trunk rel="copy-dir" href="target/node_modules/@fortawesome/fontawesome-free/7.1.0/webfonts">
2121

2222
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-initializer="assets/initializer.mjs"/>
2323

package-lock.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/app/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ fn page(props: &PageProps) -> Html {
525525
<MastheadBrand>
526526
<div className="show-light">
527527
<Brand
528-
src="/images/pf-logo.svg"
528+
src="./images/pf-logo.svg"
529529
alt="Patternfly Logo"
530530
style="--pf-v6-c-brand--Height: 36px;"
531531
/>
@@ -600,5 +600,5 @@ fn page(props: &PageProps) -> Html {
600600
</Toolbar>
601601
);
602602

603-
html! (<Page {brand} {sidebar} {tools}>{ for props.children.iter() }</Page>)
603+
html! (<Page {brand} {sidebar} {tools} full_height=true>{ for props.children.iter() }</Page>)
604604
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
html!(
2-
<Brand src="/images/pf-logo.svg" alt="PatternFly logo" />
2+
<Brand src="./images/pf-logo.svg" alt="PatternFly logo" />
33
)

0 commit comments

Comments
 (0)