Remove unused services and refactor SDK structure

Deleted outdated SDKs and services, including DocumentService and markdown-sdk. Consolidated and relocated SDKs into a unified "providers" structure to improve maintainability. Updated imports and adjusted utils naming for consistency.
This commit is contained in:
geoffsee
2025-05-27 14:46:32 -04:00
committed by Geoff Seemueller
parent ceeefeff14
commit fc22278b58
24 changed files with 28 additions and 521 deletions

View File

@@ -1,6 +1,7 @@
import { Flex } from "@chakra-ui/react";
import React from "react";
import { useIsMobile } from "../components/contexts/MobileContext";
function Content({ children }) {
const isMobile = useIsMobile();
return (

View File

@@ -1,19 +0,0 @@
import { useEffect, useState } from "react";
import { useMediaQuery } from "@chakra-ui/react";
// Only use this when it is necessary to style responsively outside a MobileProvider.
export function useIsMobile() {
const [isMobile, setIsMobile] = useState(false);
const [isFallbackMobile] = useMediaQuery("(max-width: 768px)");
useEffect(() => {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
const mobile =
/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
userAgent.toLowerCase(),
);
setIsMobile(mobile);
}, []);
return isMobile || isFallbackMobile;
}

View File

@@ -1,33 +0,0 @@
import { useState, useEffect } from "react";
import { useIsMobile } from "../components/contexts/MobileContext";
export const useMaxWidth = () => {
const isMobile = useIsMobile();
const [maxWidth, setMaxWidth] = useState("600px");
const calculateMaxWidth = () => {
if (isMobile) {
setMaxWidth("800px");
} else if (window.innerWidth < 1024) {
setMaxWidth("500px");
} else {
setMaxWidth("800px");
}
};
useEffect(() => {
calculateMaxWidth();
const handleResize = () => {
calculateMaxWidth();
};
window.addEventListener("resize", handleResize);
return () => {
window.removeEventListener("resize", handleResize);
};
}, [isMobile]);
return maxWidth;
};

View File

@@ -1,26 +0,0 @@
import { useEffect, useState } from "react";
const usePageLoaded = (callback: () => void) => {
const [isLoaded, setIsLoaded] = useState(false);
useEffect(() => {
const handlePageLoad = () => {
setIsLoaded(true);
callback();
};
if (document.readyState === "complete") {
// Page is already fully loaded
handlePageLoad();
} else {
// Wait for the page to load
window.addEventListener("load", handlePageLoad);
}
return () => window.removeEventListener("load", handlePageLoad);
}, [callback]);
return isLoaded;
};
export default usePageLoaded;