Skip to content

Commit 25925da

Browse files
cleanup code
1 parent d2aeb1e commit 25925da

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

lib/fileonchain_web/components/core_components.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ defmodule FileonchainWeb.CoreComponents do
500500
class={["relative p-4", @row_click && "hover:cursor-pointer"]}
501501
>
502502
<div class="block py-4 pr-6">
503-
<span class="absolute -inset-y-px right-0 -left-4 group-hover:bg-brand-700 sm:rounded-l-xl" />
503+
<span class="absolute -inset-y-px right-0 -left-0 group-hover:bg-brand-700 sm:rounded-l-xl" />
504504
<span class={["relative", i == 0 && "font-semibold text-secondary"]}>
505505
<%= render_slot(col, @row_item.(row)) %>
506506
</span>

lib/fileonchain_web/live/chunks_live/index.html.heex

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="mx-auto max-w-4xl p-12 bg-brand-900 text-white rounded-lg shadow-lg">
2-
<.header class="text-center text-white text-2xl">
2+
<.header>
33
Listing Chunks
44
<:actions>
5-
<.link patch={~p"/files/new"} class="font-semibold hover:underline text-secondary-light">
6-
<.button class="bg-secondary hover:bg-secondary-dark text-white p-4 rounded">New File</.button>
5+
<.link patch={~p"/files/new"}>
6+
<.button>New File</.button>
77
</.link>
88
</:actions>
99
</.header>
@@ -12,27 +12,25 @@
1212
id="chunks"
1313
rows={@streams.chunks}
1414
row_click={fn {_id, chunk} -> JS.navigate(~p"/chunks/#{chunk}") end}
15-
class="w-full mt-6 bg-brand-800 rounded-lg"
1615
>
17-
<:col :let={{_id, chunk}} label="Hash" class="p-4 border-b border-brand-700 text-white">
16+
<:col :let={{_id, chunk}} label="Hash">
1817
<%= FileonchainWeb.ChunkLive.Index.shorten_hash(chunk.hash) %>
1918
</:col>
20-
<:col :let={{_id, chunk}} label="Data" class="p-4 border-b border-brand-700">
19+
<:col :let={{_id, chunk}} label="Data">
2120
<%= raw(FileonchainWeb.ChunkLive.Index.render_chunk_preview(chunk)) %>
2221
</:col>
23-
<:col :let={{_id, chunk}} label="Size" class="p-4 border-b border-brand-700 text-white">
22+
<:col :let={{_id, chunk}} label="Size">
2423
<%= FileonchainWeb.ChunkLive.Index.format_chunk_size(chunk.data) %>
2524
</:col>
26-
<:action :let={{_id, chunk}} class="p-4 border-b border-brand-700">
25+
<:action :let={{_id, chunk}}>
2726
<div class="sr-only">
28-
<.link navigate={~p"/chunks/#{chunk}"} class="text-secondary-light hover:underline">Show</.link>
27+
<.link navigate={~p"/chunks/#{chunk}"}>Show</.link>
2928
</div>
3029
</:action>
31-
<:action :let={{id, chunk}} class="p-4 border-b border-brand-700">
30+
<:action :let={{id, chunk}}>
3231
<.link
3332
phx-click={JS.push("hide", value: %{id: chunk.id}) |> hide("##{id}")}
3433
data-confirm="Are you sure?"
35-
class="text-secondary hover:text-secondary-light"
3634
>
3735
Hide
3836
</.link>

lib/fileonchain_web/live/file_live/index.html.heex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="mx-auto max-w-2xl p-12 bg-brand-900 text-white rounded-lg shadow-lg">
2-
<.header class="text-center text-white text-2xl">
2+
<.header>
33
Listing Files
44
<:actions>
5-
<.link patch={~p"/files/new"} class="font-semibold hover:underline text-secondary-light">
6-
<.button class="bg-secondary hover:bg-secondary-dark text-white p-4 rounded">New File</.button>
5+
<.link patch={~p"/files/new"}>
6+
<.button>New File</.button>
77
</.link>
88
</:actions>
99
</.header>
@@ -17,17 +17,16 @@
1717
<:col :let={{_id, file}} label="Preview">
1818
<%= raw(render_file_preview(file)) %>
1919
</:col>
20-
<:col :let={{_id, file}} label="Size" class="p-4 border-b border-brand-700"><%= format_file_size(file.data) %></:col>
20+
<:col :let={{_id, file}} label="Size"><%= format_file_size(file.data) %></:col>
2121
<:action :let={{_id, file}}>
22-
<div class="sr-only">
23-
<.link navigate={~p"/files/#{file}"} class="text-secondary-light hover:underline">Show</.link>
22+
<div>
23+
<.link navigate={~p"/files/#{file}"}>Show</.link>
2424
</div>
2525
</:action>
2626
<:action :let={{id, file}}>
2727
<.link
2828
phx-click={JS.push("hide", value: %{id: file.id}) |> hide("##{id}")}
2929
data-confirm="Are you sure?"
30-
class="text-secondary hover:text-secondary-light"
3130
>
3231
Hide
3332
</.link>

0 commit comments

Comments
 (0)