feat: prepare supporter self-hosting

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-22 09:36:53 +02:00
parent f958230a66
commit 9790ba8937
19 changed files with 2647 additions and 115 deletions

View File

@@ -12,21 +12,12 @@ import { ThemeProvider } from './theme-provider';
export function Providers({ children }: { children: React.ReactNode }) {
const storeRef = useRef<AppStore>(undefined);
if (!storeRef.current) {
// Create the store instance the first time this renders
storeRef.current = makeStore();
}
return (
<NuqsAdapter>
<ThemeProvider>
{/* {import.meta.env.VITE_OP_CLIENT_ID && (
<OpenPanelComponent
clientId={import.meta.env.VITE_OP_CLIENT_ID}
trackScreenViews
trackOutgoingLinks
trackAttributes
/>
)} */}
<ReduxProvider store={storeRef.current}>
<TooltipProvider delayDuration={200}>
{children}

View File

@@ -1,13 +1,9 @@
import { useAppContext } from '@/hooks/use-app-context';
import { useTRPC } from '@/integrations/trpc/react';
import { cn } from '@/utils/cn';
import type { IServiceOrganization } from '@openpanel/db';
import { useQuery } from '@tanstack/react-query';
import {
Link,
useLocation,
useParams,
useRouteContext,
} from '@tanstack/react-router';
import { Link, useLocation, useParams } from '@tanstack/react-router';
import { MenuIcon, XIcon } from 'lucide-react';
import { useEffect, useState } from 'react';
import { FeedbackButton } from './feedback-button';
@@ -81,6 +77,7 @@ export function SidebarContainer({
}: SidebarContainerProps) {
const [active, setActive] = useState(false);
const location = useLocation();
const { isSelfHosted } = useAppContext();
useEffect(() => {
setActive(false);
@@ -135,7 +132,7 @@ export function SidebarContainer({
<div className="mt-auto w-full ">
<FeedbackButton />
{import.meta.env.VITE_SELF_HOSTED === 'true' && (
{isSelfHosted && (
<div className={cn('text-sm w-full text-center')}>
Self-hosted instance
</div>