mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
IconEntryButton 컴포넌트 추가
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
import { untrack } from "svelte";
|
||||
import { get, type Writable } from "svelte/store";
|
||||
import { goto } from "$app/navigation";
|
||||
import { EntryButton, FullscreenDiv } from "$lib/components/atoms";
|
||||
import { TopBar } from "$lib/components/molecules";
|
||||
import { FullscreenDiv } from "$lib/components/atoms";
|
||||
import { IconEntryButton, TopBar } from "$lib/components/molecules";
|
||||
import {
|
||||
getFileInfo,
|
||||
getCategoryInfo,
|
||||
@@ -151,12 +151,15 @@
|
||||
onCategoryClick={({ id }) => goto(`/category/${id}`)}
|
||||
onCategoryMenuClick={({ id }) => removeFromCategory(id)}
|
||||
/>
|
||||
<EntryButton onclick={() => (isAddToCategoryBottomSheetOpen = true)} class="w-full">
|
||||
<div class="flex h-8 items-center gap-x-4">
|
||||
<IconAddCircle class="text-lg text-gray-600" />
|
||||
<p class="font-medium text-gray-700">카테고리에 추가하기</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<IconEntryButton
|
||||
icon={IconAddCircle}
|
||||
onclick={() => (isAddToCategoryBottomSheetOpen = true)}
|
||||
class="h-12 w-full"
|
||||
iconClass="text-gray-600"
|
||||
textClass="text-gray-700"
|
||||
>
|
||||
카테고리에 추가하기
|
||||
</IconEntryButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { BottomSheet } from "$lib/components";
|
||||
import { EntryButton } from "$lib/components/atoms";
|
||||
import { CategoryLabel, IconEntryButton } from "$lib/components/molecules";
|
||||
import { useContext } from "./service.svelte";
|
||||
|
||||
import IconCategory from "~icons/material-symbols/category";
|
||||
import IconEdit from "~icons/material-symbols/edit";
|
||||
import IconDelete from "~icons/material-symbols/delete";
|
||||
|
||||
@@ -21,27 +20,14 @@
|
||||
{@const { name } = context.selectedCategory}
|
||||
<BottomSheet bind:isOpen>
|
||||
<div class="w-full py-4">
|
||||
<div class="flex h-12 items-center gap-x-4 p-2">
|
||||
<div class="flex-shrink-0 text-lg">
|
||||
<IconCategory />
|
||||
</div>
|
||||
<p title={name} class="flex-grow truncate font-semibold">
|
||||
{name}
|
||||
</p>
|
||||
</div>
|
||||
<CategoryLabel {name} class="h-12 p-2" textClass="!font-semibold" />
|
||||
<div class="my-2 h-px w-full bg-gray-200"></div>
|
||||
<EntryButton onclick={onRenameClick} class="w-full">
|
||||
<div class="flex h-8 items-center gap-x-4">
|
||||
<IconEdit class="text-lg" />
|
||||
<p class="font-medium">이름 바꾸기</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<EntryButton onclick={onDeleteClick} class="w-full">
|
||||
<div class="flex h-8 items-center gap-x-4 text-red-500">
|
||||
<IconDelete class="text-lg" />
|
||||
<p class="font-medium">삭제하기</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<IconEntryButton icon={IconEdit} onclick={onRenameClick} class="h-12 w-full">
|
||||
이름 바꾸기
|
||||
</IconEntryButton>
|
||||
<IconEntryButton icon={IconDelete} onclick={onDeleteClick} class="h-12 w-full text-red-500">
|
||||
삭제하기
|
||||
</IconEntryButton>
|
||||
</div>
|
||||
</BottomSheet>
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { BottomSheet } from "$lib/components";
|
||||
import { EntryButton } from "$lib/components/atoms";
|
||||
import { IconEntryButton } from "$lib/components/molecules";
|
||||
|
||||
import IconCreateNewFolder from "~icons/material-symbols/create-new-folder";
|
||||
import IconUploadFile from "~icons/material-symbols/upload-file";
|
||||
@@ -16,17 +16,21 @@
|
||||
|
||||
<BottomSheet bind:isOpen>
|
||||
<div class="w-full py-4">
|
||||
<EntryButton onclick={onDirectoryCreateClick} class="w-full">
|
||||
<div class="flex h-12 items-center gap-x-4">
|
||||
<IconCreateNewFolder class="text-2xl text-yellow-500" />
|
||||
<p class="font-medium">폴더 만들기</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<EntryButton onclick={onFileUploadClick} class="w-full">
|
||||
<div class="flex h-12 items-center gap-x-4">
|
||||
<IconUploadFile class="text-2xl text-blue-400" />
|
||||
<p class="font-medium">파일 업로드</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<IconEntryButton
|
||||
icon={IconCreateNewFolder}
|
||||
onclick={onDirectoryCreateClick}
|
||||
class="h-16 w-full"
|
||||
iconClass="!text-2xl text-yellow-500"
|
||||
>
|
||||
폴더 만들기
|
||||
</IconEntryButton>
|
||||
<IconEntryButton
|
||||
icon={IconUploadFile}
|
||||
onclick={onFileUploadClick}
|
||||
class="h-16 w-full"
|
||||
iconClass="!text-2xl text-blue-400"
|
||||
>
|
||||
파일 업로드
|
||||
</IconEntryButton>
|
||||
</div>
|
||||
</BottomSheet>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { BottomSheet } from "$lib/components";
|
||||
import { EntryButton } from "$lib/components/atoms";
|
||||
import { DirectoryEntryLabel, IconEntryButton } from "$lib/components/molecules";
|
||||
import { useContext } from "./service.svelte";
|
||||
|
||||
import IconFolder from "~icons/material-symbols/folder";
|
||||
import IconDraft from "~icons/material-symbols/draft";
|
||||
import IconEdit from "~icons/material-symbols/edit";
|
||||
import IconDelete from "~icons/material-symbols/delete";
|
||||
|
||||
@@ -22,31 +20,14 @@
|
||||
{@const { name, type } = context.selectedEntry}
|
||||
<BottomSheet bind:isOpen>
|
||||
<div class="w-full py-4">
|
||||
<div class="flex h-12 items-center gap-x-4 p-2">
|
||||
<div class="flex-shrink-0 text-lg">
|
||||
{#if type === "directory"}
|
||||
<IconFolder />
|
||||
{:else}
|
||||
<IconDraft class="text-blue-400" />
|
||||
{/if}
|
||||
</div>
|
||||
<p title={name} class="flex-grow truncate font-semibold">
|
||||
{name}
|
||||
</p>
|
||||
</div>
|
||||
<DirectoryEntryLabel {type} {name} class="h-12 p-2" textClass="!font-semibold" />
|
||||
<div class="my-2 h-px w-full bg-gray-200"></div>
|
||||
<EntryButton onclick={onRenameClick} class="w-full">
|
||||
<div class="flex h-8 items-center gap-x-4">
|
||||
<IconEdit class="text-lg" />
|
||||
<p class="font-medium">이름 바꾸기</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<EntryButton onclick={onDeleteClick} class="w-full">
|
||||
<div class="flex h-8 items-center gap-x-4 text-red-500">
|
||||
<IconDelete class="text-lg" />
|
||||
<p class="font-medium">삭제하기</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<IconEntryButton icon={IconEdit} onclick={onRenameClick} class="h-12 w-full">
|
||||
이름 바꾸기
|
||||
</IconEntryButton>
|
||||
<IconEntryButton icon={IconDelete} onclick={onDeleteClick} class="h-12 w-full text-red-500">
|
||||
삭제하기
|
||||
</IconEntryButton>
|
||||
</div>
|
||||
</BottomSheet>
|
||||
{/if}
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
<script lang="ts">
|
||||
import type { Component, Snippet } from "svelte";
|
||||
import type { SvelteHTMLElements } from "svelte/elements";
|
||||
import { EntryButton } from "$lib/components/atoms";
|
||||
import type { ClassValue, SvelteHTMLElements } from "svelte/elements";
|
||||
import { IconEntryButton } from "$lib/components/molecules";
|
||||
|
||||
interface Props {
|
||||
children: Snippet;
|
||||
icon: Component<SvelteHTMLElements["svg"]>;
|
||||
iconColor: string;
|
||||
iconColor: ClassValue;
|
||||
onclick: () => void;
|
||||
}
|
||||
|
||||
let { children, icon: Icon, iconColor, onclick }: Props = $props();
|
||||
let { children, icon, iconColor, onclick }: Props = $props();
|
||||
</script>
|
||||
|
||||
<EntryButton {onclick} class="w-full">
|
||||
<div class="flex items-center gap-x-4">
|
||||
<div class="rounded-lg bg-gray-200 p-1 {iconColor}">
|
||||
<Icon />
|
||||
</div>
|
||||
<p class="font-medium">
|
||||
{@render children?.()}
|
||||
</p>
|
||||
</div>
|
||||
</EntryButton>
|
||||
<IconEntryButton
|
||||
{icon}
|
||||
{onclick}
|
||||
class="w-full"
|
||||
iconClass={["rounded-lg bg-gray-200 p-1 !text-base", iconColor]}
|
||||
>
|
||||
{@render children?.()}
|
||||
</IconEntryButton>
|
||||
|
||||
Reference in New Issue
Block a user