refac: styling

This commit is contained in:
Timothy J. Baek
2024-10-14 12:46:05 -07:00
parent 7a0933a72f
commit 6f07afc79b
7 changed files with 196 additions and 165 deletions
+21 -15
View File
@@ -42,6 +42,14 @@
let showDeleteConfirm = false;
let filteredItems = [];
$: filteredItems = $tools.filter(
(t) =>
query === '' ||
t.name.toLowerCase().includes(query.toLowerCase()) ||
t.id.toLowerCase().includes(query.toLowerCase())
);
const shareHandler = async (tool) => {
const item = await getToolById(localStorage.token, tool.id).catch((error) => {
toast.error(error);
@@ -146,17 +154,7 @@
</title>
</svelte:head>
<div class="mb-3">
<div class="flex justify-between items-center">
<div class="flex md:self-center text-lg font-medium px-0.5">
{$i18n.t('Tools')}
<div class="flex self-center w-[1px] h-6 mx-2.5 bg-gray-200 dark:bg-gray-700" />
<span class="text-lg font-medium text-gray-500 dark:text-gray-300">{$tools.length}</span>
</div>
</div>
</div>
<div class=" flex w-full space-x-2">
<div class=" flex w-full space-x-2 mb-2.5">
<div class="flex flex-1">
<div class=" self-center ml-1 mr-3">
<svg
@@ -198,12 +196,20 @@
</div>
</div>
<hr class=" border-gray-50 dark:border-gray-850 my-2.5" />
<div class="mb-3.5">
<div class="flex justify-between items-center">
<div class="flex md:self-center text-base font-medium px-0.5">
{$i18n.t('Tools')}
<div class="flex self-center w-[1px] h-6 mx-2.5 bg-gray-200 dark:bg-gray-700" />
<span class="text-base font-medium text-gray-500 dark:text-gray-300"
>{filteredItems.length}</span
>
</div>
</div>
</div>
<div class="my-3 mb-5">
{#each $tools.filter((t) => query === '' || t.name
.toLowerCase()
.includes(query.toLowerCase()) || t.id.toLowerCase().includes(query.toLowerCase())) as tool}
{#each filteredItems as tool}
<div
class=" flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-xl"
>