From c7342b1cdf7689f4306ad144ae44b8da85970918 Mon Sep 17 00:00:00 2001 From: Pavel Laptev Date: Mon, 14 Oct 2024 11:10:00 +0200 Subject: [PATCH] Integration modal design (#5116) * new IntegrationListItem component * Simple commit row added, componenets rename * Tweak styles and `Select` update * check fix --- apps/desktop/src/lib/commit/CommitCard.svelte | 10 +- .../components/IntegrateUpstreamModal.svelte | 403 ++++++++---------- apps/desktop/src/lib/select/Select.svelte | 4 +- .../ui/src/lib/IntegrationSeriesRow.svelte | 139 ++++++ packages/ui/src/lib/Modal.svelte | 7 +- packages/ui/src/lib/SimpleCommitRow.svelte | 114 +++++ packages/ui/src/lib/utils/getTimeAndAuthor.ts | 11 + .../DemoIntegrationSeriesRow.svelte | 27 ++ .../IntegrationSeriesRow.stories.ts | 15 + .../DemoSimpleCommitRow.svelte | 46 ++ .../SimpleCommitRow.stories.ts | 15 + .../src/stories/checkbox/Checkbox.stories.ts | 4 +- .../src/stories/fileIcon/FileIcon.stories.ts | 2 +- .../fileListItem/FileListItem.stories.ts | 6 +- packages/ui/src/styles/utility/helpers.css | 4 + 15 files changed, 571 insertions(+), 236 deletions(-) create mode 100644 packages/ui/src/lib/IntegrationSeriesRow.svelte create mode 100644 packages/ui/src/lib/SimpleCommitRow.svelte create mode 100644 packages/ui/src/lib/utils/getTimeAndAuthor.ts create mode 100644 packages/ui/src/stories/IntegrationSeriesRow/DemoIntegrationSeriesRow.svelte create mode 100644 packages/ui/src/stories/IntegrationSeriesRow/IntegrationSeriesRow.stories.ts create mode 100644 packages/ui/src/stories/SimpleCommitRow/DemoSimpleCommitRow.svelte create mode 100644 packages/ui/src/stories/SimpleCommitRow/SimpleCommitRow.stories.ts diff --git a/apps/desktop/src/lib/commit/CommitCard.svelte b/apps/desktop/src/lib/commit/CommitCard.svelte index 42c7c67fe..cf5530a08 100644 --- a/apps/desktop/src/lib/commit/CommitCard.svelte +++ b/apps/desktop/src/lib/commit/CommitCard.svelte @@ -27,6 +27,7 @@ import Icon from '@gitbutler/ui/Icon.svelte'; import Modal from '@gitbutler/ui/Modal.svelte'; import Tooltip from '@gitbutler/ui/Tooltip.svelte'; + import { getTimeAndAuthor } from '@gitbutler/ui/utils/getTimeAndAuthor'; import { getTimeAgo } from '@gitbutler/ui/utils/timeAgo'; import { type Snippet } from 'svelte'; @@ -114,12 +115,6 @@ commitMessageModal.close(); } - function getTimeAndAuthor() { - const timeAgo = getTimeAgo(commit.createdAt); - const author = type === 'localAndRemote' || type === 'remote' ? commit.author.name : 'you'; - return `${timeAgo} by ${author}`; - } - const commitShortSha = commit.id.substring(0, 7); let topHeightPx = 24; @@ -381,7 +376,8 @@ {/if} - {getTimeAndAuthor()} + + {getTimeAndAuthor(commit.createdAt, commit.author.name)} {/if} diff --git a/apps/desktop/src/lib/components/IntegrateUpstreamModal.svelte b/apps/desktop/src/lib/components/IntegrateUpstreamModal.svelte index 84a2fa933..74fd36662 100644 --- a/apps/desktop/src/lib/components/IntegrateUpstreamModal.svelte +++ b/apps/desktop/src/lib/components/IntegrateUpstreamModal.svelte @@ -1,10 +1,11 @@ - - -