Skip to content

Commit

Permalink
pnpm run format
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Feb 14, 2025
1 parent 0410bd8 commit 93ea27d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/input/impl/ButtonSettings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AnyComponent } from "$lib/types/AnyComponent";
import type { AnyComponent } from '$lib/types/AnyComponent';

export type ButtonSettings =
| { text: string; class?: string; submits?: boolean; onClick: () => void }
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/layout/AppSidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
];
function meetsReq(roles: RoleType[], group: Group) {
return group.roles?.some(role => roles.includes(role)) ?? true;
return group.roles?.some((role) => roles.includes(role)) ?? true;
}
function isPathMatch(path: string, href: string) {
return path === href || path.startsWith(href + '/');
Expand Down
4 changes: 3 additions & 1 deletion src/routes/(authenticated)/admin/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
let { children }: Props = $props();
const allowedRoles = [RoleType.Admin, RoleType.System];
let isAdmin = $derived($UserStore.self ? $UserStore.self.roles.some(role => allowedRoles.includes(role)) : false);
let isAdmin = $derived(
$UserStore.self ? $UserStore.self.roles.some((role) => allowedRoles.includes(role)) : false
);
</script>

{#if isAdmin}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
});
</script>

<div class="rounded-md border max-h-[60vh] overflow-y-auto">
<div class="max-h-[60vh] overflow-y-auto rounded-md border">
<Table.Root>
<Table.Header>
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(authenticated)/admin/users/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const columns: ColumnDef<User>[] = [
cell: ({ row }) => {
const rolesCellSnippet = createRawSnippet<[RoleType[]]>((getRoles) => {
const roles = getRoles();
const isPrivileged = [RoleType.Admin, RoleType.System].some(role => roles.includes(role));
const isPrivileged = [RoleType.Admin, RoleType.System].some((role) => roles.includes(role));
return {
render: () =>
`<div class="text-center font-medium ${isPrivileged ? 'text-blue-500' : ''}">${roles}</div>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
let editDialogOpen = $state<boolean>(false);
let deleteDialogOpen = $state<boolean>(false);
let isPrivileged = $derived([RoleType.Admin, RoleType.System].some(role => user.roles.includes(role)));
let isPrivileged = $derived(
[RoleType.Admin, RoleType.System].some((role) => user.roles.includes(role))
);
function copyId() {
navigator.clipboard.writeText(user.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<div>
<h2>Roles</h2>
<div class="border-surface-500 flex flex-col space-y-4 rounded-md border p-4">
{#each [ RoleType.Support, RoleType.Staff, RoleType.Admin, RoleType.System ] as role}
<span><Checkbox checked={user.roles.includes(role)}/> {role}</span>
{#each [RoleType.Support, RoleType.Staff, RoleType.Admin, RoleType.System] as role}
<span><Checkbox checked={user.roles.includes(role)} /> {role}</span>
{/each}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<SidebarProvider bind:open={() => isOpen && isLoggedIn, (o) => (isOpen = o)}>
<AppSidebar {currentUserRoles} />
<div class="flex flex-1 flex-col h-screen w-screen overflow-hidden">
<div class="flex h-screen w-screen flex-1 flex-col overflow-hidden">
<Header />
<main class="flex-1">
{@render children?.()}
Expand Down
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const config = {
'default-src': ['self'],
'child-src': ['https://challenges.cloudflare.com'],
'frame-src': ['https://challenges.cloudflare.com'], // Deprecated
'style-src': ['self','unsafe-inline'],
'style-src': ['self', 'unsafe-inline'],
'img-src': [
'self',
'https://www.gravatar.com',
Expand Down

0 comments on commit 93ea27d

Please sign in to comment.