Skip to content

Commit

Permalink
update leptos_icons
Browse files Browse the repository at this point in the history
  • Loading branch information
akarras committed Jan 21, 2024
1 parent 163fbb7 commit c357eaa
Show file tree
Hide file tree
Showing 17 changed files with 420 additions and 292 deletions.
563 changes: 340 additions & 223 deletions Cargo.lock

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ tracing = "0.1.36"
tracing-subscriber = "0.3"
futures = "0.3.24"
anyhow = "1.0.72"
leptos = { git = "https://github.com/leptos-rs/leptos.git", default-features = false, features = [
leptos = { version = "0.5.7", default-features = false, features = [
"serde",
"nightly"
] }
leptos_axum = { git = "https://github.com/leptos-rs/leptos.git" }
leptos_router = { git = "https://github.com/leptos-rs/leptos.git", default-features = false, features = ["nightly"] }
leptos_meta = { git = "https://github.com/leptos-rs/leptos.git", default-features = false, features = ["nightly"] }
leptos-use = { git = "https://github.com/Synphonyte/leptos-use.git", features = ["serde"] }
leptos_axum = { version = "0.5.7" }
leptos_router = { version = "0.5.7", default-features = false, features = ["nightly"] }
leptos_meta = { version = "0.5.7", default-features = false, features = ["nightly"] }
leptos-use = { verion = "0.9.0", features = ["serde"] }
chrono = "0.4.23"
itertools = "0.11.0"
itertools = "0.12.0"
image = "0.24.6"
plotters = "0.3"
sea-orm = {version = "0.12.2", features = ["sqlx-postgres", "runtime-tokio-rustls"]}
Expand All @@ -36,15 +36,14 @@ sea-query = "0.30.0"
yoke = "0.7.1"
xiv-gen = {path = "./xiv-gen", features = ["item", "item_ui_category", "item_search_category", "class_job", "recipe",
"class_job_category", "base_param", "item_sort_category"]}
leptos_icons = {version = "0.0.16-beta", features = ["IoSettingsSharp", "AiOrderedListOutlined", "BsDiscord", "BsClipboard2Fill", "BsClipboard2CheckFill",
"AiEditFilled", "FaMoneyBillTrendUpSolid", "BsCheck", "BsPencilFill", "BiSortDownRegular", "BiSortUpRegular", "BiPlusRegular", "BiTrashSolid",
"AiExclamationOutlined", "BiSaveSolid", "BiGroupSolid", "BiHomeSolid", "FaScrewdriverWrenchSolid", "AiSearchOutlined", "ImPriceTag", "BiCalendarAltRegular", "BiMenuRegular"]}
icondata = "0.3"
leptos_icons = {version = "0.2.1" }
cfg-if = "1.0.0"
git-const = "1.1.0"

[patch.crates-io]
leptos = { git = "https://github.com/leptos-rs/leptos.git"}
leptos_reactive = { git = "https://github.com/leptos-rs/leptos.git"}
#leptos = { git = "https://github.com/leptos-rs/leptos.git" }
#leptos_reactive = { git = "https://github.com/leptos-rs/leptos.git" }
pathfinder_simd = { git = "https://github.com/servo/pathfinder.git" } # needed on ARM Mac until pathfinder_simd has new release

[profile.release]
Expand Down
1 change: 1 addition & 0 deletions ultros-frontend/ultros-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ serde_json = "1.0.94"
ultros-charts = {path = "../ultros-charts" }
plotters-canvas = "0.3"
leptos_icons.workspace = true
icondata.workspace = true
serde_qs = "0.12.0"
gloo-timers = {version = "0.3.0", features = ["futures"]}
cfg-if.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions ultros-frontend/ultros-app/src/components/clipboard.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::global_state::clipboard_text::GlobalLastCopiedText;

use super::tooltip::*;
use icondata as i;
use leptos::*;
use leptos_icons::*;

Expand All @@ -15,9 +16,9 @@ pub fn Clipboard(#[prop(into)] clipboard_text: MaybeSignal<String>) -> impl Into
});
let icon = create_memo(move |_| {
if !copied() {
Icon::from(BsIcon::BsClipboard2Fill)
i::BsClipboard2Fill
} else {
Icon::from(BsIcon::BsClipboard2CheckFill)
i::BsClipboard2CheckFill
}
});
view! {<div class="clipboard" on:click=move |_| {
Expand All @@ -42,7 +43,7 @@ pub fn Clipboard(#[prop(into)] clipboard_text: MaybeSignal<String>) -> impl Into
Oco::from("Text copied!")
}
}) >
{move || {let icon = icon(); view!{<Icon icon/>}}}
<Icon icon/>
</Tooltip>
</div>
}
Expand Down
4 changes: 2 additions & 2 deletions ultros-frontend/ultros-app/src/components/lists_nav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use leptos_icons::*;
pub fn ListsNav() -> impl IntoView {
view! {<div class="content-nav">
<A class="btn-secondary" href="/list/edit">
<Icon icon=Icon::from(AiIcon::AiEditFilled)
<Icon icon=AiEditFilled
"Edit"
</A>
<A class="btn-secondary" href="/list">
<Icon icon=Icon::from(AiIcon::AiOrderedListOutlined) />
<Icon icon=AiOrderedListOutlined />
"Lists"
</A>
</div>}
Expand Down
5 changes: 3 additions & 2 deletions ultros-frontend/ultros-app/src/components/profile_display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{api::get_login, components::loading::Loading};
use icondata as i;
use leptos::*;
use leptos_icons::*;
use leptos_router::*;
Expand All @@ -17,10 +18,10 @@ pub fn ProfileDisplay() -> impl IntoView {
"Logout"
</a>}.into_view(),
_ => view! {<a rel="external" class="btn" href="/login">
<Icon height="2rem" width="2em" icon=Icon::from(BsIcon::BsDiscord) />"Login"
<Icon height="2rem" width="2em" icon=i::BsDiscord />"Login"
</a>
<A href="/settings">
<Icon height="2em" width="2em" icon=Icon::from(IoIcon::IoSettingsSharp)/>
<Icon height="2em" width="2em" icon=i::IoSettingsSharp/>
<span class="sr-only">Settings</span>
</A>
}.into_view(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::{datacenter_name::*, gil::*, relative_time::*, world_name::*};
use icondata as i;
use leptos::*;
use leptos_icons::*;
use ultros_api_types::{world_helper::AnySelector, SaleHistory};
Expand Down Expand Up @@ -33,7 +34,7 @@ pub fn SaleHistoryTable(sales: Signal<Vec<SaleHistory>>) -> impl IntoView {
let total = sale.price_per_item * sale.quantity;
view! {
<tr>
<td>{sale.hq.then(||{view!{<Icon icon=Icon::from(BsIcon::BsCheck) />}.into_view()})}</td>
<td>{sale.hq.then(||{view!{<Icon icon=i::BsCheck />}.into_view()})}</td>
<td><Gil amount=sale.price_per_item/></td>
<td>{sale.quantity}</td>
<td><Gil amount=total /></td>
Expand Down
6 changes: 3 additions & 3 deletions ultros-frontend/ultros-app/src/components/search_box.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::cmp::Reverse;

use crate::{
components::{search_result::*, virtual_scroller::*},
global_state::home_world::get_price_zone,
};
use gloo_timers::future::TimeoutFuture;
use icondata as i;
use leptos::{html::Input, *};
use leptos_icons::*;
use leptos_router::{use_navigate, NavigateOptions};
use std::cmp::Reverse;
use sublime_fuzzy::{FuzzySearch, Match, Scoring};
use web_sys::KeyboardEvent;

Expand Down Expand Up @@ -79,7 +79,7 @@ pub fn SearchBox() -> impl IntoView {

<div class="absolute top-0 left-0 right-0 sm:relative" style="height: 36px;">
<input ref=text_input on:keydown=keydown on:input=on_input on:focusin=focus_in on:focusout=focus_out class="search-box w-screen m-0 sm:w-[424px]" type="text" prop:value=search class:active={active}/>
<div class="absolute right-3 top-3 z-10"><Icon icon=Icon::from(AiIcon::AiSearchOutlined) /></div>
<div class="absolute right-3 top-3 z-10"><Icon icon=i::AiSearchOutlined /></div>
<div id="search-results" class="search-results w-screen sm:w-[424px] z-50 mx-0">
// WHY DOES THIS BREAK HYDRATION?
// <WasmLoadingIndicator />
Expand Down
11 changes: 6 additions & 5 deletions ultros-frontend/ultros-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::{
},
};
use git_const::git_short_hash;
use icondata as i;
use leptos::*;
use leptos_icons::*;
use leptos_meta::*;
Expand Down Expand Up @@ -62,7 +63,7 @@ pub fn App(worlds: AppResult<Arc<WorldHelper>>, region: String) -> impl IntoView
<Router>
<nav class="header">
<A href="/" exact=true>
<Icon icon=Icon::from(BiIcon::BiHomeSolid) height="1.75em" width="1.75em"/>
<Icon icon=i::BiHomeSolid height="1.75em" width="1.75em"/>
"Home"
</A>
// <Suspense fallback=move || {}>
Expand All @@ -75,18 +76,18 @@ pub fn App(worlds: AppResult<Arc<WorldHelper>>, region: String) -> impl IntoView
{
view!{
<A href=homeworld().map(|w| format!("/analyzer/{}", w.name)).unwrap_or("/analyzer".to_string())>
<Icon width="1.75em" height="1.75em" icon=Icon::from(FaIcon::FaMoneyBillTrendUpSolid)/>
<Icon width="1.75em" height="1.75em" icon=i::FaMoneyBillTrendUpSolid/>
"Analyzer"
</A>}
}
}
<Suspense fallback=move || {}>
{move || login.get().flatten().map(|_| view!{<A href="/list">
<Icon width="1.75em" height="1.75em" icon=Icon::from(AiIcon::AiOrderedListOutlined) />
<Icon width="1.75em" height="1.75em" icon=i::AiOrderedListOutlined />
"Lists"
</A>
<A href="/retainers/listings">
<Icon width="1.75em" height="1.75em" icon=Icon::from(BiIcon::BiGroupSolid) />
<Icon width="1.75em" height="1.75em" icon=i::BiGroupSolid />
"Retainers"
</A>})}
</Suspense>
Expand All @@ -95,7 +96,7 @@ pub fn App(worlds: AppResult<Arc<WorldHelper>>, region: String) -> impl IntoView
</div>
<A href="/items?menu-open=true">
<Tooltip tooltip_text=Oco::from("Item Explorer")>
<Icon width="1.75em" height="1.75em" icon=Icon::from(FaIcon::FaScrewdriverWrenchSolid) />
<Icon width="1.75em" height="1.75em" icon=i::FaScrewdriverWrenchSolid />
</Tooltip>
<div class="sr-only">"Item Explorer"</div>
</A>
Expand Down
26 changes: 13 additions & 13 deletions ultros-frontend/ultros-app/src/routes/analyzer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
use crate::{
api::{get_cheapest_listings, get_recent_sales_for_world},
components::{
ad::Ad, clipboard::*, gil::*, item_icon::*, meta::*, query_button::QueryButton, tooltip::*,
virtual_scroller::*, world_picker::*,
},
error::AppError,
global_state::LocalWorldData,
};
use chrono::{Duration, Utc};
use humantime::{format_duration, parse_duration};
use icondata as i;
use leptos::*;
use leptos_icons::*;
use leptos_router::*;
use log::info;
use std::{cmp::Reverse, collections::HashMap, fmt::Display, str::FromStr, sync::Arc};
Expand All @@ -11,17 +22,6 @@ use ultros_api_types::{
};
use xiv_gen::ItemId;

use crate::{
api::{get_cheapest_listings, get_recent_sales_for_world},
components::{
ad::Ad, clipboard::*, gil::*, item_icon::*, meta::*, query_button::QueryButton, tooltip::*,
virtual_scroller::*, world_picker::*,
},
error::AppError,
global_state::LocalWorldData,
};
use leptos_icons::*;

/// Computed sale stats
#[derive(Hash, Clone, Debug, PartialEq)]
struct SaleSummary {
Expand Down Expand Up @@ -322,7 +322,7 @@ fn AnalyzerTable(
<Tooltip tooltip_text=Oco::from("Sort by profit")>
<QueryButton class="!text-fuchsia-300 hover:text-fuchsia-200" active_classes="!text-neutral-300 hover:text-neutral-200" query_name="sort" value="profit">
<div class="flex-row flex-space">
"Profit" {move || (sort_mode() == Some(SortMode::Profit)).then(|| { view!{<Icon icon=Icon::from(BiIcon::BiSortDownRegular) /> }})}
"Profit" {move || (sort_mode() == Some(SortMode::Profit)).then(|| { view!{<Icon icon=i::BiSortDownRegular /> }})}
</div>
</QueryButton>
</Tooltip>
Expand All @@ -331,7 +331,7 @@ fn AnalyzerTable(
<Tooltip tooltip_text=Oco::from("Sort by R.O.I")>
<QueryButton class="!text-fuchsia-300 hover:text-fuchsia-200" active_classes="!text-neutral-300 hover:text-neutral-200" query_name="sort" value="roi" default=true>
<div class="flex-row flex-space">
"R.O.I." {move || (sort_mode() == Some(SortMode::Roi)).then(|| { view!{<Icon icon=Icon::from(BiIcon::BiSortDownRegular) /> }})}
"R.O.I." {move || (sort_mode() == Some(SortMode::Roi)).then(|| { view!{<Icon icon=i::BiSortDownRegular /> }})}
</div>
</QueryButton>
</Tooltip>
Expand Down
11 changes: 6 additions & 5 deletions ultros-frontend/ultros-app/src/routes/home_page.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// use crate::components::live_sale_ticker::*;
use icondata as i;
use leptos::*;
use leptos_icons::*;
use leptos_meta::*;
Expand Down Expand Up @@ -40,35 +41,35 @@ pub fn HomePage() -> impl IntoView {
<div class="flex flex-1 flex-col md:flex-row md:flex-wrap gap-4">
<a href="/items?menu-open=true">
<FeatureCard>
<Icon width="1.75em" height="1.75em" icon=Icon::from(FaIcon::FaScrewdriverWrenchSolid) />
<Icon width="1.75em" height="1.75em" icon=i::FaScrewdriverWrenchSolid />
<h3 class="text-xl p-1 text-yellow-100">"Item Finder"</h3>
<span>"Explore all the items on the marketboard"</span>
</FeatureCard>
</a>
<a href="/analyzer">
<FeatureCard>
<Icon width="1.75em" height="1.75em" icon=Icon::from(FaIcon::FaMoneyBillTrendUpSolid)/>
<Icon width="1.75em" height="1.75em" icon=i::FaMoneyBillTrendUpSolid/>
<h3 class="text-xl p-1 text-yellow-100">"Analyzer"</h3>
<span>"Earn gil by buying low, selling high"</span>
</FeatureCard>
</a>
<a href="/retainers">
<FeatureCard>
<Icon width="1.75em" height="1.75em" icon=Icon::from(BiIcon::BiGroupSolid) />
<Icon width="1.75em" height="1.75em" icon=i::BiGroupSolid />
<h3 class="text-xl p-1 text-yellow-100">"Retainers"</h3>
<span>"Track your retainers online"</span>
</FeatureCard>
</a>
<a href="/list">
<FeatureCard>
<Icon width="1.75em" height="1.75em" icon=Icon::from(AiIcon::AiOrderedListOutlined) />
<Icon width="1.75em" height="1.75em" icon=i::AiOrderedListOutlined />
<h3 class="text-xl text-yellow-100">"Lists"</h3>
<span>"Create lists & buy the cheapest items"</span>
</FeatureCard>
</a>
<a href="/invitebot">
<FeatureCard>
<Icon width="1.75em" height="1.75em" icon=Icon::from(BsIcon::BsDiscord) />
<Icon width="1.75em" height="1.75em" icon=i::BsDiscord />
<span class="text-xl text-yellow-100">"Discord Bot"</span>
<span>
"Get alerts when your retainer is undercut"
Expand Down
11 changes: 6 additions & 5 deletions ultros-frontend/ultros-app/src/routes/item_explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::components::query_button::QueryButton;
use crate::components::toggle::Toggle;
use crate::components::{cheapest_price::*, fonts::*, meta::*, small_item_display::*};
use crate::CheapestPrices;
use icondata as i;
use itertools::Itertools;
use leptos::*;
use leptos_icons::*;
Expand Down Expand Up @@ -436,12 +437,12 @@ fn ItemList(items: Memo<Vec<(&'static ItemId, &'static Item)>>) -> impl IntoView
<div class="flex flex-row">
<QueryButton query_name="sort" value="key" class="p-1 !text-violet-200 hover:text-violet-600" active_classes="p-1 !text-violet-500">
<div class="flex flex-row">
<Icon icon=Icon::from(BiIcon::BiCalendarAltRegular)/>
<Icon icon=i::BiCalendarAltRegular/>
"ADDED"
</div>
</QueryButton>
<QueryButton query_name="sort" value="price" class="p-1 !text-violet-200 hover:text-violet-600" active_classes="p-1 !text-violet-500">
<div class="flex flex-row"><Icon icon=Icon::from(ImIcon::ImPriceTag)/>"PRICE"</div>
<div class="flex flex-row"><Icon icon=i::ImPriceTag/>"PRICE"</div>
</QueryButton>
<QueryButton query_name="sort" value="name" class="p-1 !text-violet-200 hover:text-violet-600" active_classes="p-1 !text-violet-500">
"NAME"
Expand All @@ -452,10 +453,10 @@ fn ItemList(items: Memo<Vec<(&'static ItemId, &'static Item)>>) -> impl IntoView
</div>
<div class="flex flex-row">
<QueryButton query_name="dir" value="asc" class="p-1 !text-violet-200 hover:text-violet-600" active_classes="p-1 !text-violet-500">
<div class="flex flex-row"><Icon icon=Icon::from(BiIcon::BiSortUpRegular)/>"ASC"</div>
<div class="flex flex-row"><Icon icon=i::BiSortUpRegular/>"ASC"</div>
</QueryButton>
<QueryButton query_name="dir" value="desc" class="p-1 !text-violet-200 hover:text-violet-600" active_classes="p-1 !text-violet-500" default=true>
<div class="flex flex-row"><Icon icon=Icon::from(BiIcon::BiSortDownRegular)/>"DESC"</div>
<div class="flex flex-row"><Icon icon=i::BiSortDownRegular/>"DESC"</div>
</QueryButton>
</div>

Expand Down Expand Up @@ -504,7 +505,7 @@ pub fn ItemExplorer() -> impl IntoView {
<button class="p-2 text-3xl bg-neutral-800 text-gray-300 hover:bg-neutral-600 gap-1 flex flex-row rounded" class:bg-neutral-700=menu_open class:bg-neutral-800=move || !menu_open() on:click=move |_| {
set_open(!menu_open.get_untracked());
}>
<Icon icon=Icon::from(BiIcon::BiMenuRegular) />
<Icon icon=i::BiMenuRegular />
<span>"Categories"</span>
</button>
<div class="main-content relative">
Expand Down
Loading

0 comments on commit c357eaa

Please sign in to comment.