Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
import React, {FC, PropsWithChildren, useEffect} from "react";
import {MantineProvider, v8CssVariablesResolver} from "@mantine/core";
import {Notifications} from "@mantine/notifications";
import {i18n} from "@lingui/core";
import {I18nProvider} from "@lingui/react";
import {ModalsProvider} from "@mantine/modals";
import {DatesProvider} from "@mantine/dates";
import {toDayjsLocale} from "./locales.ts";
import {DehydratedState, HydrationBoundary, QueryClient, QueryClientProvider} from "@tanstack/react-query";
import {Helmet, HelmetProvider} from "react-helmet-async";
import type {ThemeColors} from "./utilites/themeColors.ts";
import "@mantine/core/styles/global.css";
import "@mantine/core/styles.css";
import "@mantine/notifications/styles.css";
import "@mantine/tiptap/styles.css";
import "@mantine/dropzone/styles.css";
import '@mantine/dates/styles.css';
import "@mantine/charts/styles.css";
import "./styles/global.scss";
import {isSsr} from "./utilites/helpers.ts";
import {StartupChecks} from "./StartupChecks.tsx";
import {ThirdPartyScripts} from "./components/common/ThirdPartyScripts";
import {getConfig} from "./utilites/config.ts";
import {CookieConsentBanner} from "./components/common/CookieConsentBanner";
import {isConsentBannerEnabled} from "./utilites/cookieConsent";
export const App: FC<
PropsWithChildren<{
queryClient: QueryClient;
locale: string;
themeColors: ThemeColors;
helmetContext?: any;
dehydratedState?: DehydratedState;
ssrStyled?: boolean;
}>
> = (props) => {
const [isLoadedOnBrowser, setIsLoadedOnBrowser] = React.useState(false);
useEffect(() => {
setIsLoadedOnBrowser(!isSsr());
}, []);
return (
<React.StrictMode>
{!props.ssrStyled && <div
className="ssr-loader"
style={{
top: 0,
left: 0,
right: 0,
bottom: 0,
margin: 0,
padding: 0,
width: "100vw",
height: "100vh",
position: "fixed",
background: "#ffffff",
zIndex: 1000,
display: isLoadedOnBrowser ? "none" : "block",
}}
/>}
<MantineProvider
cssVariablesResolver={v8CssVariablesResolver}
theme={{
colors: props.themeColors,
primaryColor: "primary",
fontFamily: "Outfit, sans-serif",
primaryShade: 8,
defaultRadius: "sm",
}}
>
<HelmetProvider context={props.helmetContext}>
<I18nProvider i18n={i18n}>
<DatesProvider settings={{locale: toDayjsLocale(props.locale)}}>
<QueryClientProvider client={props.queryClient}>
<HydrationBoundary state={props.dehydratedState}>
<StartupChecks/>
<ThirdPartyScripts/>
<ModalsProvider>
<Helmet>
<title>{getConfig("VITE_APP_NAME", "Hi.Events")}</title>
<link rel="icon"
type="image/svg+xml"
href={getConfig("VITE_APP_FAVICON", "/favicon.svg")}
/>
</Helmet>
{props.children}
</ModalsProvider>
<Notifications pauseResetOnHover="notification" zIndex={20000}/>
{isConsentBannerEnabled() && <CookieConsentBanner/>}
</HydrationBoundary>
</QueryClientProvider>
</DatesProvider>
</I18nProvider>
</HelmetProvider>
</MantineProvider>
</React.StrictMode>
);
};