mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 01:17:37 +03:00
Add scrollbar to project selector
This commit is contained in:
parent
4af41d639d
commit
444b15631a
@ -12,26 +12,8 @@
|
||||
{#if !$projects$}
|
||||
Loading...
|
||||
{:else}
|
||||
<div class="absolute h-4 w-full" data-tauri-drag-region></div>
|
||||
<div class="homepage">
|
||||
<div class="homepage__content">
|
||||
<SelectProject projects={$projects$} user={$user$} />
|
||||
</div>
|
||||
</div>
|
||||
<SelectProject projects={$projects$} user={$user$} />
|
||||
{/if}
|
||||
|
||||
<style lang="postcss">
|
||||
.homepage {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.homepage__content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 420px;
|
||||
gap: var(--space-8);
|
||||
}
|
||||
</style>
|
||||
|
@ -5,23 +5,32 @@
|
||||
import * as events from '$lib/utils/events';
|
||||
import AccountLink from '$lib/components/AccountLink.svelte';
|
||||
import type { User } from '$lib/backend/cloud';
|
||||
import Scrollbar from '$lib/components/Scrollbar.svelte';
|
||||
|
||||
export let projects: Project[] | undefined;
|
||||
export let user: User | undefined;
|
||||
|
||||
let viewport: HTMLElement | undefined;
|
||||
let contents: HTMLElement | undefined;
|
||||
</script>
|
||||
|
||||
<div class="projects card">
|
||||
<div class="card__header">
|
||||
<span class="card__title text-base-14 font-semibold">Projects</span>
|
||||
</div>
|
||||
<div class="card__content">
|
||||
{#if projects && projects.length > 0}
|
||||
{#each projects || [] as project}
|
||||
<SelectProjectItem {project} />
|
||||
{/each}
|
||||
{:else}
|
||||
<pre>Go ahead and add your first project. :)</pre>
|
||||
{/if}
|
||||
<div class="scroll-wrapper">
|
||||
<div bind:this={viewport} class="viewport hide-native-scrollbar">
|
||||
<div bind:this={contents} class="card__content">
|
||||
{#if projects && projects.length > 0}
|
||||
{#each projects || [] as project}
|
||||
<SelectProjectItem {project} />
|
||||
{/each}
|
||||
{:else}
|
||||
<pre>Go ahead and add your first project. :)</pre>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<Scrollbar {viewport} {contents} alwaysVisible thickness="0.4rem" opacity="0.1" />
|
||||
</div>
|
||||
<div class="card__footer">
|
||||
<IconButton icon="plus" on:click={() => events.emit('openNewProjectModal')}></IconButton>
|
||||
@ -31,9 +40,21 @@
|
||||
|
||||
<style lang="postcss">
|
||||
.projects {
|
||||
align-self: center;
|
||||
max-width: 640px;
|
||||
max-height: 65%;
|
||||
}
|
||||
.scroll-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.viewport {
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
.card__content {
|
||||
gap: var(--space-6);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user