-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix the Sidebar/Left Menu styling and align with React [MDS-107] #290
Changes from 6 commits
50592ac
b890772
77e3068
ae7e2bd
8d961ea
448b4dd
b351c71
9b3d797
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ defmodule Moon.Components.Chip do | |
prop size, :string, values: ["small", "medium"], default: "medium" | ||
prop is_stroke, :boolean, default: false | ||
prop icon_only, :string | ||
prop variant, :string, values: ["default", "ghost"], default: "default" | ||
|
||
def render(assigns) do | ||
~F""" | ||
|
@@ -28,6 +29,7 @@ defmodule Moon.Components.Chip do | |
"flex justify-center items-center gap-2 rounded relative active:scale-90 transition-all text-moon-14", | ||
"hover:text-piccolo-100 hover:bg-piccolo-100 hover:bg-opacity-12 #{@class} #{active_btn_class(@active, @active_class, @inactive_class)}", | ||
set_padding(@size, @left_icon, @right_icon, @icon_only), | ||
set_bg_color(@active, @variant), | ||
"h-8 w-8": @size == "small" && !slot_assigned?(:default), | ||
"h-10 w-10": @size == "medium" && !slot_assigned?(:default), | ||
"shadow-border": @is_stroke && @active, | ||
|
@@ -75,8 +77,16 @@ defmodule Moon.Components.Chip do | |
defp icon_class("medium"), do: "h-6 w-6" | ||
|
||
defp active_btn_class(true, active_class, _), | ||
do: "text-piccolo-100 bg-piccolo-100 bg-opacity-12 #{active_class}" | ||
do: "text-piccolo-100 bg-opacity-12 #{active_class}" | ||
|
||
defp active_btn_class(false, _, inactive_class), | ||
do: "text-bulma-100 bg-gohan-100 #{inactive_class}" | ||
|
||
defp set_bg_color(active, variant) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So bad style |
||
if variant == "default" do | ||
if active, do: "bg-piccolo-100", else: "bg-gohan-100" | ||
else | ||
"bg-transparent" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defmodule MoonWeb.Components.LargeLogo do | ||
@moduledoc false | ||
|
||
use Moon.StatelessComponent | ||
|
||
def render(assigns) do | ||
~F""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put this to separate SVG file - otherwise caching etc does not work. Because LiveViews are server side rendered, each time something changes, this means a lot more network traffic. |
||
<img src="/moon/assets/svgs/moon_web/large_icon.svg"> | ||
""" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{"flex flex-col", @gap, @class}