From 619d8104845254a9cbeb91256b3a0c01fde4cf39 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Tue, 29 Nov 2022 08:27:38 -0500 Subject: [PATCH 01/26] Move things API into lib --- src/{routes/_api => lib}/things.js | 0 src/routes/index.svelte | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/{routes/_api => lib}/things.js (100%) diff --git a/src/routes/_api/things.js b/src/lib/things.js similarity index 100% rename from src/routes/_api/things.js rename to src/lib/things.js diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 6e5e93f..3e730f7 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,6 +1,6 @@ + +
+ {#key things} + {#each categories as category} + {#if filterThings(category).length > 0} +
+
+ {category} +
+ +
+ {/if} + {/each} + {/key} +
diff --git a/src/components/Things/filter.js b/src/components/Things/filter.js new file mode 100644 index 0000000..cd0b659 --- /dev/null +++ b/src/components/Things/filter.js @@ -0,0 +1,3 @@ +export function filterThings(category) { + return shownThings.filter(thing => thing.categories?.includes(category)); +} \ No newline at end of file diff --git a/src/components/Things/index.js b/src/components/Things/index.js new file mode 100644 index 0000000..1710476 --- /dev/null +++ b/src/components/Things/index.js @@ -0,0 +1 @@ +export { default as Things } from './Things.svelte' \ No newline at end of file diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 3e730f7..970acfa 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -2,7 +2,7 @@ import { onMount } from "svelte"; import things from "../lib/things.js" import Header from "../components/Header.svelte"; - import Scroller from "../components/Scroller.svelte"; + import Things from '../components/Things'; import TextInput from "../components/TextInput.svelte"; import LoadingIndicator from "../components/LoadingIndicator.svelte"; @@ -21,10 +21,6 @@ shownThings = filtered(); } - function filterThings(category) { - return shownThings.filter(thing => thing.categories?.includes(category)); - } - function filtered() { let filtered = data.things; if (searchText.length > 0) @@ -57,16 +53,7 @@ - {#key shownThings} - {#each data.categories as category} - {#if filterThings(category).length > 0} -
-
{category}
- -
- {/if} - {/each} - {/key} + {/if} From f0e978b217639e26ad4ac71564378ee63a6e23eb Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Tue, 29 Nov 2022 10:48:45 -0500 Subject: [PATCH 03/26] Remove LinkedIn from Footer --- src/components/Footer.svelte | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index ad33df6..6550938 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -31,17 +31,6 @@ - - - LinkedIn - - - - - - - - Discord From d96c510c8c101e27e33126022914888e3938ba2c Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Tue, 29 Nov 2022 11:33:02 -0500 Subject: [PATCH 04/26] Pull out buttonStyle string --- src/routes/index.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 970acfa..578983d 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -11,6 +11,8 @@ let searchText = ""; let showWantedItems = false; + const buttonStyle = 'px-3 py-1 rounded brutal hovers font-bold font-display outline-none'; + onMount(async () => { data = await things.getAll(); shownThings = data.things; @@ -49,8 +51,8 @@ placeholder="Search..." />
- - + +
From 33345237d69cdd870544fcefc674927aa589f138 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Tue, 29 Nov 2022 11:46:05 -0500 Subject: [PATCH 05/26] Consolidate Layout components --- src/components/{ => Layout}/Footer.svelte | 8 ++++---- src/components/{ => Layout}/Layout.svelte | 0 src/components/Layout/index.js | 1 + src/routes/_layout.svelte | 4 ++-- src/routes/index.svelte | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) rename src/components/{ => Layout}/Footer.svelte (95%) rename src/components/{ => Layout}/Layout.svelte (100%) create mode 100644 src/components/Layout/index.js diff --git a/src/components/Footer.svelte b/src/components/Layout/Footer.svelte similarity index 95% rename from src/components/Footer.svelte rename to src/components/Layout/Footer.svelte index 6550938..704dc75 100644 --- a/src/components/Footer.svelte +++ b/src/components/Layout/Footer.svelte @@ -1,8 +1,8 @@