FloatingActionButton 컴포넌트 리팩토링 2

This commit is contained in:
static
2025-01-28 22:59:22 +09:00
parent d2aca276ac
commit 183ce583b0
2 changed files with 6 additions and 6 deletions

View File

@@ -4,12 +4,12 @@
import { AdaptiveDiv } from "$lib/components/atoms"; import { AdaptiveDiv } from "$lib/components/atoms";
interface Props { interface Props {
class: ClassValue;
icon: Component<SvelteHTMLElements["svg"]>; icon: Component<SvelteHTMLElements["svg"]>;
offset: ClassValue;
onclick?: () => void; onclick?: () => void;
} }
let { icon: Icon, offset, onclick }: Props = $props(); let { class: className, icon: Icon, onclick }: Props = $props();
</script> </script>
<div class="pointer-events-none fixed inset-0"> <div class="pointer-events-none fixed inset-0">
@@ -17,11 +17,11 @@
<button <button
onclick={onclick && (() => setTimeout(onclick, 100))} onclick={onclick && (() => setTimeout(onclick, 100))}
class={[ class={[
"pointer-events-auto absolute bottom-4 right-4 flex h-14 w-14 items-center justify-center rounded-full bg-gray-300 shadow-lg transition active:scale-95 active:bg-gray-400", "pointer-events-auto absolute flex h-14 w-14 items-center justify-center rounded-full bg-gray-300 text-xl shadow-lg transition active:scale-95 active:bg-gray-400",
offset, className,
]} ]}
> >
<Icon class="text-xl" /> <Icon />
</button> </button>
</AdaptiveDiv> </AdaptiveDiv>
</div> </div>

View File

@@ -110,11 +110,11 @@
</div> </div>
<FloatingButton <FloatingButton
offset="bottom-24 right-4"
icon={IconAdd} icon={IconAdd}
onclick={() => { onclick={() => {
isEntryCreateBottomSheetOpen = true; isEntryCreateBottomSheetOpen = true;
}} }}
class="bottom-24 right-4"
/> />
<EntryCreateBottomSheet <EntryCreateBottomSheet
bind:isOpen={isEntryCreateBottomSheetOpen} bind:isOpen={isEntryCreateBottomSheetOpen}