Skip to content

Commit

Permalink
fix(Dropdown): cleaned up needless context
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Nov 20, 2022
1 parent 264cea7 commit c3380bc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
10 changes: 0 additions & 10 deletions src/lib/components/dropdown/Dropdown.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<script lang="ts" context="module">
export const DROPDOWN_CONTEXT_ID = 'dropdown-context-id';
</script>

<script lang="ts">
import { setContext } from 'svelte';
import { twMerge } from 'tailwind-merge';
import { clickOutside } from '../../actions';
import { get_current_component } from 'svelte/internal';
Expand All @@ -12,17 +7,12 @@
import { exclude } from '../../utils/exclude';
const forwardEvents = forwardEventsBuilder(get_current_component());
// export let handleClose: () => void;
export let visible = false;
function handleClose() {
visible = false;
}
setContext(DROPDOWN_CONTEXT_ID, {
dropdown: true
});
const defaultClass = 'relative inline-block';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>
Expand Down
8 changes: 0 additions & 8 deletions src/lib/components/dropdown/Item.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script lang="ts">
import { DROPDOWN_CONTEXT_ID } from './Dropdown.svelte';
import HoverBackground from '../HoverBackground.svelte';
import { useContext } from '../../utils/useContext';
import { twMerge } from 'tailwind-merge';
import { get_current_component } from 'svelte/internal';
import { forwardEventsBuilder, useActions, type ActionArray } from '../../actions';
Expand All @@ -11,12 +9,6 @@
export let label: string;
useContext({
context_id: DROPDOWN_CONTEXT_ID,
parent: 'Dropdown',
component: 'DropdownItem'
});
const defaultClass =
'w-full group relative flex items-center px-3 py-2 text-sm font-medium rounded-md overflow-hidden text-light-secondary-content dark:text-dark-secondary-content';
$: finalClass = twMerge(defaultClass, $$props.class);
Expand Down

0 comments on commit c3380bc

Please sign in to comment.