From 2d2d0dffd699419484c99ae5034e395deb562985 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Wed, 10 Jul 2024 13:17:27 +0300 Subject: [PATCH] Robots TXT generator requested changes --- apps/roboshield/payload-types.ts | 4 +- .../BlockRenderer/BlockRenderer.tsx | 4 +- .../src/components/CommonBots/CommonBots.tsx | 2 +- .../CommonSettings/CommonSettings.tsx | 2 +- .../src/components/Delays/Delays.tsx | 2 +- .../src/components/ExistingRobots/index.ts | 3 - .../ExistingRobotsTxt.tsx} | 2 +- .../src/components/ExistingRobotsTxt/index.ts | 3 + .../src/components/Finish/Finish.tsx | 2 +- apps/roboshield/src/components/Hero/Hero.tsx | 2 +- .../RobotsGenerator/RobotsGenerator.tsx | 215 ------------------ .../src/components/RobotsGenerator/index.ts | 3 - .../RobotsTxtGenerator/RobotsTxtGenerator.tsx | 213 +++++++++++++++++ .../components/RobotsTxtGenerator/index.ts | 3 + .../src/components/Sitemaps/Sitemaps.tsx | 2 +- .../SkipToLastStep/SkipToLastStep.tsx | 6 +- ...botsGenerator.ts => RobotsTxtGenerator.ts} | 44 ++-- .../src/payload/collections/Pages.ts | 4 +- 18 files changed, 260 insertions(+), 256 deletions(-) delete mode 100644 apps/roboshield/src/components/ExistingRobots/index.ts rename apps/roboshield/src/components/{ExistingRobots/ExistingRobots.tsx => ExistingRobotsTxt/ExistingRobotsTxt.tsx} (99%) create mode 100644 apps/roboshield/src/components/ExistingRobotsTxt/index.ts delete mode 100644 apps/roboshield/src/components/RobotsGenerator/RobotsGenerator.tsx delete mode 100644 apps/roboshield/src/components/RobotsGenerator/index.ts create mode 100644 apps/roboshield/src/components/RobotsTxtGenerator/RobotsTxtGenerator.tsx create mode 100644 apps/roboshield/src/components/RobotsTxtGenerator/index.ts rename apps/roboshield/src/payload/blocks/{RobotsGenerator.ts => RobotsTxtGenerator.ts} (91%) diff --git a/apps/roboshield/payload-types.ts b/apps/roboshield/payload-types.ts index 63dda496e..25d346789 100644 --- a/apps/roboshield/payload-types.ts +++ b/apps/roboshield/payload-types.ts @@ -108,7 +108,7 @@ export interface Page { blockType: "statistics"; } | { - toolTipText: string; + showRobotsTxt: string; steps?: | ( | { @@ -227,7 +227,7 @@ export interface Page { }; id?: string | null; blockName?: string | null; - blockType: "robots-generator"; + blockType: "robots-txt-generator"; } )[] | null; diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx index 6c60bd6a3..0f52ee963 100644 --- a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx +++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx @@ -3,7 +3,7 @@ import Content from "@/roboshield/components/Content"; import Statistics from "@/roboshield/components/Statistics"; import { Page } from "@/root/payload-types"; import Hero from "@/roboshield/components/Hero"; -import RobotsGenerator from "@/roboshield/components/RobotsGenerator"; +import RobotsTxtGenerator from "@/roboshield/components/RobotsTxtGenerator"; import { FC } from "react"; interface BlockRendererProps extends Pick {} @@ -13,7 +13,7 @@ const components = { "page-hero": Hero, content: Content, statistics: Statistics, - "robots-generator": RobotsGenerator, + "robots-txt-generator": RobotsTxtGenerator, }; export default function BlockRenderer({ blocks }: BlockRendererProps) { diff --git a/apps/roboshield/src/components/CommonBots/CommonBots.tsx b/apps/roboshield/src/components/CommonBots/CommonBots.tsx index 29e211965..cc01c11fb 100644 --- a/apps/roboshield/src/components/CommonBots/CommonBots.tsx +++ b/apps/roboshield/src/components/CommonBots/CommonBots.tsx @@ -87,7 +87,7 @@ export default function CommonBots({ diff --git a/apps/roboshield/src/components/CommonSettings/CommonSettings.tsx b/apps/roboshield/src/components/CommonSettings/CommonSettings.tsx index 3bf396c46..0592d4a70 100644 --- a/apps/roboshield/src/components/CommonSettings/CommonSettings.tsx +++ b/apps/roboshield/src/components/CommonSettings/CommonSettings.tsx @@ -96,7 +96,7 @@ export default function CommonSettings({ diff --git a/apps/roboshield/src/components/ExistingRobotsTxt/index.ts b/apps/roboshield/src/components/ExistingRobotsTxt/index.ts new file mode 100644 index 000000000..0855e9ff2 --- /dev/null +++ b/apps/roboshield/src/components/ExistingRobotsTxt/index.ts @@ -0,0 +1,3 @@ +import ExistingRobotsTxt from "./ExistingRobotsTxt"; + +export default ExistingRobotsTxt; diff --git a/apps/roboshield/src/components/Finish/Finish.tsx b/apps/roboshield/src/components/Finish/Finish.tsx index d309a9474..a9d04d428 100644 --- a/apps/roboshield/src/components/Finish/Finish.tsx +++ b/apps/roboshield/src/components/Finish/Finish.tsx @@ -79,7 +79,7 @@ export default function Finish({ {}} lastStep={lastStep} - toolTipText={actions?.toolTipText} + showRobotsTxt={actions?.showRobotsTxt} /> {