diff --git a/.gitignore b/.gitignore index 62aa691a..bcc19ba3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ pkg apis/target/ todos +site/ # These are backup files generated by rustfmt **/*.rs.bk diff --git a/apis/src/components/atoms/profile_link.rs b/apis/src/components/atoms/profile_link.rs index c895a502..0119f853 100644 --- a/apis/src/components/atoms/profile_link.rs +++ b/apis/src/components/atoms/profile_link.rs @@ -1,15 +1,18 @@ use crate::components::molecules::hover_ratings::HoverRating; use crate::responses::UserResponse; use leptos::*; +use leptos_icons::*; #[component] pub fn ProfileLink( #[prop(optional)] extend_tw_classes: &'static str, #[prop(optional)] user_is_hoverable: Option>, username: String, + patreon: bool, ) -> impl IntoView { let profile_link = format!("/@/{}", username); let hover_show = RwSignal::new(false); + let patreon = RwSignal::new(patreon); view! {
-
{username}
- +
+ {username} + + +
diff --git a/apis/src/components/molecules/challenge_row.rs b/apis/src/components/molecules/challenge_row.rs index 91ab79dd..345fa865 100644 --- a/apis/src/components/molecules/challenge_row.rs +++ b/apis/src/components/molecules/challenge_row.rs @@ -80,6 +80,7 @@ pub fn ChallengeRow(challenge: StoredValue, single: bool) ->
@@ -90,6 +91,7 @@ pub fn ChallengeRow(challenge: StoredValue, single: bool) -> @@ -101,6 +103,7 @@ pub fn ChallengeRow(challenge: StoredValue, single: bool) -> diff --git a/apis/src/components/molecules/game_row.rs b/apis/src/components/molecules/game_row.rs index 176fc753..7aca96f6 100644 --- a/apis/src/components/molecules/game_row.rs +++ b/apis/src/components/molecules/game_row.rs @@ -108,7 +108,10 @@ pub fn GameRow(game: StoredValue) -> impl IntoView {
- +

@@ -120,7 +123,10 @@ pub fn GameRow(game: StoredValue) -> impl IntoView {
- +

diff --git a/apis/src/components/molecules/user_row.rs b/apis/src/components/molecules/user_row.rs index f34155d4..2471c367 100644 --- a/apis/src/components/molecules/user_row.rs +++ b/apis/src/components/molecules/user_row.rs @@ -28,10 +28,17 @@ pub fn UserRow( }; let profile_link = move || { if on_profile { - view! { } + view! { + + } } else { view! { let rating = move || match (player(), speed()) { (Some(player), Some(speed)) => { @@ -59,7 +60,11 @@ pub fn UserWithRating( view! {
- +
} }} diff --git a/apis/src/pages/donate.rs b/apis/src/pages/donate.rs index 53701b4a..8086345d 100644 --- a/apis/src/pages/donate.rs +++ b/apis/src/pages/donate.rs @@ -38,7 +38,7 @@ pub fn Donate() -> impl IntoView { Are some features reserved for Patrons?

- "No, because hivegame is entirely free, forever, and for everyone. That's a promise." + "No, because hivegame is entirely free, forever, and for everyone. That's a promise. You do get a 👑 though."

diff --git a/apis/src/pages/faq.rs b/apis/src/pages/faq.rs index bd15bf7b..46da1a83 100644 --- a/apis/src/pages/faq.rs +++ b/apis/src/pages/faq.rs @@ -60,6 +60,10 @@ pub fn Faq() -> impl IntoView { "It's developed by communtity members, and 100% donation based. hivegame.com will never collect any user data, show ads or implement anything else that will distract you from the game or makes money."

+
+

"How do I get a 👑 next to my username?"

+

"By donating to the project!"

+

"What is Hive?"

diff --git a/apis/src/pages/resources.rs b/apis/src/pages/resources.rs index 7d04c165..8538db27 100644 --- a/apis/src/pages/resources.rs +++ b/apis/src/pages/resources.rs @@ -155,7 +155,7 @@ pub fn Resources() -> impl IntoView {

  • , } @@ -15,6 +16,7 @@ impl UserResponse { Self { username: uuid.to_string(), uid: uuid, + patreon: false, ratings: HashMap::new(), } } @@ -103,6 +105,7 @@ impl UserResponse { Ok(Self { username: user.username.clone(), uid: user.id, + patreon: user.patreon, ratings, }) } diff --git a/db/migrations/2024-05-18-084529_add_patreon_to_users/down.sql b/db/migrations/2024-05-18-084529_add_patreon_to_users/down.sql new file mode 100644 index 00000000..0d73bf5d --- /dev/null +++ b/db/migrations/2024-05-18-084529_add_patreon_to_users/down.sql @@ -0,0 +1 @@ +alter table users drop column patreon; diff --git a/db/migrations/2024-05-18-084529_add_patreon_to_users/up.sql b/db/migrations/2024-05-18-084529_add_patreon_to_users/up.sql new file mode 100644 index 00000000..161010a8 --- /dev/null +++ b/db/migrations/2024-05-18-084529_add_patreon_to_users/up.sql @@ -0,0 +1 @@ +alter table users add column patreon bool not null default false; diff --git a/db/src/models/user.rs b/db/src/models/user.rs index bb4ba0a0..35d3d217 100644 --- a/db/src/models/user.rs +++ b/db/src/models/user.rs @@ -92,6 +92,7 @@ pub struct NewUser { pub created_at: DateTime, pub updated_at: DateTime, pub normalized_username: String, + pub patreon: bool, } impl NewUser { @@ -105,6 +106,7 @@ impl NewUser { created_at: Utc::now(), updated_at: Utc::now(), normalized_username: username.to_lowercase(), + patreon: false, }) } } @@ -119,6 +121,7 @@ pub struct User { pub created_at: DateTime, pub updated_at: DateTime, pub normalized_username: String, + pub patreon: bool, } impl User { diff --git a/db/src/schema.rs b/db/src/schema.rs index d2c010b0..8fde7d70 100644 --- a/db/src/schema.rs +++ b/db/src/schema.rs @@ -86,6 +86,7 @@ diesel::table! { created_at -> Timestamptz, updated_at -> Timestamptz, normalized_username -> Text, + patreon -> Bool, } }