Skip to content

Commit

Permalink
refactor(frontend): remove DebugConsole, conflicting with CheckLoginS…
Browse files Browse the repository at this point in the history
…tate
  • Loading branch information
spwoodcock committed Dec 11, 2024
1 parent 3a9a50f commit f637b8d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 75 deletions.
6 changes: 0 additions & 6 deletions src/frontend/src/utilities/CustomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { revokeCookie } from '@/utilfunctions/login';
import { CommonActions } from '@/store/slices/CommonSlice';
import { LoginActions } from '@/store/slices/LoginSlice';
import { ProjectActions } from '@/store/slices/ProjectSlice';
import DebugConsole from '@/utilities/DebugConsole';
import { useAppSelector } from '@/types/reduxTypes';

type customDrawerType = {
Expand Down Expand Up @@ -74,7 +73,6 @@ export default function CustomDrawer({ open, size, type, onClose, setOpen }: cus
const dispatch = CoreModules.useAppDispatch();

const defaultTheme = useAppSelector((state) => state.theme.hotTheme);
const [showDebugConsole, setShowDebugConsole] = useState(false);
const authDetails = CoreModules.useAppSelector((state) => state.login.authDetails);

const onMouseEnter = (event: React.MouseEvent<HTMLElement>) => {
Expand Down Expand Up @@ -129,7 +127,6 @@ export default function CustomDrawer({ open, size, type, onClose, setOpen }: cus

return (
<div>
<DebugConsole showDebugConsole={showDebugConsole} setShowDebugConsole={setShowDebugConsole} />
<React.Fragment>
<SwipeableDrawer swipeAreaWidth={0} onOpen={onClose} anchor={'right'} open={open} onClose={onClose}>
<CoreModules.Stack sx={{ display: 'flex', flexDirection: 'column', padding: 3 }}>
Expand Down Expand Up @@ -223,9 +220,6 @@ export default function CustomDrawer({ open, size, type, onClose, setOpen }: cus
</NavLink>
),
)}
{import.meta.env.MODE === 'development' && (
<Button onClick={() => setShowDebugConsole(true)} btnText="Open Console" btnType="secondary" />
)}
<div className="fmtm-ml-4 fmtm-mt-2 lg:fmtm-hidden">
{authDetails ? (
<div
Expand Down
51 changes: 0 additions & 51 deletions src/frontend/src/utilities/DebugConsole.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/frontend/src/views/ProjectDetailsV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { useAppSelector } from '@/types/reduxTypes';
import Comments from '@/components/ProjectDetailsV2/Comments';
import { Geolocation } from '@/utilfunctions/Geolocation';
import Instructions from '@/components/ProjectDetailsV2/Instructions';
import DebugConsole from '@/utilities/DebugConsole';
import { CustomCheckbox } from '@/components/common/Checkbox';
import useDocumentTitle from '@/utilfunctions/useDocumentTitle';
import QrcodeComponent from '@/components/QrcodeComponent';
Expand Down Expand Up @@ -252,13 +251,8 @@ const ProjectDetailsV2 = () => {
dispatch(GetEntityInfo(`${import.meta.env.VITE_API_URL}/projects/${projectId}/entities/statuses`));
}, []);

const [showDebugConsole, setShowDebugConsole] = useState(false);

return (
<div className="fmtm-bg-[#f5f5f5] !fmtm-h-[100dvh] sm:!fmtm-h-full">
{/* only used to display debug console */}

<DebugConsole showDebugConsole={showDebugConsole} setShowDebugConsole={setShowDebugConsole} />
{/* Customized Modal For Generate Tiles */}
<div>
<GenerateBasemap projectInfo={state.projectInfo} />
Expand Down Expand Up @@ -409,18 +403,6 @@ const ProjectDetailsV2 = () => {
windowSize.width <= 640 ? '!fmtm-h-[100dvh]' : '!fmtm-h-full'
}`}
>
{import.meta.env.MODE === 'development' && (
<div className="fmtm-block sm:fmtm-hidden fmtm-absolute fmtm-top-6 fmtm-left-16 fmtm-z-50">
<CustomCheckbox
label="Toggle-Console"
checked={showDebugConsole}
onCheckedChange={(status) => {
setShowDebugConsole(status);
}}
className="fmtm-text-black !fmtm-w-full"
/>
</div>
)}
<LayerSwitcherControl visible={customBasemapUrl ? 'custom' : 'osm'} pmTileLayerUrl={customBasemapUrl} />

{taskBoundariesLayer && taskBoundariesLayer?.features?.length > 0 && (
Expand Down

0 comments on commit f637b8d

Please sign in to comment.