From 780ca183fd67141262d398b141e64c007da1100e Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Tue, 10 Dec 2024 14:31:53 +0000 Subject: [PATCH 01/46] feat: ui for needs --- src/app/needs/components/NeedsDisplay.tsx | 99 +++++++++++++++++++++++ src/app/needs/components/NeedsSection.tsx | 0 src/app/needs/page.tsx | 5 ++ 3 files changed, 104 insertions(+) create mode 100644 src/app/needs/components/NeedsDisplay.tsx create mode 100644 src/app/needs/components/NeedsSection.tsx diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx new file mode 100644 index 00000000..0776b8b2 --- /dev/null +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -0,0 +1,99 @@ +import Button from "@/ui/shared/Button"; + +export default function NeedsDisplay() { + const needsData = [ + { + needName: "Physical Nurturance", + needsArr: [ + "Air", + "Food", + "Water", + "Movement", + "Exercise", + "Protection (insects, bacteria, virus, predators)", + "Rest", + "Sexual expression", + "Shelter", + "Touch", + ], + }, + { + needName: "Play", + needsArr: ["Play", "Laughter"], + }, + { + needName: "Interdependence", + needsArr: [ + "Acceptance", + "Appreciation", + "Closeness", + "Community", + "Consideration", + "Contribution to the enrichment of life", + "Emotional safety", + "Empathy", + "Honesty", + "Love", + "Reassurance", + "Respect", + "Support", + "Trust", + "Understanding", + "Warmth", + ], + }, + { + needName: "Celebration", + needsArr: [ + "Celebration of life fulfilled", + "Celebration of dreams fulfilled", + "Mourning of dreams unfulfilled", + "Mourning losses of loved ones", + ], + }, + { + needName: "Harmony", + needsArr: ["Peace", "Order", "Harmony", "Beauty", "Inspiration"], + }, + { + needName: "Integrity", + needsArr: ["Authenticity", "Creativity", "Meaning", "Self worth"], + }, + { + needName: "Autonomy", + needsArr: [ + "Choose dreams", + "Choose goals", + "Choose values", + "Choose plan to fulfil dreams", + "Choose plan to fulfil goals", + "Choose plan to fulfil values", + ], + }, + ]; + + return ( + <> +
+ {needsData.map((need, index) => { + return ( +
+

{need.needName}

+
+ {need.needsArr.map((arrItem, index) => { + return ( +
+
+ ); + })} +
+ + ); +} diff --git a/src/app/needs/components/NeedsSection.tsx b/src/app/needs/components/NeedsSection.tsx new file mode 100644 index 00000000..e69de29b diff --git a/src/app/needs/page.tsx b/src/app/needs/page.tsx index 4cde0a89..ac8fa7f9 100644 --- a/src/app/needs/page.tsx +++ b/src/app/needs/page.tsx @@ -1,4 +1,5 @@ import { Header } from "@/ui/shared/Header"; +import NeedsDisplay from "./components/NeedsDisplay"; export default function NeedsPage() { return ( @@ -8,6 +9,10 @@ export default function NeedsPage() { description="address unmet needs and assess next actions." hasInfoButton={true} /> +

+ What do you need right now? +

+ ); } From 088fed8d8f1e18bc5801fe1a7e01a11ffcb049cb Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Tue, 10 Dec 2024 14:35:31 +0000 Subject: [PATCH 02/46] feat: add subtitle and remove needssection --- src/app/needs/components/NeedsSection.tsx | 0 src/app/needs/page.tsx | 3 +++ 2 files changed, 3 insertions(+) delete mode 100644 src/app/needs/components/NeedsSection.tsx diff --git a/src/app/needs/components/NeedsSection.tsx b/src/app/needs/components/NeedsSection.tsx deleted file mode 100644 index e69de29b..00000000 diff --git a/src/app/needs/page.tsx b/src/app/needs/page.tsx index ac8fa7f9..16da3f52 100644 --- a/src/app/needs/page.tsx +++ b/src/app/needs/page.tsx @@ -12,6 +12,9 @@ export default function NeedsPage() {

What do you need right now?

+

+ Select what you need from the list below +

); From 87ad6ea10f4e9938fc8950920801c8dc477a4c63 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Tue, 10 Dec 2024 15:22:30 +0000 Subject: [PATCH 03/46] feat: add mock data --- src/app/needs/mockNeeds.json | 795 +++++++++++++++++++++++++++++++++++ 1 file changed, 795 insertions(+) create mode 100644 src/app/needs/mockNeeds.json diff --git a/src/app/needs/mockNeeds.json b/src/app/needs/mockNeeds.json new file mode 100644 index 00000000..fb9589c9 --- /dev/null +++ b/src/app/needs/mockNeeds.json @@ -0,0 +1,795 @@ +{ + "needs_categories": [ + { + "id": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "name": "Physical Nurturance", + "timestamp": "2024-12-10T15:17:36.547Z" + }, + { + "id": "66221ab6-46b8-46a3-b9ff-478afb12940f", + "name": "Play", + "timestamp": "2024-12-10T15:17:36.547Z" + }, + { + "id": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "name": "Interdependence", + "timestamp": "2024-12-10T15:17:36.547Z" + }, + { + "id": "1b3b0001-360e-4f8c-946d-8b135205562e", + "name": "Celebration", + "timestamp": "2024-12-10T15:17:36.547Z" + }, + { + "id": "13ed4141-3343-44f4-af0f-5292ec6a7964", + "name": "Harmony", + "timestamp": "2024-12-10T15:17:36.547Z" + }, + { + "id": "880014f1-0e49-4d08-9400-23600831a6c2", + "name": "Integrity", + "timestamp": "2024-12-10T15:17:36.547Z" + }, + { + "id": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "name": "Autonomy", + "timestamp": "2024-12-10T15:17:36.547Z" + } + ], + "needs": [ + { + "id": "dedf2b69-fe4c-4205-9ca4-2bc3c2b995da", + "name": "Air", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "8a8df84e-9963-46e2-a7f2-7522485313b5", + "name": "Food", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "a8e31e05-c707-42c1-895c-7e3f4353114e", + "name": "Water", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "64534066-516a-4dc9-8b1d-92a2c2f10c27", + "name": "Movement", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "a6e9c563-a1bf-4bd4-bde1-af000743a226", + "name": "Exercise", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "685ff3c6-de40-4e4b-88bc-5a5780b1f628", + "name": "Protection (insects, bacteria, virus, predators)", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "36ea203c-ed36-491d-90fa-e52767b3b163", + "name": "Rest", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "758d3716-5e68-4d5e-8a60-e4e36300c4c3", + "name": "Sexual expression", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "faae10bf-7edd-4118-aedd-6ff735ed3f62", + "name": "Shelter", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "fbbaa1ee-b7da-4f58-88eb-a7f68a42d81d", + "name": "Touch", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "35fe9f0d-3859-48cb-9d16-0664a6dc913b", + "name": "Play", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "66221ab6-46b8-46a3-b9ff-478afb12940f", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "3849f27f-8358-40e0-9324-a6747ce80d0d", + "name": "Laughter", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "66221ab6-46b8-46a3-b9ff-478afb12940f", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "6023a9b9-5897-4057-862a-08e2c334f128", + "name": "Acceptance", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "42ebe78c-092b-4b6f-9e59-2896a69b56a9", + "name": "Appreciation", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "d244527e-9491-47c3-bbe2-e3c81ca6297c", + "name": "Closeness", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "b1c3bdb0-a381-4004-a5ba-b5aa318e2128", + "name": "Community", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "ece09737-f015-4dca-8bf8-123a6088e3fe", + "name": "Consideration", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "a41bfa91-bece-4601-9e7c-f6d1746ac346", + "name": "Contribution to the enrichment of life", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "d39c7168-b911-4d5e-83d2-e245738e8256", + "name": "Emotional safety", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "47f63844-b1ea-4b68-a6a4-c68e65ed0e06", + "name": "Empathy", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "ada9da25-dde6-4de6-924a-26650e4a188b", + "name": "Honesty", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "ea9b97a9-ded7-4b1e-97a1-8d5819e86a74", + "name": "Love", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "0bb747e5-0842-4bf1-a450-f439f431b3b4", + "name": "Reassurance", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "bac5d411-fdc4-4f1b-8f2c-c6c73879647e", + "name": "Respect", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "3e3b6b12-31b3-48b7-a338-a24dafd1104a", + "name": "Support", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "2c3493b8-7d8c-4e82-bcb3-2727da8e18fe", + "name": "Trust", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "23070cd9-f5bb-4d0f-981e-4cddbb55deee", + "name": "Understanding", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "1d823d69-63f6-4652-8a85-91d2b8a7438f", + "name": "Warmth", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "9d98558b-8743-4bd1-8774-f215020a04b1", + "name": "Celebration of life fulfilled", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "1b3b0001-360e-4f8c-946d-8b135205562e", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "e283adcc-a34d-41ef-98bf-b164485f6492", + "name": "Celebration of dreams fulfilled", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "1b3b0001-360e-4f8c-946d-8b135205562e", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "f4fc125f-44d6-4cc9-b072-92aa5db57b3c", + "name": "Mourning of dreams unfulfilled", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "1b3b0001-360e-4f8c-946d-8b135205562e", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "3dc7e7a1-054e-4015-8cb2-0a98d83bb09d", + "name": "Mourning losses of loved ones", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "1b3b0001-360e-4f8c-946d-8b135205562e", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "cf59fc82-b810-42a8-a655-3d23b581197a", + "name": "Peace", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "2b747dad-d7aa-4bb3-8d22-8d441a3c6979", + "name": "Order", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "285b4668-2fae-45c8-a6b6-585536ed4dcd", + "name": "Harmony", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "5bede4df-5764-4ae4-9957-afd45cd904ce", + "name": "Beauty", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "d4902d05-fd0d-4435-95f4-19c9dd8f3826", + "name": "Inspiration", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "0cadf94f-7461-4275-87d1-631003605749", + "name": "Authenticity", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "880014f1-0e49-4d08-9400-23600831a6c2", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "b7628eab-73f7-4ba3-8f11-7bc18c4de0d5", + "name": "Creativity", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "880014f1-0e49-4d08-9400-23600831a6c2", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "4d8af0d6-5f33-42af-ab7a-bbbde196b28e", + "name": "Meaning", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "880014f1-0e49-4d08-9400-23600831a6c2", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "c5e0ae96-43cb-4b91-b5c0-434497a8310f", + "name": "Self worth", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "880014f1-0e49-4d08-9400-23600831a6c2", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "cbf6f603-9567-4e9a-a4c1-b907b531a496", + "name": "Choose dreams", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "d2b221e9-c52d-4d20-aa78-787429dc996f", + "name": "Choose goals", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "741d2de3-d926-4b0d-8c40-83463f6646ec", + "name": "Choose values", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "ef6d63a4-10de-4aa7-b33c-2c30a8ea827a", + "name": "Choose plan to fulfil dreams", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "39179b5b-cec9-4776-aaf4-24c5b38202c0", + "name": "Choose plan to fulfil goals", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "29a003a5-431f-43fd-84b8-985cc3bc2b8c", + "name": "Choose plan to fulfil values", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", + "timestamp": "2024-12-10T15:17:36.548Z" + } + ], + "next_actions": [ + { + "id": "d2ec15b7-19fd-4e84-8680-bac86ec33f6c", + "name": "Find fresh air to breathe deeply.", + "need": "dedf2b69-fe4c-4205-9ca4-2bc3c2b995da", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "59e8ef21-6094-4ed4-9cec-c9ac04e397f5", + "name": "Prepare or purchase a nutritious meal.", + "need": "8a8df84e-9963-46e2-a7f2-7522485313b5", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "31aac61f-ad24-40df-9b2a-5bfa26edce8b", + "name": "Drink a glass of water.", + "need": "a8e31e05-c707-42c1-895c-7e3f4353114e", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "3e07f49c-f1ed-4acf-bdee-cc743758ee17", + "name": "Stretch or take a short walk.", + "need": "64534066-516a-4dc9-8b1d-92a2c2f10c27", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "00d37b2e-4d7a-4b03-9525-fb6b6c0d4cc6", + "name": "Schedule time for a workout.", + "need": "a6e9c563-a1bf-4bd4-bde1-af000743a226", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "36a86148-37bf-447a-89c3-fd42ad356439", + "name": "Secure a safe environment.", + "need": "685ff3c6-de40-4e4b-88bc-5a5780b1f628", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.548Z", + "timestamp": "2024-12-10T15:17:36.548Z" + }, + { + "id": "1f3c6dcb-4fc0-42cb-b0a3-f1d9915da1cd", + "name": "Take a moment to relax and recharge.", + "need": "36ea203c-ed36-491d-90fa-e52767b3b163", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "051b020e-1720-45e9-b59b-f28bc2e8b70d", + "name": "Communicate openly about your needs.", + "need": "758d3716-5e68-4d5e-8a60-e4e36300c4c3", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "22f82239-7ab6-48d4-89ab-6a13963f3172", + "name": "Ensure your space is clean and welcoming.", + "need": "faae10bf-7edd-4118-aedd-6ff735ed3f62", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "f711f6d1-2f31-4bd7-9f5b-c806d059fc5d", + "name": "Reach out for a hug or comforting touch.", + "need": "fbbaa1ee-b7da-4f58-88eb-a7f68a42d81d", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "e61e6a22-0335-4470-8088-a03c42642988", + "name": "Engage in a favorite game or activity.", + "need": "35fe9f0d-3859-48cb-9d16-0664a6dc913b", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "6fd0ac17-5c58-46d6-a12a-58a705620fca", + "name": "Watch something funny or joke with friends.", + "need": "3849f27f-8358-40e0-9324-a6747ce80d0d", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "20f024fe-b269-48df-ad96-e26bafdc486b", + "name": "Practice self-acceptance through affirmations.", + "need": "6023a9b9-5897-4057-862a-08e2c334f128", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "2f46689f-8985-4cb8-a80e-1117d75c9ee1", + "name": "Express gratitude to someone you care about.", + "need": "42ebe78c-092b-4b6f-9e59-2896a69b56a9", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "48816636-6cd2-4fa4-9188-a9648203a7b1", + "name": "Reach out to connect with a loved one.", + "need": "d244527e-9491-47c3-bbe2-e3c81ca6297c", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "630844fb-8f1e-4d8f-819e-8c560796b7d2", + "name": "Participate in a group or social event.", + "need": "b1c3bdb0-a381-4004-a5ba-b5aa318e2128", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "ca8796a5-1d0b-4bda-a112-8fd6787a7051", + "name": "Take a moment to listen actively.", + "need": "ece09737-f015-4dca-8bf8-123a6088e3fe", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "a4ee9766-d9e1-49aa-8a33-46450cc4ed28", + "name": "Volunteer or offer help to someone in need.", + "need": "a41bfa91-bece-4601-9e7c-f6d1746ac346", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "fb71d269-318c-45b0-9308-b1c80e1c943d", + "name": "Talk to a trusted friend about your feelings.", + "need": "d39c7168-b911-4d5e-83d2-e245738e8256", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "fbf95136-4b00-4d40-b08e-98792ef8fb0d", + "name": "Put yourself in someone else's shoes.", + "need": "47f63844-b1ea-4b68-a6a4-c68e65ed0e06", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "425fc221-21be-4261-be75-a144e8fdc807", + "name": "Share your thoughts transparently.", + "need": "ada9da25-dde6-4de6-924a-26650e4a188b", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "773fe4e3-b68d-47c3-bbe2-e6cbd3ff5625", + "name": "Spend quality time with someone close to you.", + "need": "ea9b97a9-ded7-4b1e-97a1-8d5819e86a74", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "f545581e-ae9b-4a3b-9fb1-33b19a5e8f85", + "name": "Ask for or provide encouragement.", + "need": "0bb747e5-0842-4bf1-a450-f439f431b3b4", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "f9f7e511-0382-4352-85c6-3ea132d4e7fb", + "name": "Acknowledge someone's boundaries or contributions.", + "need": "bac5d411-fdc4-4f1b-8f2c-c6c73879647e", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "7fd03381-fc68-4283-9c9d-94f3c1ffd87f", + "name": "Offer or ask for support from friends or family.", + "need": "3e3b6b12-31b3-48b7-a338-a24dafd1104a", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "fed2a3f5-df29-4206-9a92-b8c5dbd0323e", + "name": "Engage in a trust-building activity.", + "need": "2c3493b8-7d8c-4e82-bcb3-2727da8e18fe", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "ce559d3f-70bd-443f-87f2-dc6f1e759c33", + "name": "Seek to understand another's perspective.", + "need": "23070cd9-f5bb-4d0f-981e-4cddbb55deee", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "4fd6936d-d439-4293-a785-b9a8abaac565", + "name": "Create a cozy environment for yourself.", + "need": "1d823d69-63f6-4652-8a85-91d2b8a7438f", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "d40fbba6-f226-429d-b3b3-c3128037d124", + "name": "Plan a small celebration.", + "need": "9d98558b-8743-4bd1-8774-f215020a04b1", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "e769958e-86e8-4cf6-a152-c4964737caed", + "name": "Acknowledge and celebrate achievements.", + "need": "e283adcc-a34d-41ef-98bf-b164485f6492", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "035cc678-4b31-42c4-9094-5a2e11b167c2", + "name": "Reflect and journal about your emotions.", + "need": "f4fc125f-44d6-4cc9-b072-92aa5db57b3c", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "8ae45a9a-a9f3-40d3-9d5b-9007b43aeed5", + "name": "Honor their memory in a meaningful way.", + "need": "3dc7e7a1-054e-4015-8cb2-0a98d83bb09d", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "28bb5454-aefb-4940-b129-5b20ff1429ee", + "name": "Meditate or spend time in a calm space.", + "need": "cf59fc82-b810-42a8-a655-3d23b581197a", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "a5639c2c-926f-4b4b-9e2e-ff99b6039e06", + "name": "Organize your workspace or schedule.", + "need": "2b747dad-d7aa-4bb3-8d22-8d441a3c6979", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "7a8e780e-db04-472d-802d-a5ea8dcb401c", + "name": "Seek resolution in lingering conflicts.", + "need": "285b4668-2fae-45c8-a6b6-585536ed4dcd", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "1352ec77-4280-4f39-8522-572bad96c0aa", + "name": "Visit a place or object that inspires beauty.", + "need": "5bede4df-5764-4ae4-9957-afd45cd904ce", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "e416e9d6-d074-43d6-b0f7-2d8db11ef158", + "name": "Explore art or literature for new ideas.", + "need": "d4902d05-fd0d-4435-95f4-19c9dd8f3826", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "8d59a4dd-fdab-4f30-bb7f-777bfabdcc3c", + "name": "Take a step that reflects your true self.", + "need": "0cadf94f-7461-4275-87d1-631003605749", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "6382845d-6ef2-40b1-a8ee-943333fe9956", + "name": "Work on a creative project.", + "need": "b7628eab-73f7-4ba3-8f11-7bc18c4de0d5", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "d3507e5b-e2aa-4b12-9c3e-6e39fe535d47", + "name": "Reflect on what gives you purpose.", + "need": "4d8af0d6-5f33-42af-ab7a-bbbde196b28e", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "74677fd1-da84-457e-91c5-5cd9df992214", + "name": "Write a list of your positive attributes.", + "need": "c5e0ae96-43cb-4b91-b5c0-434497a8310f", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "f48bd643-c5a5-42bc-bffb-24a1d6f12e33", + "name": "Visualize your ideal future.", + "need": "cbf6f603-9567-4e9a-a4c1-b907b531a496", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "9eda62f6-c713-43e3-ab0a-e4efaf803202", + "name": "Set clear, actionable goals.", + "need": "d2b221e9-c52d-4d20-aa78-787429dc996f", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "f4a01ca0-6363-46c6-804d-6743e43cf3fb", + "name": "Identify your core values.", + "need": "741d2de3-d926-4b0d-8c40-83463f6646ec", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "f0e8adc7-a1b5-420b-a058-78f7ff7cc817", + "name": "Create a roadmap to achieve your dreams.", + "need": "ef6d63a4-10de-4aa7-b33c-2c30a8ea827a", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "d4dbfe26-f06c-41f9-8e11-734ce32bbce7", + "name": "Break down your goals into steps.", + "need": "39179b5b-cec9-4776-aaf4-24c5b38202c0", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + }, + { + "id": "b84e7cb7-6012-4b58-8fc4-7fddd3d97968", + "name": "Act in alignment with your values.", + "need": "29a003a5-431f-43fd-84b8-985cc3bc2b8c", + "selectedTimestamps": [], + "selectedExpiry": "2024-12-10T15:17:36.549Z", + "timestamp": "2024-12-10T15:17:36.549Z" + } + ] +} From 7139537bfc7f5d18ef5785d46c62adc79c15063e Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Tue, 10 Dec 2024 15:35:45 +0000 Subject: [PATCH 04/46] chore: change div to fragment --- src/app/needs/components/NeedsDisplay.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 0776b8b2..a1e45944 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -75,9 +75,9 @@ export default function NeedsDisplay() { return ( <>
- {needsData.map((need, index) => { + {needsData.map((need) => { return ( -
+ <>

{need.needName}

{need.needsArr.map((arrItem, index) => { @@ -90,7 +90,7 @@ export default function NeedsDisplay() { ); })}
-
+ ); })}
From e9079b38a22f973f16d69955c258e327d132daf0 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Tue, 10 Dec 2024 15:49:24 +0000 Subject: [PATCH 05/46] feat: get data but not working properly --- {src/app/needs => public}/mockNeeds.json | 0 src/app/needs/components/NeedsDisplay.tsx | 98 ++++++----------------- 2 files changed, 24 insertions(+), 74 deletions(-) rename {src/app/needs => public}/mockNeeds.json (100%) diff --git a/src/app/needs/mockNeeds.json b/public/mockNeeds.json similarity index 100% rename from src/app/needs/mockNeeds.json rename to public/mockNeeds.json diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index a1e45944..149d72bb 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -1,90 +1,40 @@ +"use client"; + import Button from "@/ui/shared/Button"; +import { useState, useEffect } from "react"; export default function NeedsDisplay() { - const needsData = [ - { - needName: "Physical Nurturance", - needsArr: [ - "Air", - "Food", - "Water", - "Movement", - "Exercise", - "Protection (insects, bacteria, virus, predators)", - "Rest", - "Sexual expression", - "Shelter", - "Touch", - ], - }, - { - needName: "Play", - needsArr: ["Play", "Laughter"], - }, - { - needName: "Interdependence", - needsArr: [ - "Acceptance", - "Appreciation", - "Closeness", - "Community", - "Consideration", - "Contribution to the enrichment of life", - "Emotional safety", - "Empathy", - "Honesty", - "Love", - "Reassurance", - "Respect", - "Support", - "Trust", - "Understanding", - "Warmth", - ], - }, - { - needName: "Celebration", - needsArr: [ - "Celebration of life fulfilled", - "Celebration of dreams fulfilled", - "Mourning of dreams unfulfilled", - "Mourning losses of loved ones", - ], - }, - { - needName: "Harmony", - needsArr: ["Peace", "Order", "Harmony", "Beauty", "Inspiration"], - }, - { - needName: "Integrity", - needsArr: ["Authenticity", "Creativity", "Meaning", "Self worth"], - }, - { - needName: "Autonomy", - needsArr: [ - "Choose dreams", - "Choose goals", - "Choose values", - "Choose plan to fulfil dreams", - "Choose plan to fulfil goals", - "Choose plan to fulfil values", - ], - }, - ]; + const [categories, setCategories] = useState([]); + const [needs, setNeeds] = useState([]); + + const getData = async () => { + const response = await fetch("./mockNeeds.json"); + const data = await response.json(); + const { needs_categories, needs, next_actions } = data; + setCategories(needs_categories); + setNeeds(needs); + console.log(data); + }; + + useEffect(() => { + getData(); + }, []); return ( <>
- {needsData.map((need) => { + {categories.map((category, index) => { return ( <> -

{need.needName}

+

+ {category.name} +

- {need.needsArr.map((arrItem, index) => { + {needs.map((need, index) => { return (
- +
); })} From 3bab35b483dfb9715b4b03aa9f22b547c7fe1894 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Tue, 10 Dec 2024 16:39:08 +0000 Subject: [PATCH 07/46] feat: add pages for needs questions --- src/app/needs/(questions)/QEffort/page.tsx | 3 --- src/app/needs/(questions)/QUrgent/page.tsx | 3 --- src/app/needs/(questions)/QWorth/page.tsx | 3 --- src/app/needs/(questions)/effort/page.tsx | 9 +++++++++ src/app/needs/(questions)/urgency/page.tsx | 11 +++++++++++ src/app/needs/(questions)/worth/page.tsx | 9 +++++++++ 6 files changed, 29 insertions(+), 9 deletions(-) delete mode 100644 src/app/needs/(questions)/QEffort/page.tsx delete mode 100644 src/app/needs/(questions)/QUrgent/page.tsx delete mode 100644 src/app/needs/(questions)/QWorth/page.tsx create mode 100644 src/app/needs/(questions)/effort/page.tsx create mode 100644 src/app/needs/(questions)/urgency/page.tsx create mode 100644 src/app/needs/(questions)/worth/page.tsx diff --git a/src/app/needs/(questions)/QEffort/page.tsx b/src/app/needs/(questions)/QEffort/page.tsx deleted file mode 100644 index c9964d48..00000000 --- a/src/app/needs/(questions)/QEffort/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function QEffort() { - return

Effort

; -} diff --git a/src/app/needs/(questions)/QUrgent/page.tsx b/src/app/needs/(questions)/QUrgent/page.tsx deleted file mode 100644 index cdf8b308..00000000 --- a/src/app/needs/(questions)/QUrgent/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function QUrgent() { - return

Effort

; -} diff --git a/src/app/needs/(questions)/QWorth/page.tsx b/src/app/needs/(questions)/QWorth/page.tsx deleted file mode 100644 index f084a614..00000000 --- a/src/app/needs/(questions)/QWorth/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function QWorth() { - return

worth

; -} diff --git a/src/app/needs/(questions)/effort/page.tsx b/src/app/needs/(questions)/effort/page.tsx new file mode 100644 index 00000000..11f3d4e6 --- /dev/null +++ b/src/app/needs/(questions)/effort/page.tsx @@ -0,0 +1,9 @@ +import Button from "@/ui/shared/Button"; + +export default function Effort() { + <> +

How much effort does it take?

+ )}

{title}

@@ -42,14 +50,14 @@ export default function NeedsModal({
From d062af58fce60f746849712b4a4c29bcd50ed572 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 14:09:25 +0000 Subject: [PATCH 21/46] feat: add close button --- src/app/needs/components/NeedsDisplay.tsx | 1 + src/app/needs/components/NeedsModal.tsx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index a233dfa0..0103508c 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -163,6 +163,7 @@ export default function NeedsDisplay() { }} title={`You have selected ${selectedNeed}`} needsStep={needsStep} + setModalOpen={setModalOpen} handleStepDecrease={handleStepDecrease} /> diff --git a/src/app/needs/components/NeedsModal.tsx b/src/app/needs/components/NeedsModal.tsx index 407dbe95..877328e6 100644 --- a/src/app/needs/components/NeedsModal.tsx +++ b/src/app/needs/components/NeedsModal.tsx @@ -1,6 +1,7 @@ import { needs } from "@/lib/db/seed/needs"; import Button from "@/ui/shared/Button"; import { ChevronLeftIcon } from "@heroicons/react/24/outline"; +import { XMarkIcon } from "@heroicons/react/24/outline"; interface ModalProps { inputModal?: boolean; @@ -25,6 +26,7 @@ export default function NeedsModal({ backButton, needsStep, handleStepDecrease, + setModalOpen, }: ModalProps) { return ( <> @@ -39,6 +41,13 @@ export default function NeedsModal({ )} + +

{title}

From 726884348bc976720a1b8a08ed53b6b8a96ec0f3 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 14:17:10 +0000 Subject: [PATCH 22/46] style: modal now appears in centre of screen and disables scrolling --- src/app/needs/components/NeedsDisplay.tsx | 17 ++++++++++++++++- src/app/needs/components/NeedsModal.tsx | 18 ++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 0103508c..ad5f5f55 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -132,6 +132,21 @@ export default function NeedsDisplay() { handleLabelChange(); }, [needsStep]); + useEffect(() => { + if (modalOpen) { + // Disable scrolling + document.body.style.overflow = "hidden"; + } else { + // Enable scrolling + document.body.style.overflow = "auto"; + } + + // Cleanup when the component unmounts or modal is closed + return () => { + document.body.style.overflow = "auto"; + }; + }, [modalOpen]); // Trigger this effect when modalOpen changes + return ( <>

@@ -161,7 +176,7 @@ export default function NeedsDisplay() { handleNeuroDecrease(); }, }} - title={`You have selected ${selectedNeed}`} + title={`You have selected ~${selectedNeed}~`} needsStep={needsStep} setModalOpen={setModalOpen} handleStepDecrease={handleStepDecrease} diff --git a/src/app/needs/components/NeedsModal.tsx b/src/app/needs/components/NeedsModal.tsx index 877328e6..2ef2781b 100644 --- a/src/app/needs/components/NeedsModal.tsx +++ b/src/app/needs/components/NeedsModal.tsx @@ -31,7 +31,17 @@ export default function NeedsModal({ return ( <> {modalOpen && ( -
+

step {needsStep} of 3

{needsStep > 1 && ( -
-

{title}

-

+

+

{title}

+

Select the button that best describes meeting this need right now.

From 9b0fc6c8e9456af1139312b2e842af9c0e7b8915 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 14:30:03 +0000 Subject: [PATCH 23/46] chore: fix type errors --- src/app/needs/components/NeedsDisplay.tsx | 22 +++++++++++----------- src/app/needs/components/NeedsModal.tsx | 5 ++++- src/app/needs/components/NeedsSection.tsx | 17 +++++++++++++++-- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index ad5f5f55..17b3d420 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -1,6 +1,5 @@ "use client"; -import Button from "@/ui/shared/Button"; import { useState, useEffect } from "react"; import { useDatabase } from "@/context/DatabaseContext"; import retrieveDataObject from "@/lib/utils/retrieveDataObject"; @@ -9,12 +8,12 @@ import NeedsSection from "./NeedsSection"; import NeedsModal from "./NeedsModal"; -interface Category { +export interface Category { id: string; name: string; } -interface Need { +export interface Need { name: string; category: string; } @@ -58,10 +57,10 @@ export default function NeedsDisplay() { }); const [modalOpen, setModalOpen] = useState(false); - const [selectedNeed, setSelectedNeed] = useState(false); + const [selectedNeed, setSelectedNeed] = useState(""); const [needsStep, setNeedsStep] = useState(1); - const handleOpen = (need) => { + const handleOpen = (need: string) => { setModalOpen(true); setSelectedNeed(need); }; @@ -73,10 +72,14 @@ export default function NeedsDisplay() { setNeedsStep((prevStep) => prevStep - 1); }; - const handleIncrease = (setter) => { + const handleIncrease = ( + setter: React.Dispatch> + ) => { setter((prev) => prev + 1); }; - const handleDecrease = (setter) => { + const handleDecrease = ( + setter: React.Dispatch> + ) => { setter((prev) => prev - 1); }; @@ -134,18 +137,15 @@ export default function NeedsDisplay() { useEffect(() => { if (modalOpen) { - // Disable scrolling document.body.style.overflow = "hidden"; } else { - // Enable scrolling document.body.style.overflow = "auto"; } - // Cleanup when the component unmounts or modal is closed return () => { document.body.style.overflow = "auto"; }; - }, [modalOpen]); // Trigger this effect when modalOpen changes + }, [modalOpen]); return ( <> diff --git a/src/app/needs/components/NeedsModal.tsx b/src/app/needs/components/NeedsModal.tsx index 2ef2781b..780501c9 100644 --- a/src/app/needs/components/NeedsModal.tsx +++ b/src/app/needs/components/NeedsModal.tsx @@ -1,7 +1,7 @@ -import { needs } from "@/lib/db/seed/needs"; import Button from "@/ui/shared/Button"; import { ChevronLeftIcon } from "@heroicons/react/24/outline"; import { XMarkIcon } from "@heroicons/react/24/outline"; +import { Dispatch, SetStateAction } from "react"; interface ModalProps { inputModal?: boolean; @@ -17,6 +17,9 @@ interface ModalProps { action: () => void; }; handleInputChange?: (e: React.ChangeEvent) => void; + needsStep: number; // Add this line + setModalOpen: Dispatch>; + handleStepDecrease: () => void; } export default function NeedsModal({ diff --git a/src/app/needs/components/NeedsSection.tsx b/src/app/needs/components/NeedsSection.tsx index 789d4fdf..6f26266d 100644 --- a/src/app/needs/components/NeedsSection.tsx +++ b/src/app/needs/components/NeedsSection.tsx @@ -1,11 +1,24 @@ import Button from "@/ui/shared/Button"; +import { Need } from "./NeedsDisplay"; -export default function NeedsSection({ categoryData, handleOpen }) { +interface NeedsSectionProps { + categoryData: { + category: string; + needs: Need[]; + }; + handleOpen: (needName: string) => void; +} + +export default function NeedsSection({ + categoryData, + handleOpen, +}: NeedsSectionProps) { + console.log(categoryData); return (

{categoryData.category}

- {categoryData.needs.map((need, needIndex) => { + {categoryData.needs.map((need: Need, needIndex: number) => { return ( )} From e5aedef2a60554707137c81212d229fa61e8cbaa Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 16:17:37 +0000 Subject: [PATCH 29/46] feat: finishing modal dialogue resets to 0 --- src/app/needs/components/NeedsDisplay.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 3b73b55d..cb0c5683 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -104,6 +104,7 @@ export default function NeedsDisplay() { handleIncrease(setWorthDoing); setModalOpen(false); setNeedsStep(1); + resetNeuros(); } }; @@ -116,9 +117,16 @@ export default function NeedsDisplay() { handleDecrease(setWorthDoing); setModalOpen(false); setNeedsStep(1); + resetNeuros(); } }; + const resetNeuros = () => { + setUrgent(0); + setEffortful(0); + setWorthDoing(0); + }; + const handleLabelChange = () => { switch (needsStep) { case 1: From 264a6b5ec77a07760e971a527f6fdb5faebe0d1a Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 16:25:36 +0000 Subject: [PATCH 30/46] chore: rename functions --- src/app/needs/components/NeedsDisplay.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index cb0c5683..8712c2e0 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -33,6 +33,7 @@ export default function NeedsDisplay() { const [worthDoing, setWorthDoing] = useState(0); const [positiveLabel, setPositiveLabel] = useState("urgent"); const [negativeLabel, setNegativeLabel] = useState("not urgent"); + const [isModalCompleted, setIsModalCompleted] = useState(false); const fetchCategories = async () => { const response = await database.getFromDb("needs_categories"); @@ -95,29 +96,33 @@ export default function NeedsDisplay() { setter((prev) => prev - 1); }; - const handleNeuroIncrease = () => { + const handlePositiveClick = () => { if (needsStep === 1) { handleIncrease(setUrgent); } else if (needsStep === 2) { handleIncrease(setEffortful); } else if (needsStep === 3) { handleIncrease(setWorthDoing); + setIsModalCompleted(true); setModalOpen(false); setNeedsStep(1); resetNeuros(); + setIsModalCompleted(false); } }; - const handleNeuroDecrease = () => { + const handleNegativeClick = () => { if (needsStep === 1) { handleDecrease(setUrgent); } else if (needsStep === 2) { handleDecrease(setEffortful); } else if (needsStep === 3) { handleDecrease(setWorthDoing); + setIsModalCompleted(true); setModalOpen(false); setNeedsStep(1); resetNeuros(); + setIsModalCompleted(false); } }; @@ -186,14 +191,14 @@ export default function NeedsDisplay() { label: positiveLabel, action: () => { handleStepAction(); - handleNeuroIncrease(); + handlePositiveClick(); }, }} backButton={{ label: negativeLabel, action: () => { handleStepAction(); - handleNeuroDecrease(); + handlePositiveClick(); }, }} title={`You have selected ~${selectedNeed}~`} From d428d235ccc8bcc6f277fccf4557583e2d3ec957 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 16:51:18 +0000 Subject: [PATCH 31/46] feat: logic to update db --- src/app/needs/components/NeedsDisplay.tsx | 56 +++++++++++++++++++++++ src/lib/db/DatabaseManager.ts | 40 ++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 8712c2e0..ba15930e 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -15,6 +15,7 @@ export interface Category { } export interface Need { + id: string; name: string; category: string; } @@ -96,6 +97,25 @@ export default function NeedsDisplay() { setter((prev) => prev - 1); }; + const updateNeedWithAction = async (needName: string, action: string) => { + try { + // Find the document corresponding to needName + const selectedNeed = needs.find((need) => need.name === needName); + + if (selectedNeed) { + const docId = selectedNeed.id; // Access the _id field (document ID) + + // Now update the document with the action using docId + await database.updateDocument("needs", docId, "mood", action); + console.log(`Updated ${needName} with action: ${action}`); + } else { + console.log(`Need ${needName} not found`); + } + } catch (error) { + console.error(`Failed to update need: ${needName}`, error); + } + }; + const handlePositiveClick = () => { if (needsStep === 1) { handleIncrease(setUrgent); @@ -104,6 +124,10 @@ export default function NeedsDisplay() { } else if (needsStep === 3) { handleIncrease(setWorthDoing); setIsModalCompleted(true); + + const action = determineAction(urgent, effortful, worthDoing); + updateNeedWithAction(selectedNeed, action); + setModalOpen(false); setNeedsStep(1); resetNeuros(); @@ -119,6 +143,10 @@ export default function NeedsDisplay() { } else if (needsStep === 3) { handleDecrease(setWorthDoing); setIsModalCompleted(true); + + const action = determineAction(urgent, effortful, worthDoing); + updateNeedWithAction(selectedNeed, action); + setModalOpen(false); setNeedsStep(1); resetNeuros(); @@ -155,6 +183,7 @@ export default function NeedsDisplay() { useEffect(() => { handleLabelChange(); + console.log(`selected need: ${selectedNeed}`); console.log(`urgency: ${urgent}`); console.log(`effort: ${effortful}`); console.log(`worthDoing: ${worthDoing}`); @@ -172,6 +201,33 @@ export default function NeedsDisplay() { }; }, [modalOpen]); + function determineAction( + urgent: number, + effortful: number, + worthDoing: number + ): string { + switch (true) { + case urgent === 1 && effortful === 1 && worthDoing === 1: + return "interest"; + case urgent === 0 && effortful === 0 && worthDoing === 0: + return "guilt"; + case urgent === 1 && effortful === 0 && worthDoing === 0: + return "freeze"; + case urgent === 1 && effortful === 1 && worthDoing === 0: + return "fight/flight"; + case urgent === 1 && effortful === 0 && worthDoing === 1: + return "joy"; + case urgent === 0 && effortful === 0 && worthDoing === 1: + return "content"; + case urgent === 0 && effortful === 1 && worthDoing === 1: + return "relief"; + case urgent === 0 && effortful === 1 && worthDoing === 0: + return "distress"; + default: + return "Invalid input"; + } + } + return ( <>
diff --git a/src/lib/db/DatabaseManager.ts b/src/lib/db/DatabaseManager.ts index 256ea53f..df88ab25 100644 --- a/src/lib/db/DatabaseManager.ts +++ b/src/lib/db/DatabaseManager.ts @@ -14,6 +14,9 @@ import nextActionsSchema from "./schemas/categoriesSchema.json"; import { categories, toolkit } from "./seed/toolkit"; import { needsCategories, needs, nextActions } from "./seed/needs"; +import { RxDBUpdatePlugin } from "rxdb/plugins/update"; +addRxPlugin(RxDBUpdatePlugin); + addRxPlugin(RxDBDevModePlugin); let dbInstance: RxDatabase | null = null; @@ -167,6 +170,43 @@ class DatabaseManager { throw error; } } + + async updateDocument( + collectionName: string, + docId: string, + field: string, + update: string + ) { + try { + const db = await this.accessDatabase(); + const collection = db.collections[collectionName]; + + if (!collection) { + throw new Error(`Collection '${collectionName}' does not exist`); + } + + const document = await collection + .findOne({ selector: { id: docId } }) + .exec(); + + if (!document) { + throw new Error( + `Document with ID '${docId}' not found in collection '${collectionName}'` + ); + } + + // Update the field directly on the document + await document.update({ + [field]: update, + }); + + console.log(`Updated document in ${collectionName}:`, document); + return document; + } catch (error) { + console.error(`Error in updateDocument:`, error); + throw error; + } + } } export default DatabaseManager.getInstance(); From 9513ac87b58448350c3c5a1b1dd4d52a5e5058a1 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 17:12:55 +0000 Subject: [PATCH 32/46] feat: update schema and seed --- src/lib/db/schemas/needsSchema.json | 8 ++++++++ src/lib/db/seed/needs.ts | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/lib/db/schemas/needsSchema.json b/src/lib/db/schemas/needsSchema.json index 96e2b2ec..971e7dcb 100644 --- a/src/lib/db/schemas/needsSchema.json +++ b/src/lib/db/schemas/needsSchema.json @@ -27,6 +27,14 @@ "ref": "needs_categories", "maxLength": 100 }, + "mood": { + "type": "string", + "maxLength": 255 + }, + "priority": { + "type": "string", + "maxLength": 255 + }, "timestamp": { "type": "string", "format": "date-time" diff --git a/src/lib/db/seed/needs.ts b/src/lib/db/seed/needs.ts index 9cc5e573..54fab8a6 100644 --- a/src/lib/db/seed/needs.ts +++ b/src/lib/db/seed/needs.ts @@ -77,6 +77,8 @@ const needs = Object.entries(needsList).flatMap(([categoryKey, items]) => { selectedTimestamps: [], selectedExpiry: new Date().toISOString(), category: category.id, + mood: "", + priority: "", timestamp: new Date().toISOString(), })); }); From 19dd29ccd19732931762c060fe0139f8c3163a45 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 17:19:32 +0000 Subject: [PATCH 33/46] feat: use patch, now it updates --- src/lib/db/DatabaseManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/db/DatabaseManager.ts b/src/lib/db/DatabaseManager.ts index df88ab25..1193d8bc 100644 --- a/src/lib/db/DatabaseManager.ts +++ b/src/lib/db/DatabaseManager.ts @@ -196,7 +196,7 @@ class DatabaseManager { } // Update the field directly on the document - await document.update({ + await document.patch({ [field]: update, }); From 467d0045bb9f64ca65b2d31ffb2a8416ac9a6f53 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 17:23:56 +0000 Subject: [PATCH 34/46] fix: console log now shows updated doc --- src/lib/db/DatabaseManager.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/db/DatabaseManager.ts b/src/lib/db/DatabaseManager.ts index 1193d8bc..061e8fe6 100644 --- a/src/lib/db/DatabaseManager.ts +++ b/src/lib/db/DatabaseManager.ts @@ -195,13 +195,14 @@ class DatabaseManager { ); } - // Update the field directly on the document - await document.patch({ + // Await the patch operation + const updatedDocument = await document.patch({ [field]: update, }); - console.log(`Updated document in ${collectionName}:`, document); - return document; + // Log after the update is complete + console.log(`Updated document in ${collectionName}:`, updatedDocument); + return updatedDocument; } catch (error) { console.error(`Error in updateDocument:`, error); throw error; From 9f6e170d81cb44984aa5e51fac216aca76d8797a Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 17:44:09 +0000 Subject: [PATCH 35/46] chore: add consolelogs --- src/app/needs/components/NeedsDisplay.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index ba15930e..f8845931 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -208,20 +208,28 @@ export default function NeedsDisplay() { ): string { switch (true) { case urgent === 1 && effortful === 1 && worthDoing === 1: + console.log("interest"); return "interest"; case urgent === 0 && effortful === 0 && worthDoing === 0: + console.log("guilt"); return "guilt"; case urgent === 1 && effortful === 0 && worthDoing === 0: + console.log("freeze"); return "freeze"; case urgent === 1 && effortful === 1 && worthDoing === 0: + console.log("fight/flight"); return "fight/flight"; case urgent === 1 && effortful === 0 && worthDoing === 1: + console.log("joy"); return "joy"; case urgent === 0 && effortful === 0 && worthDoing === 1: + console.log("content"); return "content"; case urgent === 0 && effortful === 1 && worthDoing === 1: + console.log("relief"); return "relief"; case urgent === 0 && effortful === 1 && worthDoing === 0: + console.log("distress"); return "distress"; default: return "Invalid input"; @@ -254,7 +262,7 @@ export default function NeedsDisplay() { label: negativeLabel, action: () => { handleStepAction(); - handlePositiveClick(); + handleNegativeClick(); }, }} title={`You have selected ~${selectedNeed}~`} From d6301c0eef514131ffdc6537f876f174d68c47c9 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:00:28 +0000 Subject: [PATCH 36/46] feat: submission to db working without reset --- src/app/needs/components/NeedsDisplay.tsx | 29 +++++++++++------------ 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index f8845931..837128f1 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -125,12 +125,8 @@ export default function NeedsDisplay() { handleIncrease(setWorthDoing); setIsModalCompleted(true); - const action = determineAction(urgent, effortful, worthDoing); - updateNeedWithAction(selectedNeed, action); - setModalOpen(false); setNeedsStep(1); - resetNeuros(); setIsModalCompleted(false); } }; @@ -144,12 +140,9 @@ export default function NeedsDisplay() { handleDecrease(setWorthDoing); setIsModalCompleted(true); - const action = determineAction(urgent, effortful, worthDoing); - updateNeedWithAction(selectedNeed, action); - setModalOpen(false); setNeedsStep(1); - resetNeuros(); + // resetNeuros(); setIsModalCompleted(false); } }; @@ -201,6 +194,12 @@ export default function NeedsDisplay() { }; }, [modalOpen]); + useEffect(() => { + const action = determineAction(urgent, effortful, worthDoing); + updateNeedWithAction(selectedNeed, action); + // resetNeuros(); + }, [worthDoing]); + function determineAction( urgent: number, effortful: number, @@ -210,25 +209,25 @@ export default function NeedsDisplay() { case urgent === 1 && effortful === 1 && worthDoing === 1: console.log("interest"); return "interest"; - case urgent === 0 && effortful === 0 && worthDoing === 0: + case urgent === -1 && effortful === -1 && worthDoing === -1: console.log("guilt"); return "guilt"; - case urgent === 1 && effortful === 0 && worthDoing === 0: + case urgent === 1 && effortful === -1 && worthDoing === -1: console.log("freeze"); return "freeze"; - case urgent === 1 && effortful === 1 && worthDoing === 0: + case urgent === 1 && effortful === 1 && worthDoing === -1: console.log("fight/flight"); return "fight/flight"; - case urgent === 1 && effortful === 0 && worthDoing === 1: + case urgent === 1 && effortful === -1 && worthDoing === 1: console.log("joy"); return "joy"; - case urgent === 0 && effortful === 0 && worthDoing === 1: + case urgent === -1 && effortful === -1 && worthDoing === 1: console.log("content"); return "content"; - case urgent === 0 && effortful === 1 && worthDoing === 1: + case urgent === -1 && effortful === 1 && worthDoing === 1: console.log("relief"); return "relief"; - case urgent === 0 && effortful === 1 && worthDoing === 0: + case urgent === -1 && effortful === 1 && worthDoing === -1: console.log("distress"); return "distress"; default: From fd33ecc475f808384ca9f38d4dd6a56bf3e0a0d7 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:08:03 +0000 Subject: [PATCH 37/46] feat: needs submission finished --- src/app/needs/components/NeedsDisplay.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 837128f1..20ba8e9c 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -195,9 +195,12 @@ export default function NeedsDisplay() { }, [modalOpen]); useEffect(() => { - const action = determineAction(urgent, effortful, worthDoing); - updateNeedWithAction(selectedNeed, action); - // resetNeuros(); + // Only proceed if all values are non-zero + if (urgent !== 0 && effortful !== 0 && worthDoing !== 0) { + const action = determineAction(urgent, effortful, worthDoing); + updateNeedWithAction(selectedNeed, action); + } + resetNeuros(); }, [worthDoing]); function determineAction( From db063e827dde7a8faa5e24782d3eef66ccaaaefd Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:09:47 +0000 Subject: [PATCH 38/46] chore: remove comments --- src/app/needs/components/NeedsDisplay.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 20ba8e9c..bd372b18 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -99,13 +99,11 @@ export default function NeedsDisplay() { const updateNeedWithAction = async (needName: string, action: string) => { try { - // Find the document corresponding to needName const selectedNeed = needs.find((need) => need.name === needName); if (selectedNeed) { - const docId = selectedNeed.id; // Access the _id field (document ID) + const docId = selectedNeed.id; - // Now update the document with the action using docId await database.updateDocument("needs", docId, "mood", action); console.log(`Updated ${needName} with action: ${action}`); } else { @@ -142,7 +140,7 @@ export default function NeedsDisplay() { setModalOpen(false); setNeedsStep(1); - // resetNeuros(); + setIsModalCompleted(false); } }; @@ -195,7 +193,6 @@ export default function NeedsDisplay() { }, [modalOpen]); useEffect(() => { - // Only proceed if all values are non-zero if (urgent !== 0 && effortful !== 0 && worthDoing !== 0) { const action = determineAction(urgent, effortful, worthDoing); updateNeedWithAction(selectedNeed, action); From 66f39dc1a76ac88d99b741ce446e8c704263d6e1 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:13:22 +0000 Subject: [PATCH 39/46] feat: close click now resets --- src/app/needs/components/NeedsDisplay.tsx | 8 +++++++- src/app/needs/components/NeedsModal.tsx | 21 +++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index bd372b18..b80d7945 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -235,6 +235,12 @@ export default function NeedsDisplay() { } } + const handleCloseClick = () => { + resetNeuros(); + setModalOpen(false); + setNeedsStep(1); + }; + return ( <>
@@ -266,8 +272,8 @@ export default function NeedsDisplay() { }} title={`You have selected ~${selectedNeed}~`} needsStep={needsStep} - setModalOpen={setModalOpen} handleBackClick={handleBackClick} + handleCloseClick={handleCloseClick} /> ); diff --git a/src/app/needs/components/NeedsModal.tsx b/src/app/needs/components/NeedsModal.tsx index 53f91ba8..f90dc112 100644 --- a/src/app/needs/components/NeedsModal.tsx +++ b/src/app/needs/components/NeedsModal.tsx @@ -17,9 +17,9 @@ interface ModalProps { action: () => void; }; handleInputChange?: (e: React.ChangeEvent) => void; - needsStep: number; // Add this line - setModalOpen: Dispatch>; + needsStep: number; handleBackClick: () => void; + handleCloseClick: () => void; } export default function NeedsModal({ @@ -29,7 +29,7 @@ export default function NeedsModal({ backButton, needsStep, handleBackClick, - setModalOpen, + handleCloseClick, }: ModalProps) { return ( <> @@ -37,11 +37,11 @@ export default function NeedsModal({
@@ -51,10 +51,7 @@ export default function NeedsModal({ )} - From 7f9fb4fa8bd068cf29358ae3c3af026cd36b209f Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:15:34 +0000 Subject: [PATCH 40/46] chore: remove unused imports --- src/app/needs/components/NeedsDisplay.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index b80d7945..7822af69 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -5,9 +5,7 @@ import { useDatabase } from "@/context/DatabaseContext"; import retrieveDataObject from "@/lib/utils/retrieveDataObject"; import { RxDocumentData } from "rxdb"; import NeedsSection from "./NeedsSection"; - import NeedsModal from "./NeedsModal"; -import { userAgent } from "next/server"; export interface Category { id: string; From 8a231a42c067516b2284d165657378766794a9f7 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:28:58 +0000 Subject: [PATCH 41/46] feat: expiry pushed to db --- src/app/needs/components/NeedsDisplay.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index 7822af69..c2e2beb4 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -103,6 +103,12 @@ export default function NeedsDisplay() { const docId = selectedNeed.id; await database.updateDocument("needs", docId, "mood", action); + await database.updateDocument( + "needs", + docId, + "selectedExpiry", + new Date(Date.now() + 6 * 60 * 60 * 1000).toISOString() + ); console.log(`Updated ${needName} with action: ${action}`); } else { console.log(`Need ${needName} not found`); From 487e283f3575ae97d117ca815aef13cf83528220 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 18:31:05 +0000 Subject: [PATCH 42/46] chore: remove unused imports and variables for build --- src/app/needs/components/NeedsDisplay.tsx | 6 ------ src/app/needs/components/NeedsModal.tsx | 1 - src/lib/utils/retrieveDataObject.ts | 1 - 3 files changed, 8 deletions(-) diff --git a/src/app/needs/components/NeedsDisplay.tsx b/src/app/needs/components/NeedsDisplay.tsx index c2e2beb4..4566fe11 100644 --- a/src/app/needs/components/NeedsDisplay.tsx +++ b/src/app/needs/components/NeedsDisplay.tsx @@ -32,7 +32,6 @@ export default function NeedsDisplay() { const [worthDoing, setWorthDoing] = useState(0); const [positiveLabel, setPositiveLabel] = useState("urgent"); const [negativeLabel, setNegativeLabel] = useState("not urgent"); - const [isModalCompleted, setIsModalCompleted] = useState(false); const fetchCategories = async () => { const response = await database.getFromDb("needs_categories"); @@ -125,11 +124,9 @@ export default function NeedsDisplay() { handleIncrease(setEffortful); } else if (needsStep === 3) { handleIncrease(setWorthDoing); - setIsModalCompleted(true); setModalOpen(false); setNeedsStep(1); - setIsModalCompleted(false); } }; @@ -140,12 +137,9 @@ export default function NeedsDisplay() { handleDecrease(setEffortful); } else if (needsStep === 3) { handleDecrease(setWorthDoing); - setIsModalCompleted(true); setModalOpen(false); setNeedsStep(1); - - setIsModalCompleted(false); } }; diff --git a/src/app/needs/components/NeedsModal.tsx b/src/app/needs/components/NeedsModal.tsx index f90dc112..ef44e29b 100644 --- a/src/app/needs/components/NeedsModal.tsx +++ b/src/app/needs/components/NeedsModal.tsx @@ -1,7 +1,6 @@ import Button from "@/ui/shared/Button"; import { ChevronLeftIcon } from "@heroicons/react/24/outline"; import { XMarkIcon } from "@heroicons/react/24/outline"; -import { Dispatch, SetStateAction } from "react"; interface ModalProps { inputModal?: boolean; diff --git a/src/lib/utils/retrieveDataObject.ts b/src/lib/utils/retrieveDataObject.ts index 54ea1d07..5916dfdf 100644 --- a/src/lib/utils/retrieveDataObject.ts +++ b/src/lib/utils/retrieveDataObject.ts @@ -1,5 +1,4 @@ import { RxDocument } from "rxdb"; -import { Insight } from "@/app/insights/components/InsightsDisplay"; export default function retrieveDataObject(dataArr: RxDocument[]): T[] { return dataArr.map((item) => item._data); From 65b75c29b3c3b2e3866f0225d9d7a1e36a6876d4 Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 21:39:32 +0000 Subject: [PATCH 43/46] chore: delete mock data --- public/mockNeeds.json | 795 ------------------------------------------ 1 file changed, 795 deletions(-) delete mode 100644 public/mockNeeds.json diff --git a/public/mockNeeds.json b/public/mockNeeds.json deleted file mode 100644 index fb9589c9..00000000 --- a/public/mockNeeds.json +++ /dev/null @@ -1,795 +0,0 @@ -{ - "needs_categories": [ - { - "id": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "name": "Physical Nurturance", - "timestamp": "2024-12-10T15:17:36.547Z" - }, - { - "id": "66221ab6-46b8-46a3-b9ff-478afb12940f", - "name": "Play", - "timestamp": "2024-12-10T15:17:36.547Z" - }, - { - "id": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "name": "Interdependence", - "timestamp": "2024-12-10T15:17:36.547Z" - }, - { - "id": "1b3b0001-360e-4f8c-946d-8b135205562e", - "name": "Celebration", - "timestamp": "2024-12-10T15:17:36.547Z" - }, - { - "id": "13ed4141-3343-44f4-af0f-5292ec6a7964", - "name": "Harmony", - "timestamp": "2024-12-10T15:17:36.547Z" - }, - { - "id": "880014f1-0e49-4d08-9400-23600831a6c2", - "name": "Integrity", - "timestamp": "2024-12-10T15:17:36.547Z" - }, - { - "id": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "name": "Autonomy", - "timestamp": "2024-12-10T15:17:36.547Z" - } - ], - "needs": [ - { - "id": "dedf2b69-fe4c-4205-9ca4-2bc3c2b995da", - "name": "Air", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "8a8df84e-9963-46e2-a7f2-7522485313b5", - "name": "Food", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "a8e31e05-c707-42c1-895c-7e3f4353114e", - "name": "Water", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "64534066-516a-4dc9-8b1d-92a2c2f10c27", - "name": "Movement", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "a6e9c563-a1bf-4bd4-bde1-af000743a226", - "name": "Exercise", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "685ff3c6-de40-4e4b-88bc-5a5780b1f628", - "name": "Protection (insects, bacteria, virus, predators)", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "36ea203c-ed36-491d-90fa-e52767b3b163", - "name": "Rest", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "758d3716-5e68-4d5e-8a60-e4e36300c4c3", - "name": "Sexual expression", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "faae10bf-7edd-4118-aedd-6ff735ed3f62", - "name": "Shelter", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "fbbaa1ee-b7da-4f58-88eb-a7f68a42d81d", - "name": "Touch", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "9aac6dbc-d9e3-45f4-a0b0-c5c379a34a49", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "35fe9f0d-3859-48cb-9d16-0664a6dc913b", - "name": "Play", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "66221ab6-46b8-46a3-b9ff-478afb12940f", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "3849f27f-8358-40e0-9324-a6747ce80d0d", - "name": "Laughter", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "66221ab6-46b8-46a3-b9ff-478afb12940f", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "6023a9b9-5897-4057-862a-08e2c334f128", - "name": "Acceptance", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "42ebe78c-092b-4b6f-9e59-2896a69b56a9", - "name": "Appreciation", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "d244527e-9491-47c3-bbe2-e3c81ca6297c", - "name": "Closeness", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "b1c3bdb0-a381-4004-a5ba-b5aa318e2128", - "name": "Community", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "ece09737-f015-4dca-8bf8-123a6088e3fe", - "name": "Consideration", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "a41bfa91-bece-4601-9e7c-f6d1746ac346", - "name": "Contribution to the enrichment of life", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "d39c7168-b911-4d5e-83d2-e245738e8256", - "name": "Emotional safety", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "47f63844-b1ea-4b68-a6a4-c68e65ed0e06", - "name": "Empathy", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "ada9da25-dde6-4de6-924a-26650e4a188b", - "name": "Honesty", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "ea9b97a9-ded7-4b1e-97a1-8d5819e86a74", - "name": "Love", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "0bb747e5-0842-4bf1-a450-f439f431b3b4", - "name": "Reassurance", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "bac5d411-fdc4-4f1b-8f2c-c6c73879647e", - "name": "Respect", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "3e3b6b12-31b3-48b7-a338-a24dafd1104a", - "name": "Support", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "2c3493b8-7d8c-4e82-bcb3-2727da8e18fe", - "name": "Trust", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "23070cd9-f5bb-4d0f-981e-4cddbb55deee", - "name": "Understanding", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "1d823d69-63f6-4652-8a85-91d2b8a7438f", - "name": "Warmth", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "e6b23851-8b50-450b-8a02-1ebc36e65945", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "9d98558b-8743-4bd1-8774-f215020a04b1", - "name": "Celebration of life fulfilled", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "1b3b0001-360e-4f8c-946d-8b135205562e", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "e283adcc-a34d-41ef-98bf-b164485f6492", - "name": "Celebration of dreams fulfilled", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "1b3b0001-360e-4f8c-946d-8b135205562e", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "f4fc125f-44d6-4cc9-b072-92aa5db57b3c", - "name": "Mourning of dreams unfulfilled", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "1b3b0001-360e-4f8c-946d-8b135205562e", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "3dc7e7a1-054e-4015-8cb2-0a98d83bb09d", - "name": "Mourning losses of loved ones", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "1b3b0001-360e-4f8c-946d-8b135205562e", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "cf59fc82-b810-42a8-a655-3d23b581197a", - "name": "Peace", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "2b747dad-d7aa-4bb3-8d22-8d441a3c6979", - "name": "Order", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "285b4668-2fae-45c8-a6b6-585536ed4dcd", - "name": "Harmony", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "5bede4df-5764-4ae4-9957-afd45cd904ce", - "name": "Beauty", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "d4902d05-fd0d-4435-95f4-19c9dd8f3826", - "name": "Inspiration", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "13ed4141-3343-44f4-af0f-5292ec6a7964", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "0cadf94f-7461-4275-87d1-631003605749", - "name": "Authenticity", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "880014f1-0e49-4d08-9400-23600831a6c2", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "b7628eab-73f7-4ba3-8f11-7bc18c4de0d5", - "name": "Creativity", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "880014f1-0e49-4d08-9400-23600831a6c2", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "4d8af0d6-5f33-42af-ab7a-bbbde196b28e", - "name": "Meaning", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "880014f1-0e49-4d08-9400-23600831a6c2", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "c5e0ae96-43cb-4b91-b5c0-434497a8310f", - "name": "Self worth", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "880014f1-0e49-4d08-9400-23600831a6c2", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "cbf6f603-9567-4e9a-a4c1-b907b531a496", - "name": "Choose dreams", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "d2b221e9-c52d-4d20-aa78-787429dc996f", - "name": "Choose goals", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "741d2de3-d926-4b0d-8c40-83463f6646ec", - "name": "Choose values", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "ef6d63a4-10de-4aa7-b33c-2c30a8ea827a", - "name": "Choose plan to fulfil dreams", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "39179b5b-cec9-4776-aaf4-24c5b38202c0", - "name": "Choose plan to fulfil goals", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "29a003a5-431f-43fd-84b8-985cc3bc2b8c", - "name": "Choose plan to fulfil values", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "category": "c35521e1-be5b-4b8c-989c-7605528be6ee", - "timestamp": "2024-12-10T15:17:36.548Z" - } - ], - "next_actions": [ - { - "id": "d2ec15b7-19fd-4e84-8680-bac86ec33f6c", - "name": "Find fresh air to breathe deeply.", - "need": "dedf2b69-fe4c-4205-9ca4-2bc3c2b995da", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "59e8ef21-6094-4ed4-9cec-c9ac04e397f5", - "name": "Prepare or purchase a nutritious meal.", - "need": "8a8df84e-9963-46e2-a7f2-7522485313b5", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "31aac61f-ad24-40df-9b2a-5bfa26edce8b", - "name": "Drink a glass of water.", - "need": "a8e31e05-c707-42c1-895c-7e3f4353114e", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "3e07f49c-f1ed-4acf-bdee-cc743758ee17", - "name": "Stretch or take a short walk.", - "need": "64534066-516a-4dc9-8b1d-92a2c2f10c27", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "00d37b2e-4d7a-4b03-9525-fb6b6c0d4cc6", - "name": "Schedule time for a workout.", - "need": "a6e9c563-a1bf-4bd4-bde1-af000743a226", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "36a86148-37bf-447a-89c3-fd42ad356439", - "name": "Secure a safe environment.", - "need": "685ff3c6-de40-4e4b-88bc-5a5780b1f628", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.548Z", - "timestamp": "2024-12-10T15:17:36.548Z" - }, - { - "id": "1f3c6dcb-4fc0-42cb-b0a3-f1d9915da1cd", - "name": "Take a moment to relax and recharge.", - "need": "36ea203c-ed36-491d-90fa-e52767b3b163", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "051b020e-1720-45e9-b59b-f28bc2e8b70d", - "name": "Communicate openly about your needs.", - "need": "758d3716-5e68-4d5e-8a60-e4e36300c4c3", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "22f82239-7ab6-48d4-89ab-6a13963f3172", - "name": "Ensure your space is clean and welcoming.", - "need": "faae10bf-7edd-4118-aedd-6ff735ed3f62", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "f711f6d1-2f31-4bd7-9f5b-c806d059fc5d", - "name": "Reach out for a hug or comforting touch.", - "need": "fbbaa1ee-b7da-4f58-88eb-a7f68a42d81d", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "e61e6a22-0335-4470-8088-a03c42642988", - "name": "Engage in a favorite game or activity.", - "need": "35fe9f0d-3859-48cb-9d16-0664a6dc913b", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "6fd0ac17-5c58-46d6-a12a-58a705620fca", - "name": "Watch something funny or joke with friends.", - "need": "3849f27f-8358-40e0-9324-a6747ce80d0d", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "20f024fe-b269-48df-ad96-e26bafdc486b", - "name": "Practice self-acceptance through affirmations.", - "need": "6023a9b9-5897-4057-862a-08e2c334f128", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "2f46689f-8985-4cb8-a80e-1117d75c9ee1", - "name": "Express gratitude to someone you care about.", - "need": "42ebe78c-092b-4b6f-9e59-2896a69b56a9", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "48816636-6cd2-4fa4-9188-a9648203a7b1", - "name": "Reach out to connect with a loved one.", - "need": "d244527e-9491-47c3-bbe2-e3c81ca6297c", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "630844fb-8f1e-4d8f-819e-8c560796b7d2", - "name": "Participate in a group or social event.", - "need": "b1c3bdb0-a381-4004-a5ba-b5aa318e2128", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "ca8796a5-1d0b-4bda-a112-8fd6787a7051", - "name": "Take a moment to listen actively.", - "need": "ece09737-f015-4dca-8bf8-123a6088e3fe", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "a4ee9766-d9e1-49aa-8a33-46450cc4ed28", - "name": "Volunteer or offer help to someone in need.", - "need": "a41bfa91-bece-4601-9e7c-f6d1746ac346", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "fb71d269-318c-45b0-9308-b1c80e1c943d", - "name": "Talk to a trusted friend about your feelings.", - "need": "d39c7168-b911-4d5e-83d2-e245738e8256", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "fbf95136-4b00-4d40-b08e-98792ef8fb0d", - "name": "Put yourself in someone else's shoes.", - "need": "47f63844-b1ea-4b68-a6a4-c68e65ed0e06", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "425fc221-21be-4261-be75-a144e8fdc807", - "name": "Share your thoughts transparently.", - "need": "ada9da25-dde6-4de6-924a-26650e4a188b", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "773fe4e3-b68d-47c3-bbe2-e6cbd3ff5625", - "name": "Spend quality time with someone close to you.", - "need": "ea9b97a9-ded7-4b1e-97a1-8d5819e86a74", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "f545581e-ae9b-4a3b-9fb1-33b19a5e8f85", - "name": "Ask for or provide encouragement.", - "need": "0bb747e5-0842-4bf1-a450-f439f431b3b4", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "f9f7e511-0382-4352-85c6-3ea132d4e7fb", - "name": "Acknowledge someone's boundaries or contributions.", - "need": "bac5d411-fdc4-4f1b-8f2c-c6c73879647e", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "7fd03381-fc68-4283-9c9d-94f3c1ffd87f", - "name": "Offer or ask for support from friends or family.", - "need": "3e3b6b12-31b3-48b7-a338-a24dafd1104a", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "fed2a3f5-df29-4206-9a92-b8c5dbd0323e", - "name": "Engage in a trust-building activity.", - "need": "2c3493b8-7d8c-4e82-bcb3-2727da8e18fe", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "ce559d3f-70bd-443f-87f2-dc6f1e759c33", - "name": "Seek to understand another's perspective.", - "need": "23070cd9-f5bb-4d0f-981e-4cddbb55deee", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "4fd6936d-d439-4293-a785-b9a8abaac565", - "name": "Create a cozy environment for yourself.", - "need": "1d823d69-63f6-4652-8a85-91d2b8a7438f", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "d40fbba6-f226-429d-b3b3-c3128037d124", - "name": "Plan a small celebration.", - "need": "9d98558b-8743-4bd1-8774-f215020a04b1", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "e769958e-86e8-4cf6-a152-c4964737caed", - "name": "Acknowledge and celebrate achievements.", - "need": "e283adcc-a34d-41ef-98bf-b164485f6492", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "035cc678-4b31-42c4-9094-5a2e11b167c2", - "name": "Reflect and journal about your emotions.", - "need": "f4fc125f-44d6-4cc9-b072-92aa5db57b3c", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "8ae45a9a-a9f3-40d3-9d5b-9007b43aeed5", - "name": "Honor their memory in a meaningful way.", - "need": "3dc7e7a1-054e-4015-8cb2-0a98d83bb09d", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "28bb5454-aefb-4940-b129-5b20ff1429ee", - "name": "Meditate or spend time in a calm space.", - "need": "cf59fc82-b810-42a8-a655-3d23b581197a", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "a5639c2c-926f-4b4b-9e2e-ff99b6039e06", - "name": "Organize your workspace or schedule.", - "need": "2b747dad-d7aa-4bb3-8d22-8d441a3c6979", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "7a8e780e-db04-472d-802d-a5ea8dcb401c", - "name": "Seek resolution in lingering conflicts.", - "need": "285b4668-2fae-45c8-a6b6-585536ed4dcd", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "1352ec77-4280-4f39-8522-572bad96c0aa", - "name": "Visit a place or object that inspires beauty.", - "need": "5bede4df-5764-4ae4-9957-afd45cd904ce", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "e416e9d6-d074-43d6-b0f7-2d8db11ef158", - "name": "Explore art or literature for new ideas.", - "need": "d4902d05-fd0d-4435-95f4-19c9dd8f3826", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "8d59a4dd-fdab-4f30-bb7f-777bfabdcc3c", - "name": "Take a step that reflects your true self.", - "need": "0cadf94f-7461-4275-87d1-631003605749", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "6382845d-6ef2-40b1-a8ee-943333fe9956", - "name": "Work on a creative project.", - "need": "b7628eab-73f7-4ba3-8f11-7bc18c4de0d5", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "d3507e5b-e2aa-4b12-9c3e-6e39fe535d47", - "name": "Reflect on what gives you purpose.", - "need": "4d8af0d6-5f33-42af-ab7a-bbbde196b28e", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "74677fd1-da84-457e-91c5-5cd9df992214", - "name": "Write a list of your positive attributes.", - "need": "c5e0ae96-43cb-4b91-b5c0-434497a8310f", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "f48bd643-c5a5-42bc-bffb-24a1d6f12e33", - "name": "Visualize your ideal future.", - "need": "cbf6f603-9567-4e9a-a4c1-b907b531a496", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "9eda62f6-c713-43e3-ab0a-e4efaf803202", - "name": "Set clear, actionable goals.", - "need": "d2b221e9-c52d-4d20-aa78-787429dc996f", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "f4a01ca0-6363-46c6-804d-6743e43cf3fb", - "name": "Identify your core values.", - "need": "741d2de3-d926-4b0d-8c40-83463f6646ec", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "f0e8adc7-a1b5-420b-a058-78f7ff7cc817", - "name": "Create a roadmap to achieve your dreams.", - "need": "ef6d63a4-10de-4aa7-b33c-2c30a8ea827a", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "d4dbfe26-f06c-41f9-8e11-734ce32bbce7", - "name": "Break down your goals into steps.", - "need": "39179b5b-cec9-4776-aaf4-24c5b38202c0", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - }, - { - "id": "b84e7cb7-6012-4b58-8fc4-7fddd3d97968", - "name": "Act in alignment with your values.", - "need": "29a003a5-431f-43fd-84b8-985cc3bc2b8c", - "selectedTimestamps": [], - "selectedExpiry": "2024-12-10T15:17:36.549Z", - "timestamp": "2024-12-10T15:17:36.549Z" - } - ] -} From 22bf8057426b70cb11d9a25edeec301c87ec5c74 Mon Sep 17 00:00:00 2001 From: jackcasstlesjones <96030524+jackcasstlesjones@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:41:16 +0000 Subject: [PATCH 44/46] remove comment in database manager Co-authored-by: Maxime Downe <81163597+maxitect@users.noreply.github.com> --- src/lib/db/DatabaseManager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/db/DatabaseManager.ts b/src/lib/db/DatabaseManager.ts index 061e8fe6..fe1ab01b 100644 --- a/src/lib/db/DatabaseManager.ts +++ b/src/lib/db/DatabaseManager.ts @@ -200,7 +200,6 @@ class DatabaseManager { [field]: update, }); - // Log after the update is complete console.log(`Updated document in ${collectionName}:`, updatedDocument); return updatedDocument; } catch (error) { From 9b8294dd95cd6e5907a330b913acb9d4db16b16b Mon Sep 17 00:00:00 2001 From: jackcasstlesjones <96030524+jackcasstlesjones@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:41:26 +0000 Subject: [PATCH 45/46] delete another comment Co-authored-by: Maxime Downe <81163597+maxitect@users.noreply.github.com> --- src/lib/db/DatabaseManager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/db/DatabaseManager.ts b/src/lib/db/DatabaseManager.ts index fe1ab01b..b50bfa0a 100644 --- a/src/lib/db/DatabaseManager.ts +++ b/src/lib/db/DatabaseManager.ts @@ -195,7 +195,6 @@ class DatabaseManager { ); } - // Await the patch operation const updatedDocument = await document.patch({ [field]: update, }); From f36d43480b9035f5c63cca335d3ade13dabc397c Mon Sep 17 00:00:00 2001 From: Jack Casstles-Jones Date: Wed, 11 Dec 2024 21:42:00 +0000 Subject: [PATCH 46/46] chore: delete unused file --- src/app/needs/questions/page.tsx | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/app/needs/questions/page.tsx diff --git a/src/app/needs/questions/page.tsx b/src/app/needs/questions/page.tsx deleted file mode 100644 index 9208ce17..00000000 --- a/src/app/needs/questions/page.tsx +++ /dev/null @@ -1,8 +0,0 @@ -export default function QuestionsPage() { - return ( - <> -

hello

-

hello

- - ); -}