mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-15 06:18:48 +00:00
FloatingActionButton 컴포넌트 리팩토링 2
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user