From 095a4ec4ee8925d170dfc9f664535619d5ee7288 Mon Sep 17 00:00:00 2001 From: Skycat1983 Date: Thu, 24 Jul 2025 11:42:53 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=94=A5=20Remove=20new=20Form=20compon?= =?UTF-8?q?ent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/index.tsx | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 src/components/Form/index.tsx diff --git a/src/components/Form/index.tsx b/src/components/Form/index.tsx deleted file mode 100644 index 58742701..00000000 --- a/src/components/Form/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { FormApi, FormValidators, useForm } from "@tanstack/react-form"; -import Submit from "./Submit"; -import { ReactFormApiLike } from "./types"; - -interface Props { - defaultValues: T; - validators?: FormValidators; - onSubmit: (props: { value: T; formApi: FormApi }) => void; -} - -export default function Form({ - defaultValues, - validators, - onSubmit, -}: Props) { - const form = useForm({ defaultValues, validators, onSubmit }); - return ( -
-
{ - e.preventDefault(); - e.stopPropagation(); - form.handleSubmit(); - }} - > - - form={form as FormApi & ReactFormApiLike} - label="Submit" - /> - -
- ); -} From 1d27cad0d26c45854156f2b960f7fddfffdbe79f Mon Sep 17 00:00:00 2001 From: Skycat1983 Date: Thu, 24 Jul 2025 11:43:58 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=94=A5=20Remove=20unused=20Form=20com?= =?UTF-8?q?ponents=20and=20related=20types=20for=20opportunity=20and=20vol?= =?UTF-8?q?unteer=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/Submit.tsx | 32 -------------------- src/components/Form/opportunity/index.ts | 9 ------ src/components/Form/types.ts | 9 ------ src/components/Form/volunteer/index.ts | 37 ------------------------ 4 files changed, 87 deletions(-) delete mode 100644 src/components/Form/Submit.tsx delete mode 100644 src/components/Form/opportunity/index.ts delete mode 100644 src/components/Form/types.ts delete mode 100644 src/components/Form/volunteer/index.ts diff --git a/src/components/Form/Submit.tsx b/src/components/Form/Submit.tsx deleted file mode 100644 index aff99c23..00000000 --- a/src/components/Form/Submit.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { FormApi, FormState } from "@tanstack/react-form"; -import { ReactFormApiLike } from "./types"; - -interface Props { - form: FormApi & ReactFormApiLike; - label?: string; - classDiv?: string; - classButton?: string; -} - -export default function Submit({ - form, - label, - classDiv, - classButton, -}: Props) { - return ( - ) => state}> - {(state: Partial>) => ( -
- -
- )} -
- ); -} diff --git a/src/components/Form/opportunity/index.ts b/src/components/Form/opportunity/index.ts deleted file mode 100644 index 6d6c28cc..00000000 --- a/src/components/Form/opportunity/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -const defaultValues = {}; -const validators = {}; -const structure = {}; -function onSubmit({ value }: { value: typeof defaultValues }) { - // eslint-disable-next-line no-console - console.log("DEBUG:opportunity:onSubmit:value:", value); -} - -export default { defaultValues, onSubmit, validators, structure }; diff --git a/src/components/Form/types.ts b/src/components/Form/types.ts deleted file mode 100644 index c1d12f38..00000000 --- a/src/components/Form/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FormState } from "@tanstack/react-form"; -import { ComponentType, ReactNode } from "react"; - -export type ReactFormApiLike = { - Subscribe: ComponentType<{ - selector: (state: FormState) => FormState; - children: (selectedState: Partial) => ReactNode; - }>; -}; diff --git a/src/components/Form/volunteer/index.ts b/src/components/Form/volunteer/index.ts deleted file mode 100644 index 76068879..00000000 --- a/src/components/Form/volunteer/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import fallbackLists from "../../forms/fallbackLists"; -import { ListsOfOptions } from "../../forms/types"; -import { getAllSelectedFalse, getScheduleState } from "../../forms/utils"; - -const lists = fallbackLists; -const defaultValues = { - name: "", - email: "", - phone: "", - postcode: "", - locations: getAllSelectedFalse(lists[ListsOfOptions.LOCATIONS]), - availability: getScheduleState(), - languagesNative: getAllSelectedFalse(lists[ListsOfOptions.LANGUAGES]), - languagesFluent: getAllSelectedFalse(lists[ListsOfOptions.LANGUAGES]), - languagesIntermediate: getAllSelectedFalse(lists[ListsOfOptions.LANGUAGES]), - activities: getAllSelectedFalse(lists[ListsOfOptions.ACTIVITIES]), - skills: getAllSelectedFalse(lists[ListsOfOptions.SKILLS]), - certOfGoodConduct: undefined, - certMeaslesVaccination: undefined, - leadFrom: getAllSelectedFalse(lists[ListsOfOptions.LEADS]), - comments: "", - consent: undefined, -}; - -const validators = {}; - -const structure = { - main: {}, - sections: {}, -}; - -function onSubmit({ value }: { value: typeof defaultValues }) { - // eslint-disable-next-line no-console - console.log("DEBUG:volunteer:onSubmit:value:", value); -} - -export default { defaultValues, onSubmit, validators, structure }; From 7240f92b0c950e9f4ae7e126b09b2abd6fc9d5a3 Mon Sep 17 00:00:00 2001 From: Skycat1983 Date: Thu, 24 Jul 2025 11:44:53 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=94=A5=20Clean=20up=20constants=20and?= =?UTF-8?q?=20simplify=20Subpage=20component=20by=20removing=20unused=20fe?= =?UTF-8?q?ature=20flags=20and=20related=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/constants.ts | 9 --------- src/pages/Subpage.tsx | 25 ++++--------------------- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/config/constants.ts b/src/config/constants.ts index 40dba87f..20ae907b 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -25,15 +25,6 @@ export const maxPLZBerlin = 14199; export const phoneRegEx = /^([+]?[\s0-9]+)?(\d{3}|[(]?[0-9]+[)])?([-]?[\s]?[0-9])+$/; -export const FF = { - NEW_FORMS_VOLUNTEER: positives.includes( - import.meta.env.VITE_FF_NEW_FORMS_VOLUNTEER, - ), - NEW_FORMS_OPPORTUNITY: positives.includes( - import.meta.env.VITE_FF_NEW_FORMS_OPPORTUNITY, - ), -}; - export const timeZone = import.meta.env.VITE_TZ || "Europe/Berlin"; export const screenSizeThresholds = { diff --git a/src/pages/Subpage.tsx b/src/pages/Subpage.tsx index a63791f3..53bf461f 100644 --- a/src/pages/Subpage.tsx +++ b/src/pages/Subpage.tsx @@ -2,16 +2,13 @@ import { Lang } from "need4deed-sdk"; import { useContext, useEffect, useMemo } from "react"; import ReactGA from "react-ga4"; import { useTranslation } from "react-i18next"; -import { useNavigate, useParams, useSearchParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import Announcement from "../components/Announcement"; import Event from "../components/Event/Event"; import Events from "../components/Event/Events"; import FAQs from "../components/FAQs/FAQs"; import Footer from "../components/Footer/Footer"; -import NewForm from "../components/Form"; -import opportunity from "../components/Form/opportunity"; -import volunteer from "../components/Form/volunteer"; import Form from "../components/forms"; import { FormType } from "../components/forms/types"; import Header from "../components/Header/Header"; @@ -20,7 +17,7 @@ import Cookie from "../components/Legal/Cookies"; import DataPrivacy from "../components/Legal/DataPrivacy"; import Guidelines from "../components/Legal/Guidelines"; import LegalNotice from "../components/Legal/Notice"; -import { FF, showEvent } from "../config/constants"; +import { showEvent } from "../config/constants"; import { Subpages } from "../config/types"; import AppContainerContext from "../contexts/AppContainerContext"; import useEvents from "../hooks/api/useEvents"; @@ -33,14 +30,10 @@ interface Props { function Subpage({ type }: Props) { const { i18n } = useTranslation(); const { lng } = useParams(); - const [ffNewForm] = useSearchParams(); const navigate = useNavigate(); const containerRef = useContext(AppContainerContext); const [events] = useEvents(i18n.language as Lang); - const ffOpp = ffNewForm.get("opp"); - const ffVol = ffNewForm.get("vol"); - const eventActive = useMemo( () => events?.find((event) => event.active), [events], @@ -71,19 +64,9 @@ function Subpage({ type }: Props) { case Subpages.GUIDELINES: return ; case Subpages.BECOME_VOLUNTEER: - return FF.NEW_FORMS_VOLUNTEER || ffVol ? ( - // eslint-disable-next-line react/jsx-props-no-spreading - {...volunteer} /> - ) : ( -
- ); + return ; case Subpages.ADD_OPPORTUNITY: - return FF.NEW_FORMS_OPPORTUNITY || ffOpp ? ( - // eslint-disable-next-line react/jsx-props-no-spreading - {...opportunity} /> - ) : ( - - ); + return ; case Subpages.ANNOUNCEMENT: return ; case Subpages.EVENT: From 78ebe4802897ed5afe9af2e2d1bc217988d903ba Mon Sep 17 00:00:00 2001 From: jagdishlove Date: Thu, 24 Jul 2025 15:16:25 +0100 Subject: [PATCH 4/6] fix testimonials behaviour --- .../core/paginatedCards/PaginatedCards.tsx | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/components/core/paginatedCards/PaginatedCards.tsx b/src/components/core/paginatedCards/PaginatedCards.tsx index 4e375e4c..2bf8696c 100644 --- a/src/components/core/paginatedCards/PaginatedCards.tsx +++ b/src/components/core/paginatedCards/PaginatedCards.tsx @@ -36,6 +36,7 @@ export function PaginatedCards({ const visibleCards = cards.slice(startIndex, endIndex); const nextCardElement = cards[endIndex]; + const shouldShowNavigation = totalPages > 1; const goToPage = (pageNumber: number) => { setCurrentPage(pageNumber); @@ -50,12 +51,14 @@ export function PaginatedCards({ id="paginated-cards-container" {...{ onTouchStart, onTouchEnd }} > - + {shouldShowNavigation && ( + + )} {isOverlayingCards ? ( @@ -74,13 +77,15 @@ export function PaginatedCards({ )} - + {shouldShowNavigation && ( + + )} ); } From 9a8b394944f76070cd906af7dd5647ff6c7a789c Mon Sep 17 00:00:00 2001 From: Jagdish Singh Mehra Date: Thu, 24 Jul 2025 19:30:18 +0100 Subject: [PATCH 5/6] Update PaginatedCards.tsx --- src/components/core/paginatedCards/PaginatedCards.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/core/paginatedCards/PaginatedCards.tsx b/src/components/core/paginatedCards/PaginatedCards.tsx index 2bf8696c..4953f8c8 100644 --- a/src/components/core/paginatedCards/PaginatedCards.tsx +++ b/src/components/core/paginatedCards/PaginatedCards.tsx @@ -36,7 +36,7 @@ export function PaginatedCards({ const visibleCards = cards.slice(startIndex, endIndex); const nextCardElement = cards[endIndex]; - const shouldShowNavigation = totalPages > 1; + const showNavigation = totalPages > 1; const goToPage = (pageNumber: number) => { setCurrentPage(pageNumber); @@ -51,7 +51,7 @@ export function PaginatedCards({ id="paginated-cards-container" {...{ onTouchStart, onTouchEnd }} > - {shouldShowNavigation && ( + {showNavigation && ( )} - {shouldShowNavigation && ( + {showNavigation && ( Date: Fri, 25 Jul 2025 19:10:34 +0000 Subject: [PATCH 6/6] fix: loading dep need4deed-sdk --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 28f78dab..fecc5445 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "bootstrap": "^5.3.3", "email-validator": "^2.0.4", "i18next": "^23.10.1", - "need4deed-sdk": "git+https://github.com/need4deed-org/sdk.git", + "need4deed-sdk": "", "react": "^18.2.0", "react-bootstrap": "^2.10.1", "react-cookie-consent": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 2dc1ad62..43be9d47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10947,9 +10947,10 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -"need4deed-sdk@git+https://github.com/need4deed-org/sdk.git": - version "0.0.7" - resolved "git+https://github.com/need4deed-org/sdk.git#3b1902a7c19966f66168d0f2ad761ea095e9dd21" +need4deed-sdk@: + version "0.0.12" + resolved "https://registry.yarnpkg.com/need4deed-sdk/-/need4deed-sdk-0.0.12.tgz#8d66a411f4ef6ce3ed5cb867457e51faf63df74c" + integrity sha512-SxTPpBMnbOD8csadN1UV/li7lXKPa9psUB0HexmC1o6PDIowMcp9ky+Ylw1dHAlQVJCYm7JdpNYq/YMobguMQA== neo-async@^2.6.0: version "2.6.2"