Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
32 changes: 0 additions & 32 deletions src/components/Form/Submit.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions src/components/Form/index.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/Form/opportunity/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/Form/types.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/components/Form/volunteer/index.ts

This file was deleted.

31 changes: 18 additions & 13 deletions src/components/core/paginatedCards/PaginatedCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function PaginatedCards({
const visibleCards = cards.slice(startIndex, endIndex);

const nextCardElement = cards[endIndex];
const showNavigation = totalPages > 1;

const goToPage = (pageNumber: number) => {
setCurrentPage(pageNumber);
Expand All @@ -50,12 +51,14 @@ export function PaginatedCards({
id="paginated-cards-container"
{...{ onTouchStart, onTouchEnd }}
>
<ArrowButtons
currentIndex={currentPage}
lastIndex={totalPages - 1}
setCurrentIndex={setCurrentPage}
color={arrowButtonColor}
/>
{showNavigation && (
<ArrowButtons
currentIndex={currentPage}
lastIndex={totalPages - 1}
setCurrentIndex={setCurrentPage}
color={arrowButtonColor}
/>
)}

{isOverlayingCards ? (
<OverlayingVisibleCardsContainer id="overlaying-visible-cards-container">
Expand All @@ -74,13 +77,15 @@ export function PaginatedCards({
</VisibleCardsContainer>
)}

<PaginationIndicators
currentPage={currentPage}
totalPages={totalPages}
indicatorColor={bottomIndicatorColor}
currentIndicatorColor={bottomCurrentIndicatorColor}
goToPage={goToPage}
/>
{showNavigation && (
<PaginationIndicators
currentPage={currentPage}
totalPages={totalPages}
indicatorColor={bottomIndicatorColor}
currentIndicatorColor={bottomCurrentIndicatorColor}
goToPage={goToPage}
/>
)}
</PaginatedCardsContainer>
);
}
Expand Down
9 changes: 0 additions & 9 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
25 changes: 4 additions & 21 deletions src/pages/Subpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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],
Expand Down Expand Up @@ -71,19 +64,9 @@ function Subpage({ type }: Props) {
case Subpages.GUIDELINES:
return <Guidelines />;
case Subpages.BECOME_VOLUNTEER:
return FF.NEW_FORMS_VOLUNTEER || ffVol ? (
// eslint-disable-next-line react/jsx-props-no-spreading
<NewForm<typeof volunteer.defaultValues> {...volunteer} />
) : (
<Form form={FormType.VOLUNTEER} />
);
return <Form form={FormType.VOLUNTEER} />;
case Subpages.ADD_OPPORTUNITY:
return FF.NEW_FORMS_OPPORTUNITY || ffOpp ? (
// eslint-disable-next-line react/jsx-props-no-spreading
<NewForm<typeof opportunity.defaultValues> {...opportunity} />
) : (
<Form form={FormType.OPPORTUNITY} />
);
return <Form form={FormType.OPPORTUNITY} />;
case Subpages.ANNOUNCEMENT:
return <Announcement />;
case Subpages.EVENT:
Expand Down
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down