Formatting

This commit is contained in:
Kiril Videlov 2023-02-24 12:43:18 +01:00
parent be901c11a3
commit e8a77b7d50
2 changed files with 233 additions and 271 deletions

View File

@ -1,18 +1,18 @@
<script lang="ts">
import "../app.postcss";
import '../app.postcss';
import { Toaster } from "svelte-french-toast";
import type { LayoutData } from "./$types";
import { BackForwardButtons } from "$lib/components";
import { setContext } from "svelte";
import { writable } from "svelte/store";
import Breadcrumbs from "$lib/components/Breadcrumbs.svelte";
import { Toaster } from 'svelte-french-toast';
import type { LayoutData } from './$types';
import { BackForwardButtons } from '$lib/components';
import { setContext } from 'svelte';
import { writable } from 'svelte/store';
import Breadcrumbs from '$lib/components/Breadcrumbs.svelte';
export let data: LayoutData;
const { user, posthog } = data;
setContext("project", writable(null));
setContext("session", writable(null));
setContext('project', writable(null));
setContext('session', writable(null));
user.subscribe(posthog.identify);
</script>
@ -27,17 +27,10 @@
</div>
<div class="ml-6"><Breadcrumbs /></div>
<div class="flex-grow" />
<a
href="/users/"
class="flex items-center gap-2 mr-4 font-medium hover:text-zinc-200"
>
<a href="/users/" class="flex items-center gap-2 mr-4 font-medium hover:text-zinc-200">
{#if $user}
{#if $user.picture}
<img
class="inline-block w-6 h-6 rounded-full"
src={$user.picture}
alt="Avatar"
/>
<img class="inline-block w-6 h-6 rounded-full" src={$user.picture} alt="Avatar" />
{/if}
<span>{$user.name}</span>
{:else}

View File

@ -1,7 +1,7 @@
<script lang="ts">
import FaFolderOpen from "svelte-icons/fa/FaFolderOpen.svelte";
import { open } from "@tauri-apps/api/dialog";
import type { LayoutData } from "./$types";
import FaFolderOpen from 'svelte-icons/fa/FaFolderOpen.svelte';
import { open } from '@tauri-apps/api/dialog';
import type { LayoutData } from './$types';
export let data: LayoutData;
const { projects } = data;
@ -9,13 +9,11 @@
const onAddLocalRepositoryClick = async () => {
const selectedPath = await open({
directory: true,
recursive: true,
recursive: true
});
if (selectedPath === null) return;
if (Array.isArray(selectedPath) && selectedPath.length !== 1) return;
const projectPath = Array.isArray(selectedPath)
? selectedPath[0]
: selectedPath;
const projectPath = Array.isArray(selectedPath) ? selectedPath[0] : selectedPath;
const projectExists = $projects.some((p) => p.path === projectPath);
if (projectExists) return;
@ -32,18 +30,14 @@
<div class="flex flex-col space-y-4 content-center p-4">
<div class="text-xl text-zinc-300 p-0 m-0">
<div class="font-bold">Welcome to GitButler.</div>
<div class="text-lg text-zinc-300 mb-1">
More than just version control.
</div>
<div class="text-lg text-zinc-300 mb-1">More than just version control.</div>
</div>
<div class="">
GitButler is a tool to help you manage all the local
work you do on your code projects.
GitButler is a tool to help you manage all the local work you do on your code projects.
</div>
<div class="">
Think of us as a <strong>code concierge</strong>, a
smart assistant for all the coding related tasks you
need to do every day.
Think of us as a <strong>code concierge</strong>, a smart assistant for all the coding
related tasks you need to do every day.
</div>
<ul class="text-zinc-400 pt-2 pb-4 space-y-4">
<li class="flex flex-row space-x-3">
@ -63,8 +57,7 @@
</svg>
<span class="text-zinc-200"
>Automatically recording everything you do in
any of your butlered projects.</span
>Automatically recording everything you do in any of your butlered projects.</span
>
</li>
<li class="flex flex-row space-x-3">
@ -84,9 +77,8 @@
</svg>
<span class="text-zinc-200"
>Simplifying all your Git work, including
committing, branching and pushing, to be easy
and intuitive.
>Simplifying all your Git work, including committing, branching and pushing, to be
easy and intuitive.
</span>
</li>
<li class="flex flex-row space-x-3">
@ -106,9 +98,8 @@
</svg>
<span class="text-zinc-200"
>Helping you not just search for strings or past
commits, but find useful context in the story of
your code.
>Helping you not just search for strings or past commits, but find useful context in
the story of your code.
</span>
</li>
</ul>
@ -139,12 +130,8 @@
d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"
/>
</svg>
<h3 class="mt-2 text-lg font-semibold text-zinc-300">
No projects
</h3>
<p class="mt-1 text-gray-500">
Get started by tracking a project you're working on.
</p>
<h3 class="mt-2 text-lg font-semibold text-zinc-300">No projects</h3>
<p class="mt-1 text-gray-500">Get started by tracking a project you're working on.</p>
<div class="mt-6">
<button
on:click={onAddLocalRepositoryClick}
@ -163,8 +150,7 @@
<div class="text-xl text-zinc-300 mb-1">
My Projects
<div class="text-lg text-zinc-500 mb-1">
All the projects that I am currently helping you
with.
All the projects that I am currently helping you with.
</div>
</div>
<div>
@ -178,18 +164,13 @@
</div>
</div>
<div class="h-full max-h-screen overflow-auto">
<div
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mt-4"
>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mt-4">
{#each $projects as project}
<div
class="flex flex-col justify-between space-y-1 bg-zinc-700 rounded-lg shadow"
>
<div class="flex flex-col justify-between space-y-1 bg-zinc-700 rounded-lg shadow">
<div class="px-4 py-4 flex-grow-0">
<a
class="hover:text-zinc-200 text-zinc-300 text-lg"
href="/projects/{project.id}/"
>{project.title}</a
href="/projects/{project.id}/">{project.title}</a
>
<div class="text-zinc-500 font-mono">
{project.path}
@ -199,26 +180,14 @@
class="flex-grow-0 text-zinc-500 font-mono border-t border-zinc-600 bg-zinc-600 rounded-b-lg px-3 py-1"
>
{#if project.api}
<div
class="flex flex-row items-center space-x-2 "
>
<div
class="w-2 h-2 bg-green-700 rounded-full"
/>
<div class="text-zinc-400">
syncing
</div>
<div class="flex flex-row items-center space-x-2 ">
<div class="w-2 h-2 bg-green-700 rounded-full" />
<div class="text-zinc-400">syncing</div>
</div>
{:else}
<div
class="flex flex-row items-center space-x-2 "
>
<div
class="w-2 h-2 bg-gray-400 rounded-full"
/>
<div class="text-zinc-400">
offline
</div>
<div class="flex flex-row items-center space-x-2 ">
<div class="w-2 h-2 bg-gray-400 rounded-full" />
<div class="text-zinc-400">offline</div>
</div>
{/if}
</div>