Skip to content
Open
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
1 change: 1 addition & 0 deletions public/locales/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@
"postedOn": "Veröffentlicht am",
"currentStatus": "Aktueller Status",
"matchingStatus": "Matching-Status",
"agent": "Träger",
"status": {
"new": "Neu",
"active": "Aktiv",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@
"postedOn": "Posted on",
"currentStatus": "Current status",
"matchingStatus": "Matching status",
"agent": "Agent",
"status": {
"new": "New",
"active": "Active",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { EMPTY_PLACEHOLDER_VALUE } from "@/config/constants";
import { formatDateTime } from "@/utils";
import { ShootingStarIcon } from "@phosphor-icons/react";
import { ApiOpportunityGet, VolunteerStateMatchType } from "need4deed-sdk";
import Link from "next/link";
import { useTranslation } from "react-i18next";
import styled from "styled-components";
import { createVolunteerTypeLabelMap, EditButton, HeaderCard, IconContainer, StatusRowField } from "../common";
import { ChangeOpportunityStatusDialog } from "./ChangeOpportunityStatusDialog";
import { createMatchLabelMap } from "../volunteer/constants";
Expand All @@ -16,8 +18,18 @@ type Props = {
opportunity: OpportunityWithMatch;
};

const AgentLink = styled(Link)`
color: var(--color-blue-700);
font-size: var(--font-size-lg);
font-weight: var(--font-weight-semibold);
text-decoration: none;
&:hover {
text-decoration: underline;
}
`;

export const OpportunityHeader = ({ opportunity }: Props) => {
const { t } = useTranslation();
const { t, i18n } = useTranslation();
const dialog = useOpportunityStatusDialog(opportunity);
const statusLabelMap = createOpportunityStatusLabelMap(t);
const volunteerTypeLabelMap = createVolunteerTypeLabelMap(t);
Expand Down Expand Up @@ -56,6 +68,17 @@ export const OpportunityHeader = ({ opportunity }: Props) => {
status={opportunity.statusMatch}
label={opportunity.statusMatch ? matchLabelMap[opportunity.statusMatch] : undefined}
/>

{opportunity.agent?.id && (
<StatusRowField
title={t("dashboard.opportunityProfile.agent")}
extra={
<AgentLink href={`/${i18n.language}/dashboard/agents/${opportunity.agent.id}`}>
{opportunity.agent.name}
</AgentLink>
}
/>
)}
</HeaderCard>
);
};