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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ Applying technology in the effort to support underserved communities is a key va

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

## Background
We use simple react/vite app for landing page, aka [website], which is being served from files on S3 using Amplify
we're also developing a PWA on nextjs for automation of need4deed business processes, this is fe repo. also we use separate repo sdk mostly for sharing of types between fron and backend.
also we plan merging our landing page into the app so in the end there should be frontend, backend, and sdk.
so the website is now kind of frozen in terms of development. it still operates along with legacy backend before we launch the app with the new backend.


## Step 1: Fork the Repository

1. Go to the our repository: [https://gitlab.com/need4deed/website](https://gitlab.com/need4deed/website).
1. Go to the our repository: [https://github.com/need4deed-org/website](https://github.com/need4deed-org/website).
1. Click the **Fork** button in the top-right corner.
1. Choose where to fork the repository (usually your own GitLab account).

Expand Down
7 changes: 4 additions & 3 deletions src/components/VolunteeringOpportunities/OpportunityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { useTranslation } from "react-i18next";
import styled from "styled-components";

import { OpportunityType } from "need4deed-sdk";
import { Lang, OpportunityType } from "need4deed-sdk";
import { ScreenTypes } from "../../config/types";
import useScreenType from "../../hooks/useScreenType";
import { Activities } from "../core/common";
Expand Down Expand Up @@ -92,6 +92,7 @@ export default function OpportunityCard({
}: Props) {
const { t, i18n } = useTranslation();
const screenType = useScreenType();
const language = i18n.language as Lang;

const {
title,
Expand Down Expand Up @@ -137,7 +138,7 @@ export default function OpportunityCard({

const district = locations.join(", ");
const scheduleAsStr =
(accompanyingDate && formatAccompanyingDate(accompanyingDate)) ||
(accompanyingDate && formatAccompanyingDate(accompanyingDate, language)) ||
schedule ||
"";

Expand Down Expand Up @@ -170,7 +171,7 @@ export default function OpportunityCard({
enableHoverEffect={enableHoverEffect}
>
<IconDiv>{iconNameMap[iconName]}</IconDiv>
<HyphenatedHeading3 lang={i18n.language}>{title}</HyphenatedHeading3>
<HyphenatedHeading3 lang={language}>{title}</HyphenatedHeading3>
{vo && <Paragraph>{voInformation}</Paragraph>}
<Activities activities={activities} />
<OpportunityCardDetails cardDetails={cardDetails} />
Expand Down
15 changes: 11 additions & 4 deletions src/components/VolunteeringOpportunities/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OpportunityType, TranslatedIntoType } from "need4deed-sdk";
import { Lang, OpportunityType, TranslatedIntoType } from "need4deed-sdk";

import { TFunction } from "i18next";
import { IconName } from "../VolunteeringCategories/types";
Expand Down Expand Up @@ -192,7 +192,14 @@ export const getActivityBackgroundColor = (activity: string) => {
: "var(--color-papaya)";
};

export const formatAccompanyingDate = (date: Date) => {
const langLocaleMap: Record<Lang, string> = {
[Lang.EN]: "en-US",
[Lang.DE]: "de-DE",
};

export const formatAccompanyingDate = (date: Date, lang: Lang): string => {
const locale = langLocaleMap[lang];

const dateOptions: Intl.DateTimeFormatOptions = {
weekday: "long",
month: "long",
Expand All @@ -205,8 +212,8 @@ export const formatAccompanyingDate = (date: Date) => {
hour12: false,
};

const dateFormatter = new Intl.DateTimeFormat("en-US", dateOptions);
const timeFormatter = new Intl.DateTimeFormat("en-US", timeOptions);
const dateFormatter = new Intl.DateTimeFormat(locale, dateOptions);
const timeFormatter = new Intl.DateTimeFormat(locale, timeOptions);

const formattedDatePart: string = dateFormatter.format(date);
const formattedTimePart: string = timeFormatter.format(date);
Expand Down