Add SEO controls and sitemap for compliance pages
Add search engine indexing toggle, robots.txt, and sitemap.xml generation for compliance pages. Replace checkboxes with toggle components in the compliance page UI and add an "Open" button in the page header to quickly access the live compliance page. The search engine indexing toggle is disabled when the compliance page is inactive. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
47
packages/ui/src/Atoms/Toggle/Toggle.tsx
Normal file
47
packages/ui/src/Atoms/Toggle/Toggle.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
type Props = {
|
||||
checked: boolean;
|
||||
onChange: (checked: boolean) => void;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
export function Toggle({ checked, onChange, disabled = false }: Props) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={checked}
|
||||
disabled={disabled}
|
||||
onClick={() => !disabled && onChange(!checked)}
|
||||
style={{
|
||||
position: "relative",
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
flexShrink: 0,
|
||||
width: 44,
|
||||
height: 24,
|
||||
padding: 2,
|
||||
borderRadius: 9999,
|
||||
border: "none",
|
||||
cursor: disabled ? "not-allowed" : "pointer",
|
||||
opacity: disabled ? 0.5 : 1,
|
||||
backgroundColor: checked
|
||||
? "var(--color-accent)"
|
||||
: "var(--color-border-mid)",
|
||||
transition: "background-color 200ms ease-in-out",
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
display: "block",
|
||||
width: 20,
|
||||
height: 20,
|
||||
borderRadius: 9999,
|
||||
backgroundColor: "white",
|
||||
boxShadow: "0 1px 2px rgba(0,0,0,0.1)",
|
||||
transition: "transform 200ms ease-in-out",
|
||||
transform: checked ? "translateX(20px)" : "translateX(0)",
|
||||
}}
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -38,6 +38,7 @@ export { InfiniteScrollTrigger } from "./Atoms/InfiniteScrollTrigger/InfiniteScr
|
||||
export { PriorityLevel } from "./Atoms/PriorityLevel/PriorityLevel";
|
||||
export { TaskStateIcon } from "./Atoms/Icons/TaskStateIcon";
|
||||
export { Checkbox } from "./Atoms/Checkbox/Checkbox";
|
||||
export { Toggle } from "./Atoms/Toggle/Toggle";
|
||||
export {
|
||||
Cell,
|
||||
CellHead,
|
||||
|
||||
Reference in New Issue
Block a user