Skip to content

Commit

Permalink
Merge pull request #25 from ealmloff/fullstack-liveview-lowercase
Browse files Browse the repository at this point in the history
make fullstack and liveview lowercase everywhere
  • Loading branch information
mrxiaozhuox authored Jan 28, 2024
2 parents a787958 + 1d520cc commit 7a9ca1d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
{% if platform == "Liveview" %}
{% if platform == "liveview" %}
dioxus = { version = "0.4" }
tokio = { version = "1.27.0", features = ["full"] }
{% if backend == "Axum" %}
Expand Down Expand Up @@ -35,7 +35,7 @@ dioxus = { version = "0.4" }
dioxus-tui = { version = "0.4" }
dioxus = { version = "0.4" }
{% endif %}
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
{% if router %}
dioxus-fullstack = { version = "0.4", features = ["router"] }
{% else %}
Expand All @@ -59,7 +59,7 @@ dioxus-logger = "0.4.1"
console_error_panic_hook = "0.1.7"
{% endif %}

{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
[features]
default = []
{% if backend == "Axum" %}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dx serve --hot-reload

- Open the browser to http://localhost:8080
{% else %}
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
Launch the Dioxus Fullstack app:

```bash
Expand Down
8 changes: 4 additions & 4 deletions cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ prompt = "What platform are you targeting?"
choices = ["web", "fullstack", "desktop", "liveview", "TUI"]
default = "web"

[conditional.'platform == "Liveview"'.placeholders.backend]
[conditional.'platform == "liveview"'.placeholders.backend]
type = "string"
prompt = "What backend framework are you using?"
choices = ["Axum", "Warp", "Salvo"]
default = "Axum"

[conditional.'platform == "Fullstack"'.placeholders.backend]
[conditional.'platform == "fullstack"'.placeholders.backend]
type = "string"
prompt = "What backend framework are you using?"
choices = ["Axum", "Warp", "Salvo"]
Expand All @@ -34,15 +34,15 @@ type = "string"
prompt = "How do you want to create CSS?"
choices = ["Tailwind", "Vanilla"]
default = "Vanilla"
[conditional.'platform == "Fullstack"'.placeholders.styling]
[conditional.'platform == "fullstack"'.placeholders.styling]
type = "string"
prompt = "How do you want to create CSS?"
choices = ["Tailwind", "Vanilla"]
default = "Vanilla"

[conditional.'platform == "TUI"']
ignore = [ "tailwind.config.js", "input.css", "public" ]
[conditional.'platform == "Liveview"']
[conditional.'platform == "liveview"']
ignore = [ "tailwind.config.js", "input.css", "public" ]
[conditional.'platform == "desktop"']
ignore = [ "public" ]
Expand Down
18 changes: 9 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(non_snake_case)]
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
#![allow(unused)]
use dioxus_fullstack::prelude::*;
{% endif %}
Expand All @@ -9,7 +9,7 @@ use dioxus_router::prelude::*;
use dioxus::prelude::*;
use log::LevelFilter;

{% if platform == "Liveview" %}
{% if platform == "liveview" %}
{% if backend == "Axum" %}
#[tokio::main]
async fn main() {
Expand Down Expand Up @@ -179,7 +179,7 @@ fn main() {
dioxus_tui::launch(app);
}
{% endif %}
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
fn main() {
// Init debug
dioxus_logger::init(LevelFilter::Info).expect("failed to init logger");
Expand All @@ -192,15 +192,15 @@ fn main() {
{% endif %}

{% if router %}
{% if platform != "Fullstack" %}
{% if platform != "fullstack" %}
fn app(cx: Scope) -> Element {
render!{
Router::<Route> {}
}
}
{% endif %}

{% if platform != "Fullstack" %}
{% if platform != "fullstack" %}
#[derive(Clone, Routable, Debug, PartialEq)]
enum Route {
#[route("/")]
Expand All @@ -209,7 +209,7 @@ enum Route {
Blog { id: i32 },
}
{% endif %}
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
#[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
enum Route {
#[route("/")]
Expand All @@ -230,7 +230,7 @@ fn Blog(cx: Scope, id: i32) -> Element {
#[component]
fn Home(cx: Scope) -> Element {
let mut count = use_state(cx, || 0);
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
let text = use_state(cx, || "...".to_string());
{% endif %}

Expand All @@ -245,7 +245,7 @@ fn Home(cx: Scope) -> Element {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
button {
onclick: move |_| {
to_owned![text];
Expand Down Expand Up @@ -277,7 +277,7 @@ fn app(cx: Scope) -> Element {
}
{% endif %}

{% if platform == "Fullstack" %}
{% if platform == "fullstack" %}
#[server(PostServerData)]
async fn post_server_data(data: String) -> Result<(), ServerFnError> {
println!("Server received: {}", data);
Expand Down

0 comments on commit 7a9ca1d

Please sign in to comment.