Skip to content

Commit

Permalink
Move some hardcoded strings to content.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanne committed Feb 10, 2025
1 parent d971ce2 commit bec3d58
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
9 changes: 9 additions & 0 deletions packages/dito/app/resources/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ export const header = {
"Dieses Angebot befindet sich im Aufbau und wird auf Basis Ihrer Rückmeldung weiterentwickelt.",
};

export const general = {
buttonBack: {
text: "Zurück",
},
tableOfContents: {
headline: "Inhalt",
},
};

const stepNKR = {
headline: {
text: "Prüfen durch den NKR",
Expand Down
8 changes: 6 additions & 2 deletions packages/dito/app/routes/methoden_.fuenf-prinzipien.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useLoaderData,
} from "@remix-run/react";
import SupportBanner from "components/SupportBanner";
import { fivePrinciples } from "resources/content";
import { fivePrinciples, general } from "resources/content";
import {
ROUTE_EXAMPLES,
ROUTE_METHODS,
Expand Down Expand Up @@ -74,7 +74,11 @@ export default function FivePrinciples() {
}}
/>
<div className="mt-64">
<Heading tagName="div" text="Inhalt" className="font-bold" />
<Heading
tagName="div"
text={general.tableOfContents.headline}
className="font-bold"
/>
<ol className="list-unstyled ds-stack-8 mt-16">

Check warning on line 82 in packages/dito/app/routes/methoden_.fuenf-prinzipien.tsx

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

Classname 'list-unstyled' is not a Tailwind CSS class!

Check warning on line 82 in packages/dito/app/routes/methoden_.fuenf-prinzipien.tsx

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

Classname 'list-unstyled' is not a Tailwind CSS class!
{fivePrinciples.principles.map((principle) => (
<li key={principle.label}>
Expand Down
4 changes: 2 additions & 2 deletions packages/dito/app/routes/vorpruefung.$questionId/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useForm, validationError } from "@rvf/remix";
import { withZod } from "@rvf/zod";
import LinkBar from "components/LinkBar";
import { useEffect, useState } from "react";
import { preCheck } from "resources/content";
import { general, preCheck } from "resources/content";
import { ROUTE_PRECHECK } from "resources/staticRoutes";
import {
getAnswersFromCookie,
Expand Down Expand Up @@ -200,7 +200,7 @@ export default function Index() {
},
{
id: "preCheck-back-button",
text: "Zurück",
text: general.buttonBack.text,
href: question.prevLink,
look: "tertiary",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/dito/app/routes/vorpruefung._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { MetaFunction } from "@remix-run/react";
import Accordion from "components/Accordion";
import SupportBanner from "components/SupportBanner";
import { PRE_CHECK_START_BUTTON_ID } from "resources/constants";
import { preCheck } from "resources/content";
import { general, preCheck } from "resources/content";
import {
ROUTE_GENERAL_INFO,
ROUTE_LANDING,
Expand Down Expand Up @@ -59,7 +59,7 @@ export default function Index() {
},
{
id: "preCheck-back-button",
text: "Zurück",
text: general.buttonBack.text,
href: ROUTE_LANDING.url,
look: "tertiary",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/dito/app/routes/vorpruefung.hinweise.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import InlineNotice from "@digitalcheck/shared/components/InlineNotice";
import RichText from "@digitalcheck/shared/components/RichText";
import { type LoaderFunctionArgs } from "@remix-run/node";
import { type MetaFunction, useLoaderData } from "@remix-run/react";
import { preCheck } from "resources/content";
import { general, preCheck } from "resources/content";
import { ROUTE_GENERAL_INFO, ROUTE_PRECHECK } from "resources/staticRoutes";
import { getAnswersFromCookie } from "utils/cookies.server";
import prependMetaTitle from "utils/metaTitle";
Expand Down Expand Up @@ -54,7 +54,7 @@ export default function GeneralInfo() {
},
{
id: "generalInfo-back-button",
text: "Zurück",
text: general.buttonBack.text,
href: ROUTE_PRECHECK.url,
look: "tertiary",
},
Expand Down
3 changes: 2 additions & 1 deletion packages/tool-finder/src/routes/Flowchart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Container from "@digitalcheck/shared/components/Container";
import Header from "@digitalcheck/shared/components/Header";
import useTitle from "services/useTitle";

import { general } from "@digitalcheck/dito/app/resources/content";
import Button from "@digitalcheck/shared/components/Button";
import Image from "@digitalcheck/shared/components/Image";
import flowchartElementsImage from "resources/img/flowchart-elements.png";
Expand Down Expand Up @@ -103,7 +104,7 @@ Der Start mag Ihnen leichter fallen, wenn Sie als Basis eine zeitliche Abfolge w
<Container className="pb-48 pt-0">
<Button
id="flowchart-guide-page-back-button"
text="Zurück"
text={general.buttonBack.text}
href={PATH_RESULT}
/>
</Container>
Expand Down

0 comments on commit bec3d58

Please sign in to comment.