feat: added a beta preview alert
This commit is contained in:
parent
039cff2f2a
commit
21a3b81044
|
@ -14,8 +14,8 @@ COPY Cargo.lock Cargo.toml index.html ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY style ./style
|
COPY style ./style
|
||||||
|
|
||||||
# Build for release.
|
# Build for preview release.
|
||||||
RUN trunk build --release
|
RUN NC_BETA_BUILD="" trunk build --release
|
||||||
|
|
||||||
FROM nginx:latest
|
FROM nginx:latest
|
||||||
|
|
||||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -5,6 +5,7 @@ mod topbar;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use backend::Session;
|
use backend::Session;
|
||||||
use content::{about::About, error, home::Home};
|
use content::{about::About, error, home::Home};
|
||||||
|
use gloo::dialogs::alert;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use topbar::TopBar;
|
use topbar::TopBar;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
@ -47,13 +48,11 @@ fn App() -> Html {
|
||||||
|
|
||||||
let cloned_state = state.clone();
|
let cloned_state = state.clone();
|
||||||
let callbacks = use_state(move || Callbacks {
|
let callbacks = use_state(move || Callbacks {
|
||||||
sign_in: Callback::from(
|
sign_in: Callback::from(move |token: String| {
|
||||||
move |token: String| {
|
let mut new_state = cloned_state.deref().clone();
|
||||||
let mut new_state = cloned_state.deref().clone();
|
new_state.set_token(token);
|
||||||
new_state.set_token(token);
|
cloned_state.set(new_state);
|
||||||
cloned_state.set(new_state);
|
}),
|
||||||
},
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
html! {
|
html! {
|
||||||
|
@ -71,5 +70,8 @@ fn App() -> Html {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
if option_env!("NC_BETA_BUILD").is_some() {
|
||||||
|
alert("This is a beta preview!\nThe UI and the backend are subjects to change. Data persistence can't be guaranteed.");
|
||||||
|
}
|
||||||
yew::Renderer::<App>::new().render();
|
yew::Renderer::<App>::new().render();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue