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 style ./style
|
||||
|
||||
# Build for release.
|
||||
RUN trunk build --release
|
||||
# Build for preview release.
|
||||
RUN NC_BETA_BUILD="" trunk build --release
|
||||
|
||||
FROM nginx:latest
|
||||
|
||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -5,6 +5,7 @@ mod topbar;
|
|||
use anyhow::Result;
|
||||
use backend::Session;
|
||||
use content::{about::About, error, home::Home};
|
||||
use gloo::dialogs::alert;
|
||||
use std::ops::Deref;
|
||||
use topbar::TopBar;
|
||||
use yew::prelude::*;
|
||||
|
@ -47,13 +48,11 @@ fn App() -> Html {
|
|||
|
||||
let cloned_state = state.clone();
|
||||
let callbacks = use_state(move || Callbacks {
|
||||
sign_in: Callback::from(
|
||||
move |token: String| {
|
||||
sign_in: Callback::from(move |token: String| {
|
||||
let mut new_state = cloned_state.deref().clone();
|
||||
new_state.set_token(token);
|
||||
cloned_state.set(new_state);
|
||||
},
|
||||
),
|
||||
}),
|
||||
});
|
||||
|
||||
html! {
|
||||
|
@ -71,5 +70,8 @@ fn App() -> Html {
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue