From acc76294f37f6f627b39693d69a4a4ac57d43d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Sat, 15 Jun 2024 18:19:11 +0200 Subject: [PATCH] refactor: break Project into its own component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I feel like Fork-Star-Watch is a pattern that we will reuse. Therefore the new component is a molecule. I also look up the person as collaborator which works for the small test set I used during development but will likely break in production for others. That's good. It will show me more information I need to design the component better. I lack that at the moment. Ideally I would use a database here, but before I can set up one I better understand the data model. Signed-off-by: André Jaenisch --- src/lib/components/molecules/Project.svelte | 83 +++++++++++++++++++++ src/lib/components/templates/Profile.svelte | 74 +++++------------- 2 files changed, 100 insertions(+), 57 deletions(-) create mode 100644 src/lib/components/molecules/Project.svelte diff --git a/src/lib/components/molecules/Project.svelte b/src/lib/components/molecules/Project.svelte new file mode 100644 index 0000000..379b928 --- /dev/null +++ b/src/lib/components/molecules/Project.svelte @@ -0,0 +1,83 @@ + + + + +
+ +
+ +
+ + {following.name} + +
    + {#each collaborators as member} +
  • +
    + +
    +
  • + {/each} +
+
+ + +
+ {following.summary} +
+ +
+
+ +
+ +
+ + + +
+ +
Updated somewhen
+
+
diff --git a/src/lib/components/templates/Profile.svelte b/src/lib/components/templates/Profile.svelte index a29f4a3..a884094 100644 --- a/src/lib/components/templates/Profile.svelte +++ b/src/lib/components/templates/Profile.svelte @@ -13,20 +13,13 @@ You should have received a copy of the GNU Affero General Public License along w @@ -107,52 +105,14 @@ You should have received a copy of the GNU Affero General Public License along w {#each data.user.followingsMap as following} {#if following.type === 'Project'}
  • -
    - -
    - -
    - - {following.name} - -
      - {#each mapCollaboratorsToMember(data.user.collaboratorsMap, following.id) as member} -
    • -
      - -
      -
    • - {/each} -
    -
    - - -
    - {following.summary} -
    - -
    -
    - -
    - -
    - - - -
    - -
    Updated somewhen
    -
    -
    +
  • {/if} {/each}