Skip to content

Commit

Permalink
Merge branch 'main' into user_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jrowah committed Jul 26, 2024
2 parents 01550d7 + 3f53f5a commit f8fd396
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 38 deletions.
14 changes: 8 additions & 6 deletions lib/easy_bills_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ defmodule EasyBillsWeb.CoreComponents do
class={[
"fixed right-2 w-full z-50 p-3",
@kind == :info && "bg-emerald-50 text-emerald-800 ring-emerald-500 fill-cyan-900",
@kind == :error && "bg-red-400 font-bold text-white shadow-md ring-rose-500 fill-rose-900"
@kind == :error &&
"bg-red-400 font-bold text-white dark:text-red-900 shadow-md ring-rose-500 fill-rose-900"
]}
{@rest}
>
Expand Down Expand Up @@ -262,7 +263,7 @@ defmodule EasyBillsWeb.CoreComponents do
def simple_form(assigns) do
~H"""
<.form :let={f} for={@for} as={@as} {@rest}>
<div class="mt-5 space-y-2 bg-white">
<div class="mt-10 space-y-6">
<%= render_slot(@inner_block, f) %>
<div :for={action <- @actions} class="mt-2 flex items-center justify-between gap-6">
<%= render_slot(action, f) %>
Expand Down Expand Up @@ -456,7 +457,7 @@ defmodule EasyBillsWeb.CoreComponents do

def label(assigns) do
~H"""
<label for={@for} class="block text-sm font-semibold leading-6 text-zinc-800">
<label for={@for} class="block text-sm font-semibold leading-6 text-zinc-800 dark:text-white">
<%= render_slot(@inner_block) %>
</label>
"""
Expand Down Expand Up @@ -489,10 +490,10 @@ defmodule EasyBillsWeb.CoreComponents do
~H"""
<header class={[@actions != [] && "flex items-center justify-between gap-6", @class]}>
<div>
<h1 class="font-semibold leading-8 text-zinc-800">
<h1 class="text-lg font-semibold leading-8 text-zinc-800 dark:text-white">
<%= render_slot(@inner_block) %>
</h1>
<p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600">
<p :if={@subtitle != []} class="mt-2 text-sm leading-6 text-zinc-600 dark:text-white">
<%= render_slot(@subtitle) %>
</p>
</div>
Expand Down Expand Up @@ -710,10 +711,11 @@ defmodule EasyBillsWeb.CoreComponents do
"""
attr :name, :string, required: true
attr :class, :string, default: nil
attr :id, :string, default: nil

def icon(%{name: "hero-" <> _} = assigns) do
~H"""
<span class={[@name, @class]} />
<span id={@id} class={[@name, @class]} />
"""
end

Expand Down
5 changes: 2 additions & 3 deletions lib/easy_bills_web/components/layouts/app.html.heex
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<header class="px-4 sm:px-6 lg:px-8"></header>
<main class="">
<div class="">
<main>
<div>
<.flash_group flash={@flash} />
<%= @inner_content %>
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/easy_bills_web/components/layouts/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
})();
</script>
<link rel="icon" href={~p"/images/logo-black.svg"} type="image/svg" />
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
</script>
</head>
Expand Down
9 changes: 0 additions & 9 deletions lib/easy_bills_web/controllers/page_controller.ex

This file was deleted.

8 changes: 0 additions & 8 deletions lib/easy_bills_web/controllers/page_html.ex

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defmodule EasyBillsWeb.OnboardingLive.Shared.InputComponents do
def input_field(%{label_type: "icon"} = assigns) do
~H"""
<div phx-feedback-for={@name} class={@class}>
<.label for={@id} class="phx-no-feedback:text-gray-400 ml-2" errors={@errors}>
<.label for={@id} class="phx-no-feedback:text-zinc-700 dark:text-white" errors={@errors}>
<%= @label %>
</.label>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule EasyBillsWeb.OnboardingLive.Shared.SharedComponents do
class="relative flex min-h-screen flex-col items-center justify-center overflow-hidden py-6 sm:py-12 bg-white"
>
<div class="max-w-xl px-5 text-center bg-purple-200 rounded-lg">
<h2 class="mb-2 text-[42px] font-bold text-zinc-800"><%= @title %></h2>
<h2 class="mb-2 text-[42px] font-bold text-zinc-800 dark:text-white"><%= @title %></h2>
<p class="mb-2 text-lg text-zinc-500 leading-loose">
We've sent a confirmation email to <span class="font-medium text-indigo-500"><%= @form.data.email %></span>. Please follow the link in the message to confirm your email address. If you did not receive the email, please check your spam folder or:
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ defmodule EasyBillsWeb.OnboardingLive.UserRegistration.New do
@impl Phoenix.LiveComponent
def render(assigns) do
~H"""
<div>
<div class="text-gray-900 dark:text-white bg-white dark:bg-gray_secondary antialiased">
<RegularTemplate.regular socket={@socket}>
<div class="mx-auto mt-16">
<.link
href={~p"/"}
id="back-icon"
class="flex text-purple-600 absolute mt-[-6%] lg:mt-[-2%] lg:ml-[-8%]"
class="flex text-purple-600 dark:text-purple-300 absolute mt-[-6%] lg:mt-[-2%] lg:ml-[-8%]"
>
<CoreComponents.back_icon /> <span class="mt-[-2px] ml-1">Back</span>
</.link>
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_bills_web/live/user_address_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defmodule EasyBillsWeb.UserAddressLive do
</.error>
<div class=" md:flex md:space-x-3">
<div class="md:w-1/2">
<div class="md:w-1/2 text-gray-800">
<.input
field={@form[:country]}
type="select"
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_bills_web/live/user_forgot_password_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule EasyBillsWeb.UserForgotPasswordLive do
<.link
href={~p"/login"}
id="back-icon"
class="flex text-purple-600 absolute ml-[-8%] mt-6 lg:mt-[-4%]"
class="flex text-purple-600 dark:text-white absolute ml-[-8%] mt-6 lg:mt-[-4%]"
>
<CoreComponents.back_icon /> <span class="mt-[-2px] ml-1">Back</span>
</.link>
Expand Down
6 changes: 0 additions & 6 deletions priv/static/images/logo.svg

This file was deleted.

6 changes: 6 additions & 0 deletions test/easy_bills_web/user_auth_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ defmodule EasyBillsWeb.UserAuthTest do

{:halt, updated_socket} = UserAuth.on_mount(:ensure_authenticated, %{}, session, socket)
assert updated_socket.assigns.current_user == nil

assert updated_socket.assigns.flash["error"] == "You must log in to access this page."
# assert redirected_to(updated_socket) == ~p"/login"
end

test "redirects to login page if there isn't a user_token", %{conn: conn} do
Expand All @@ -183,6 +186,9 @@ defmodule EasyBillsWeb.UserAuthTest do

{:halt, updated_socket} = UserAuth.on_mount(:ensure_authenticated, %{}, session, socket)
assert updated_socket.assigns.current_user == nil

assert updated_socket.assigns.flash["error"] == "You must log in to access this page."
# assert redirected_to(updated_socket) == ~p"/login"
end
end

Expand Down

0 comments on commit f8fd396

Please sign in to comment.