From 02e60334677d9b58c0939e6fe83824193b87b77d Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Sun, 3 Dec 2023 01:13:10 +0000 Subject: [PATCH] Details page and stuff --- lib/wish_web/components/layouts/app.html.heex | 2 +- lib/wish_web/live/home_live/details.html.heex | 59 ++++++++++++++++--- lib/wish_web/live/home_live/index.html.heex | 31 ++++++++-- 3 files changed, 78 insertions(+), 14 deletions(-) diff --git a/lib/wish_web/components/layouts/app.html.heex b/lib/wish_web/components/layouts/app.html.heex index 4e94e78..79e34af 100644 --- a/lib/wish_web/components/layouts/app.html.heex +++ b/lib/wish_web/components/layouts/app.html.heex @@ -8,7 +8,7 @@
-
+
<.flash_group flash={@flash} /> <%= @inner_content %> diff --git a/lib/wish_web/live/home_live/details.html.heex b/lib/wish_web/live/home_live/details.html.heex index 297cad8..bd646ca 100644 --- a/lib/wish_web/live/home_live/details.html.heex +++ b/lib/wish_web/live/home_live/details.html.heex @@ -1,14 +1,55 @@ <.link navigate={~p"/"}> <.icon name="hero-arrow-left" /> Back to list -<.header> - <%= @item.title %> - -
- +
+
+ + <%= if @item.received && !@current_user do %> +
+ <.icon name="hero-check-circle" />Received +
+ <% end %> +
+
+ <.header> + <%= @item.title %> + + +
+
+ Priority: +
+ + <%= for _ <- 1..@item.desire do %> + <.icon name="hero-star" class="bg-red-500 text-red-500" /> + <% end %> + +
+ + <%= if @item.description do %> +
+
+ Description: +
+
+ <%= @item.description %> +
+
+ <% end %> + + <.button> + <.link class="block h-full w-full" href={@item.url} target="_blank"> + Go to seller <.icon name="hero-arrow-right" /> + + + + <.button phx-click={JS.push("toggle_received", value: %{"id" => @item.id})}> + <%= if !@item.received do %> + Mark as purchased + <% else %> + Unmark as purchased + <% end %> + +
- -<.button phx-click={JS.push("toggle_received", value: %{"id" => @item.id})}> - Toggle Received - diff --git a/lib/wish_web/live/home_live/index.html.heex b/lib/wish_web/live/home_live/index.html.heex index ed7fe23..6286e4a 100644 --- a/lib/wish_web/live/home_live/index.html.heex +++ b/lib/wish_web/live/home_live/index.html.heex @@ -5,7 +5,7 @@ JS.push("toggle_view_state") |> JS.dispatch("toggle_view_state", detail: %{"grid" => !@grid}) }> - Toggle Display + Toggle List/Grid @@ -37,12 +37,22 @@
<%= item.title %>
-
+
<.icon name="hero-ellipsis-vertical" class="w-full h-full" />
<.dropdown item={item} />
+
+
+ Priority: +
+ + <%= for _ <- 1..item.desire do %> + <.icon name="hero-star" class="bg-red-500 text-red-500" /> + <% end %> + +
<%= item.description %>
@@ -69,12 +79,25 @@ <%= item.title %>
- <.icon name="hero-ellipsis-vertical" class="w-7 h-7" /> + <.icon + name="hero-ellipsis-vertical" + class="w-7 h-7 rounded-full hover:bg-purple-400 active:bg-purple-500" + /> <.dropdown item={item} />
-
+
<%= item.description %>
+
+
+ Priority: +
+ + <%= for _ <- 1..item.desire do %> + <.icon name="hero-star" class="bg-red-500 text-red-500" /> + <% end %> + +
<% end %>