mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
## Addresses #9371 ### Adds a suite of UI logic for premium features in the Sandbox environment For reviewer: please review the work for the below 3 substasks, which are the only remaining subtasks encompassed by this PR that have not yet passed review individually: - #10822 (9) - #10823 (10) - #10824 (11) ## Checklist for submitter - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
import React, { useContext } from "react";
|
|
import { useErrorHandler } from "react-error-boundary";
|
|
import { AppContext } from "context/app";
|
|
|
|
interface IExcludeInSandboxRoutesProps {
|
|
children: JSX.Element;
|
|
}
|
|
|
|
const ExcludeInSandboxRoutes = ({ children }: IExcludeInSandboxRoutesProps) => {
|
|
const handlePageError = useErrorHandler();
|
|
const { isSandboxMode } = useContext(AppContext);
|
|
|
|
if (isSandboxMode) {
|
|
handlePageError({ status: 403 });
|
|
return null;
|
|
}
|
|
return <>{children}</>;
|
|
};
|
|
|
|
export default ExcludeInSandboxRoutes;
|