Delete unused components

This commit is contained in:
Mattias Granlund 2024-01-29 14:42:35 +01:00
parent 1eb0ba432a
commit 9d762f295d
4 changed files with 0 additions and 178 deletions

View File

@ -1,56 +0,0 @@
<script lang="ts">
import SelectProjectItem from './SelectProjectItem.svelte';
import AccountLink from '$lib/components/AccountLink.svelte';
import IconButton from '$lib/components/IconButton.svelte';
import ScrollableContainer from '$lib/components/ScrollableContainer.svelte';
import type { User } from '$lib/backend/cloud';
import type { ProjectService } from '$lib/backend/projects';
export let user: User | undefined;
export let loading = false;
export let projectService: ProjectService;
$: projects$ = projectService.projects$;
</script>
<div class="projects card">
<div class="card__header">
<span class="card__title text-base-14 font-semibold">Projects</span>
</div>
<ScrollableContainer initiallyVisible>
{#if $projects$?.length > 0}
{#each $projects$ as project}
<SelectProjectItem {project} />
{/each}
{:else}
<pre class="empty-message">Go ahead and add your first project. :)</pre>
{/if}
</ScrollableContainer>
<div class="card__footer">
<IconButton
icon="plus"
{loading}
on:click={async () => {
loading = true;
try {
await projectService.addProject();
} finally {
loading = false;
}
}}
></IconButton>
<AccountLink {user} />
</div>
</div>
<style lang="postcss">
.projects {
align-self: center;
max-width: 640px;
max-height: 65%;
}
.empty-message {
padding: var(--space-12) var(--space-16);
}
</style>

View File

@ -1,57 +0,0 @@
<script lang="ts">
import IconButton from '$lib/components/IconButton.svelte';
import type { Project } from '$lib/backend/projects';
import { goto } from '$app/navigation';
export let project: Project;
</script>
<a class="project text-base-12" href="/{project.id}/board">
<div class="project__info">
<h1 class="text-base-13">
{project.title}
</h1>
<p class="text-base-12">
{project.path}
</p>
</div>
<div class="project__actions">
<IconButton
icon="settings"
on:click={(e) => {
e.stopPropagation();
e.preventDefault();
goto(`/${project.id}/settings`);
}}
/>
</div>
</a>
<style lang="postcss">
.project {
display: flex;
gap: var(--space-12);
align-items: center;
justify-content: space-between;
border-radius: var(--radius-m);
padding: var(--space-4) var(--space-6);
&:hover {
background: var(--clr-theme-container-pale);
}
}
.project__info {
padding: var(--space-4) var(--space-6);
display: flex;
flex-direction: column;
gap: var(--space-8);
& h1 {
color: var(--clr-theme-scale-ntrl-30);
}
& p {
color: var(--clr-theme-scale-ntrl-40);
}
}
.project__actions {
}
</style>

View File

@ -1,28 +0,0 @@
<script lang="ts">
import IconChevronRight from '$lib/icons/IconChevronRight.svelte';
import IconGithub from '$lib/icons/IconGithub.svelte';
export let projectId: string;
export let projectTitle: string;
export let isGitHub: boolean;
// Optional page title as a prop instead of a slot to ensure header is always draggable
export let pageTitle: string | undefined = undefined;
</script>
<!-- data-tauri-drag-region needs to be on all elements recursively https://github.com/tauri-apps/tauri/issues/1656#issuecomment-1178574760 -->
<div class="flex items-center justify-center gap-x-1 py-2" data-tauri-drag-region>
<div class="relative flex items-center gap-x-1" data-tauri-drag-region>
{#if isGitHub}
<IconGithub class="h-4 w-4" data-tauri-drag-region></IconGithub>
{/if}
<a data-tauri-drag-region class="cursor-default font-semibold" href={`/${projectId}/board`}>
{projectTitle}</a
>
<!-- Center only the project title to avoid content shift during navigatin -->
<div class="absolute left-full flex items-center whitespace-nowrap" data-tauri-drag-region>
{#if pageTitle}
<IconChevronRight class="h-4 w-4" data-tauri-drag-region></IconChevronRight>
{pageTitle}
{/if}
</div>
</div>
</div>

View File

@ -1,37 +0,0 @@
<script lang="ts">
import Icon from '$lib/icons/Icon.svelte';
import { slide } from 'svelte/transition';
import type { Branch } from '$lib/vbranches/types';
import { page } from '$app/stores';
export let branch: Branch;
export let projectId: string;
$: href = `/${projectId}/stashed/${branch.id}`;
$: selected = $page.url.href.includes(href);
</script>
<a class="item" {href} class:selected transition:slide={{ duration: 250 }}>
<Icon name="branch" />
<div class="text-color-2 flex-grow truncate">
{branch.name}
{branch.files[0]?.modifiedAt}
</div>
</a>
<style lang="postcss">
.item {
display: flex;
gap: var(--space-10);
padding-top: var(--space-10);
padding-bottom: var(--space-10);
padding-left: var(--space-8);
padding-right: var(--space-8);
border-radius: var(--radius-m);
}
.item:hover,
.item:focus,
.selected {
background-color: var(--clr-theme-container-pale);
}
</style>