Skip to content

Commit

Permalink
Small improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlurak committed Jun 23, 2024
1 parent 51c0cdb commit f606142
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import Modal from '$lib/components/modal/Modal.svelte';
import Store from '$lib/components/utils/Store.svelte';
import { currentCustomDate, sort } from '$lib/utils/dates/custom';
import { useAuth } from '$lib/utils/store/auth';
export let assignment: Assignment;
export let school: string;
Expand All @@ -30,15 +31,13 @@
const state: Writable<State> = writable({ view: 'read' });
const userDetails = svocal('dlool.ownUserDetails');
const transparencyOfOverdue = svocal('settings.homework.transparency');
$: hasEditRights = $userDetails?.classes.some(({ name, school: schoolObj }) => {
const classMatches = assignment.class.name === name;
const schoolMatches = school === schoolObj.name;
const queryStore = writable({ school, classes: [assignment.class.name] });
$: queryStore.update((props) => ({ ...props, school }));
$: queryStore.update((props) => ({ ...props, classes: [assignment.class.name] }));
return classMatches && schoolMatches;
});
const { isLoggedIn, isInClass } = useAuth({ query: queryStore });
$: isOverdue = sort(assignment.due, currentCustomDate()) === -1;
Expand All @@ -56,7 +55,7 @@
>
<ReadAssignmentBox {assignment} />

{#if hasEditRights}
{#if $isInClass && $isLoggedIn}
<div class="flex w-full justify-evenly pt-2">
<QuickAction
icon={Trash}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/panes/Panes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<div class="h-full w-1 rounded-full bg-zinc-200 touch:w-1.5 dark:bg-zinc-700" />
</button>

<div class="flex w-full max-w-full overflow-hidden">
<div class="flex w-full max-w-full overflow-hidden p-1">
<slot name="b" />
</div>
</div>
Expand Down
18 changes: 10 additions & 8 deletions src/lib/components/select/NotTyppable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { flip, offset, shift } from '@floating-ui/core';
import { createFloatingActions } from 'svelte-floating-ui';
import { ChevronDown } from 'svelte-hero-icons';
import { ChevronDown, Icon } from 'svelte-hero-icons';
import QuickAction from '../buttons/QuickAction.svelte';
import Frame from '../input/Frame.svelte';
import type { Readable } from 'svelte/store';
Expand Down Expand Up @@ -50,13 +50,15 @@
<Store store={i('select.select')} />
{/if}

<QuickAction
small
icon={ChevronDown}
on:click={() => {
showOptions = !showOptions;
}}
/>
<div
class="
rounded p-1
hover:bg-zinc-200 focus:bg-zinc-200
dark:hover:bg-zinc-800 dark:focus:bg-zinc-800
"
>
<Icon src={ChevronDown} micro class="h-5 w-5" />
</div>
</button>
</Frame>

Expand Down

0 comments on commit f606142

Please sign in to comment.