From 1817879788e9c6bad9f80fea88a3a9e666669680 Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Sun, 17 Mar 2024 18:55:55 +0100 Subject: [PATCH] refactor: replace empty state images with SVG --- .../src/lib/assets/empty-state/lane-new.svg | 14 ++++++++ .../assets/empty-state/lane-no-changes.svg | 11 ++++++ .../lib/assets/empty-state/no-branches.svg | 30 ++++++++++++++++ .../src/lib/components/BranchCard.svelte | 33 +++--------------- .../src/lib/components/Branches.svelte | 16 ++------- gitbutler-ui/static/images/lane-new-dark.webp | Bin 4742 -> 0 bytes .../static/images/lane-new-light.webp | Bin 4590 -> 0 bytes .../static/images/lane-no-changes-dark.webp | Bin 5468 -> 0 bytes .../static/images/lane-no-changes-light.webp | Bin 6084 -> 0 bytes .../static/images/no-branches-dark.webp | Bin 2356 -> 0 bytes .../static/images/no-branches-light.webp | Bin 2268 -> 0 bytes 11 files changed, 62 insertions(+), 42 deletions(-) create mode 100644 gitbutler-ui/src/lib/assets/empty-state/lane-new.svg create mode 100644 gitbutler-ui/src/lib/assets/empty-state/lane-no-changes.svg create mode 100644 gitbutler-ui/src/lib/assets/empty-state/no-branches.svg delete mode 100644 gitbutler-ui/static/images/lane-new-dark.webp delete mode 100644 gitbutler-ui/static/images/lane-new-light.webp delete mode 100644 gitbutler-ui/static/images/lane-no-changes-dark.webp delete mode 100644 gitbutler-ui/static/images/lane-no-changes-light.webp delete mode 100644 gitbutler-ui/static/images/no-branches-dark.webp delete mode 100644 gitbutler-ui/static/images/no-branches-light.webp diff --git a/gitbutler-ui/src/lib/assets/empty-state/lane-new.svg b/gitbutler-ui/src/lib/assets/empty-state/lane-new.svg new file mode 100644 index 000000000..93a1c9b64 --- /dev/null +++ b/gitbutler-ui/src/lib/assets/empty-state/lane-new.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/gitbutler-ui/src/lib/assets/empty-state/lane-no-changes.svg b/gitbutler-ui/src/lib/assets/empty-state/lane-no-changes.svg new file mode 100644 index 000000000..7d8b20d3f --- /dev/null +++ b/gitbutler-ui/src/lib/assets/empty-state/lane-no-changes.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/gitbutler-ui/src/lib/assets/empty-state/no-branches.svg b/gitbutler-ui/src/lib/assets/empty-state/no-branches.svg new file mode 100644 index 000000000..879e4d6a0 --- /dev/null +++ b/gitbutler-ui/src/lib/assets/empty-state/no-branches.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gitbutler-ui/src/lib/components/BranchCard.svelte b/gitbutler-ui/src/lib/components/BranchCard.svelte index 7037bc534..658a609d9 100644 --- a/gitbutler-ui/src/lib/components/BranchCard.svelte +++ b/gitbutler-ui/src/lib/components/BranchCard.svelte @@ -6,9 +6,10 @@ import DropzoneOverlay from './DropzoneOverlay.svelte'; import PullRequestCard from './PullRequestCard.svelte'; import ScrollableContainer from './ScrollableContainer.svelte'; + import laneNewSvg from '$lib/assets/empty-state/lane-new.svg?raw'; + import noChangesSvg from '$lib/assets/empty-state/lane-no-changes.svg?raw'; import { ButlerAIProvider } from '$lib/backend/aiProviders'; import { Summarizer } from '$lib/backend/summarizer'; - import ImgThemed from '$lib/components/ImgThemed.svelte'; import Resizer from '$lib/components/Resizer.svelte'; import { projectAiGenAutoBranchNamingEnabled } from '$lib/config/config'; import { projectAiGenEnabled } from '$lib/config/config'; @@ -283,12 +284,7 @@
- + {@html laneNewSvg}

This is a new branch. @@ -303,12 +299,7 @@
- + {@html noChangesSvg}

No uncommitted changes
on this branch @@ -345,22 +336,6 @@ />

-

{/if} diff --git a/gitbutler-ui/src/lib/components/Branches.svelte b/gitbutler-ui/src/lib/components/Branches.svelte index c7d8544e0..5874b2cd3 100644 --- a/gitbutler-ui/src/lib/components/Branches.svelte +++ b/gitbutler-ui/src/lib/components/Branches.svelte @@ -1,9 +1,9 @@