From 2c9e2c0db8e1450d1c6788fff04856ca3f3054a3 Mon Sep 17 00:00:00 2001 From: saidam90 Date: Tue, 16 Jul 2024 04:15:58 +0400 Subject: [PATCH 1/2] Change font size and title style --- src/app/terms/layout.tsx | 15 +++++++- src/app/terms/page.mdx | 2 -- src/app/updateTranslations.js | 65 ----------------------------------- 3 files changed, 14 insertions(+), 68 deletions(-) delete mode 100644 src/app/updateTranslations.js diff --git a/src/app/terms/layout.tsx b/src/app/terms/layout.tsx index ba126d27..5e36ad86 100644 --- a/src/app/terms/layout.tsx +++ b/src/app/terms/layout.tsx @@ -1,4 +1,17 @@ export default function MdxLayout({ children }: { children: React.ReactNode }) { // Create any shared layout or styles here - return
{children}
; + return ( +
+
+

+ Terms of Service +

+
{children}
+
+
+ ); } diff --git a/src/app/terms/page.mdx b/src/app/terms/page.mdx index 430ec675..b0604f70 100644 --- a/src/app/terms/page.mdx +++ b/src/app/terms/page.mdx @@ -1,5 +1,3 @@ -# Terms of Service - Last updated: December 8, 2023 ## Introduction diff --git a/src/app/updateTranslations.js b/src/app/updateTranslations.js deleted file mode 100644 index 26a98581..00000000 --- a/src/app/updateTranslations.js +++ /dev/null @@ -1,65 +0,0 @@ -// script to update translations with 'node src/app/updateTranslations.js' - -const fs = require("fs"); -const path = require("path"); - -const exceptions = ["DeXter", "Radix", "DAO", "$DEXTR", "DEXTR", "$XRD"]; - -const capitalizeSentence = (str) => { - const segments = str.split(/(?<=[.!?])\s+/); - - const capitalizedSegments = segments.map((segment) => { - const trimmedSegment = segment.trim(); - - const words = trimmedSegment.split(/\s+/); - const isException = words.some((word) => exceptions.includes(word)); - - if (isException) { - return segment; - } - - // capitalize the first letter of the first word and convert the rest to lowercase - let capitalizedSegment = words - .map((word, i) => - i === 0 - ? word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() - : word.toLowerCase() - ) - .join(" "); - - return capitalizedSegment; - }); - - return capitalizedSegments.join(" "); -}; - -// Function to update the translations in a given file -const updateTranslations = (filePath) => { - const data = JSON.parse(fs.readFileSync(filePath, "utf8")); - for (const key in data) { - if (data.hasOwnProperty(key)) { - data[key] = capitalizeSentence(data[key]); - } - } - fs.writeFileSync(filePath, JSON.stringify(data, null, 2), "utf8"); -}; - -const translationDirs = ["state/locales/en", "state/locales/pt"]; -const translationFiles = [ - "enums.json", - "errors.json", - "footer.json", - "landing.json", - "rewards.json", - "trade.json", -]; - -// Update each translation file -translationDirs.forEach((dir) => { - translationFiles.forEach((file) => { - const filePath = path.join(__dirname, dir, file); - updateTranslations(filePath); - }); -}); - -console.log("Translations updated successfully!"); From f5e7a23a9cbd00faceeffbee59cfdd0ffbcb625d Mon Sep 17 00:00:00 2001 From: saidam90 Date: Tue, 16 Jul 2024 21:25:59 +0400 Subject: [PATCH 2/2] Fix max width to a medium screen size --- src/app/terms/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/terms/layout.tsx b/src/app/terms/layout.tsx index 5e36ad86..8af1026a 100644 --- a/src/app/terms/layout.tsx +++ b/src/app/terms/layout.tsx @@ -2,7 +2,7 @@ export default function MdxLayout({ children }: { children: React.ReactNode }) { // Create any shared layout or styles here return (
-
+