Skip to content

Commit

Permalink
chore: update runed dependency to version 0.23.2 and refactor MediaQu…
Browse files Browse the repository at this point in the history
…ery usage (#87)

Co-authored-by: Davis SHYAKA <[email protected]>
  • Loading branch information
shyakadavis and shyakadavis authored Feb 4, 2025
1 parent 0f4aa00 commit f92d9d4
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"runed": "^0.15.4",
"runed": "^0.23.2",
"shiki": "^2.3.0",
"svelte": "5.19.7",
"svelte-check": "^4.1.4",
Expand Down
14 changes: 2 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/lib/components/shared/command/command.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as Drawer from '$lib/components/ui/drawer';
import { aside_items } from '$lib/config/sitemap';
import { command_open_state } from '$lib/stores';
import { MediaQuery } from 'runed';
import { MediaQuery } from 'svelte/reactivity';
const is_desktop = new MediaQuery('(min-width: 640px)');
Expand All @@ -20,7 +20,7 @@

<svelte:document onkeydown={doc_keydown} />

{#if is_desktop.matches}
{#if is_desktop.current}
<Command.Dialog bind:open={$command_open_state} close_button="esc" class="w-full max-w-[640px]">
<Command.Input placeholder="Search..." class="h-[53px] px-2 text-lg" hide_search_icon />
<Command.List class="h-[436px] max-h-none">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MediaQuery } from 'runed';
import { MediaQuery } from 'svelte/reactivity';
import { writable } from 'svelte/store';
import ModalContent from './modal-content.svelte';
import ModalDescription from './modal-description.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
});
</script>

{#if is_desktop.matches}
{#if is_desktop.current}
<Dialog.Content
bind:ref
class={cn(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal-description.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
let { children }: Props = $props();
</script>

{#if is_desktop.matches}
{#if is_desktop.current}
<Dialog.Description class="text-base text-gray-1000">
{@render children?.()}
</Dialog.Description>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal-footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
});
</script>

{#if is_desktop.matches}
{#if is_desktop.current}
<Dialog.Footer
class="sticky bottom-0 rounded-b-[inherit] border-t bg-background-200 px-6 py-3 dark:bg-background-100 sm:justify-between"
>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal-header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let { children }: Props = $props();
</script>

{#if is_desktop.matches}
{#if is_desktop.current}
<Dialog.Header
class={cn('sticky top-0 px-6 pt-6', {
'border-b bg-background-100 pb-3 pt-3': $is_overflowing || $is_single_button
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal-title.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
let { children }: Props = $props();
</script>

{#if is_desktop.matches}
{#if is_desktop.current}
<Dialog.Title class="text-2xl">
{@render children?.()}
</Dialog.Title>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal-trigger.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</script>

<!-- TODO: Is there a better way to do this? -->
{#if is_desktop.matches}
{#if is_desktop.current}
{#if child_prop}
<Dialog.Trigger class={class_name}>
{#snippet child({ props })}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/modal/modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let { open = $bindable(false), children }: Props = $props();
</script>

{#if is_desktop.matches}
{#if is_desktop.current}
<Dialog.Root bind:open>
{@render children?.()}
</Dialog.Root>
Expand Down

0 comments on commit f92d9d4

Please sign in to comment.