From 35addf5a778037618c5a79b4d43b45f0f1c3f1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Sun, 23 Jun 2024 15:16:48 +0200 Subject: [PATCH] refactor: extract commit body to an atom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to reduce the complexity of a component I broke out the body part of a commit into its own component. Signed-off-by: André Jaenisch --- src/lib/components/atoms/CommitBody.svelte | 65 +++++++ src/lib/components/molecules/History.svelte | 54 +----- tests/components/atoms/CommitBody.test.ts | 180 ++++++++++++++++++++ 3 files changed, 251 insertions(+), 48 deletions(-) create mode 100644 src/lib/components/atoms/CommitBody.svelte create mode 100644 tests/components/atoms/CommitBody.test.ts diff --git a/src/lib/components/atoms/CommitBody.svelte b/src/lib/components/atoms/CommitBody.svelte new file mode 100644 index 0000000..03b5b68 --- /dev/null +++ b/src/lib/components/atoms/CommitBody.svelte @@ -0,0 +1,65 @@ + + + + +
+ +
+ {commit.name} + {$_(i18n.relative_time, { + values: { relativeTime: $date(new Date(commit.committed)) } + })} +
+ +
+ + + +
+ +
+ +
+
diff --git a/src/lib/components/molecules/History.svelte b/src/lib/components/molecules/History.svelte index e81fa19..bb038a0 100644 --- a/src/lib/components/molecules/History.svelte +++ b/src/lib/components/molecules/History.svelte @@ -13,7 +13,9 @@ You should have received a copy of the GNU Affero General Public License along w