Skip to content

Commit

Permalink
@/Roboshield Robots Generator form
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Jul 9, 2024
1 parent a58fa18 commit a65f094
Show file tree
Hide file tree
Showing 18 changed files with 257 additions and 298 deletions.
2 changes: 1 addition & 1 deletion apps/roboshield/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export interface Page {
};
id?: string | null;
blockName?: string | null;
blockType: "robo-form";
blockType: "robots-generator";
}
)[]
| null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 RoboForm from "@/roboshield/components/RoboForm";
import RobotsGenerator from "@/roboshield/components/RobotsGenerator";
import { FC } from "react";

interface BlockRendererProps extends Pick<Page, "blocks"> {}
Expand All @@ -13,7 +13,7 @@ const components = {
"page-hero": Hero,
content: Content,
statistics: Statistics,
"robo-form": RoboForm,
"robots-generator": RobotsGenerator,
};

export default function BlockRenderer({ blocks }: BlockRendererProps) {
Expand Down
7 changes: 3 additions & 4 deletions apps/roboshield/src/components/CommonBots/CommonBots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export default function CommonBots({
handleSkipToLast,
hint,
lastStep,
globalLabels,
toolTipText,
actions,
}: StepComponent) {
const { state } = useGlobalState();

Expand Down Expand Up @@ -88,7 +87,7 @@ export default function CommonBots({
<SkipToLastStep
handleSkipToLast={skipToLast}
lastStep={lastStep}
toolTipText={toolTipText}
toolTipText={actions?.toolTipText}
/>
<StepHint hint={hint} />
<Box sx={{ py: 2 }}>
Expand Down Expand Up @@ -223,7 +222,7 @@ export default function CommonBots({
isValid={true}
lastStep={lastStep}
back={false}
labels={globalLabels}
labels={actions}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ export default function CommonSettings({
handleSkipToLast,
hint,
lastStep,
globalLabels,
actions,
selectPlatform,
allowedPaths: allowedPathsLabel,
disallowedPaths: disallowedPathsLabel,
toolTipText,
}: Props) {
const { state } = useGlobalState();

Expand Down Expand Up @@ -97,7 +96,7 @@ export default function CommonSettings({
<SkipToLastStep
handleSkipToLast={skipToLast}
lastStep={lastStep}
toolTipText={toolTipText}
toolTipText={actions?.toolTipText}
/>
<StepHint hint={hint} />
<Box
Expand Down Expand Up @@ -221,7 +220,7 @@ export default function CommonSettings({
isValid={true}
lastStep={lastStep}
back={false}
labels={globalLabels}
labels={actions}
/>
</>
);
Expand Down
7 changes: 3 additions & 4 deletions apps/roboshield/src/components/Delays/Delays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ export default function Delays({
handleSkipToLast,
hint,
lastStep,
globalLabels,
actions,
cacheDelay: cachedDelayLabel,
crawlDelay: crawlDelayLabel,
visitTime: visitTimeLabel,
toolTipText,
}: Props) {
const { state } = useGlobalState();

Expand Down Expand Up @@ -85,7 +84,7 @@ export default function Delays({
<SkipToLastStep
handleSkipToLast={skipToLast}
lastStep={lastStep}
toolTipText={toolTipText}
toolTipText={actions?.toolTipText}
/>
<StepHint hint={hint} />
<Box
Expand Down Expand Up @@ -191,7 +190,7 @@ export default function Delays({
isValid={true}
lastStep={lastStep}
back={false}
labels={globalLabels}
labels={actions}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface Props extends StepComponent {
export default function ExistingRobots({
existingRobotsTxt,
fetch: fetchLabel,
globalLabels,
actions,
handleNext,
handleBack,
handleSkipToLast,
Expand All @@ -32,7 +32,6 @@ export default function ExistingRobots({
placeholder,
urlValidationError,
defaultFetchExistingRobots,
toolTipText,
}: Props) {
const { state } = useGlobalState();
const [url, setUrl] = useState(state.url);
Expand Down Expand Up @@ -102,7 +101,7 @@ export default function ExistingRobots({
<SkipToLastStep
handleSkipToLast={skipToLast}
lastStep={lastStep}
toolTipText={toolTipText}
toolTipText={actions?.toolTipText}
/>
<StepHint hint={hint} />
<Box sx={{ py: 2 }}>
Expand Down Expand Up @@ -170,7 +169,7 @@ export default function ExistingRobots({
isValid={allowNextStep || !shouldFetch}
lastStep={lastStep}
back={true}
labels={globalLabels}
labels={actions}
/>
<Snackbar
open={robotsError}
Expand Down
9 changes: 4 additions & 5 deletions apps/roboshield/src/components/Finish/Finish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default function Finish({
handleBack,
hint,
lastStep,
globalLabels,
toolTipText,
actions,
}: Props) {
const { state } = useGlobalState();
const [code, setCode] = useState(state.robots || "");
Expand Down Expand Up @@ -80,7 +79,7 @@ export default function Finish({
<SkipToLastStep
handleSkipToLast={() => {}}
lastStep={lastStep}
toolTipText={toolTipText}
toolTipText={actions?.toolTipText}
/>
<StepHint hint={hint} />
<Box
Expand All @@ -98,7 +97,7 @@ export default function Finish({
onBack={handleBack}
showButtons={true}
onCodeChange={handleCodeChange}
labels={globalLabels}
labels={actions}
/>
</Box>
<StepperNav
Expand All @@ -107,7 +106,7 @@ export default function Finish({
isValid={true}
lastStep={true}
back={false}
labels={globalLabels}
labels={actions}
/>
<Snackbar
open={showSnackbar}
Expand Down
200 changes: 0 additions & 200 deletions apps/roboshield/src/components/RoboForm/RoboForm.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/roboshield/src/components/RoboForm/index.ts

This file was deleted.

Loading

0 comments on commit a65f094

Please sign in to comment.