Skip to content

Commit

Permalink
v3 - Add translation to roles for employees (#947)
Browse files Browse the repository at this point in the history
  • Loading branch information
idamand authored Dec 4, 2024
1 parent c0baf5f commit 44d94e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import { useTranslations } from "next-intl";

import Text from "src/components/text/Text";
import formatPhoneNumber from "src/components/utils/formatPhoneNumber";
Expand All @@ -15,6 +16,8 @@ export interface CustomerCaseEmployeeCardProps {
export default function CustomerCaseEmployeeCard({
employee,
}: CustomerCaseEmployeeCardProps) {
const t = useTranslations("employee_card");

return (
employee.imageThumbUrl &&
employee.name &&
Expand All @@ -38,7 +41,7 @@ export default function CustomerCaseEmployeeCard({
type="labelRegular"
key={competence}
>
{competence}
{t(competence)}
</Text>
))}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/employeeCard/EmployeeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Image from "next/image";
import Link from "next/link";
import { useTranslations } from "next-intl";

import Text from "src/components/text/Text";
import formatPhoneNumber from "src/components/utils/formatPhoneNumber";
Expand All @@ -19,6 +20,7 @@ export default function EmployeeCard({
employeePageSlug,
language,
}: EmployeeCardProps) {
const t = useTranslations("employee_card");
return (
employee.imageUrl &&
employee.name &&
Expand Down Expand Up @@ -56,7 +58,7 @@ export default function EmployeeCard({
key={competence}
as="span"
>
{competence}
{t(competence)}
</Text>
))}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/employeePage/EmployeePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import { useTranslations } from "next-intl";

import Text from "src/components/text/Text";
import formatPhoneNumber from "src/components/utils/formatPhoneNumber";
Expand All @@ -12,6 +13,7 @@ export interface EmployeePageProps {

export default function EmployeePage({ employee }: EmployeePageProps) {
const image = employee.imageUrl ?? employee.imageThumbUrl ?? null;
const t = useTranslations("employee_card");

return (
employee.name && (
Expand Down Expand Up @@ -47,7 +49,7 @@ export default function EmployeePage({ employee }: EmployeePageProps) {
)}
{employee.competences.map((competence) => (
<Text type="bodyNormal" key={competence}>
{competence}
{t(competence)}
</Text>
))}
</div>
Expand Down

0 comments on commit 44d94e9

Please sign in to comment.