2024-03-05 16:56:17 +00:00
|
|
|
import {
|
2024-03-13 13:38:01 +00:00
|
|
|
Links,
|
|
|
|
Meta,
|
|
|
|
Outlet,
|
|
|
|
Scripts,
|
|
|
|
ScrollRestoration,
|
2024-03-05 16:56:17 +00:00
|
|
|
} from "@remix-run/react";
|
|
|
|
|
|
|
|
import stylesheet from "./tailwind.css?url";
|
2024-03-13 17:01:23 +00:00
|
|
|
import type { LinksFunction } from "@remix-run/node";
|
2024-03-05 16:56:17 +00:00
|
|
|
|
|
|
|
// Supports weights 200-800
|
|
|
|
import '@fontsource-variable/manrope';
|
2024-03-13 13:38:01 +00:00
|
|
|
import {Refine} from "@refinedev/core";
|
|
|
|
import routerProvider from "@refinedev/remix-router";
|
2024-03-19 01:41:21 +00:00
|
|
|
import { defaultProvider } from "~/data/file-provider";
|
|
|
|
import {PortalAuthProvider} from "~/data/auth-provider";
|
|
|
|
import { notificationProvider } from "~/data/notification-provider";
|
|
|
|
import {SdkContextProvider} from "~/components/lib/sdk-context";
|
|
|
|
import { Toaster } from "~/components/ui/toaster";
|
|
|
|
|
2024-03-05 16:56:17 +00:00
|
|
|
|
|
|
|
export const links: LinksFunction = () => [
|
|
|
|
{ rel: "stylesheet", href: stylesheet },
|
|
|
|
];
|
|
|
|
|
2024-03-13 13:38:01 +00:00
|
|
|
export function Layout({children}: { children: React.ReactNode }) {
|
|
|
|
return (
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charSet="utf-8"/>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
|
|
<Meta/>
|
|
|
|
<Links/>
|
|
|
|
</head>
|
|
|
|
<body>
|
2024-03-05 16:56:17 +00:00
|
|
|
{children}
|
2024-03-19 01:41:21 +00:00
|
|
|
<Toaster />
|
2024-03-13 13:38:01 +00:00
|
|
|
<ScrollRestoration/>
|
|
|
|
<Scripts/>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
);
|
2024-03-05 16:56:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function App() {
|
2024-03-18 14:09:37 +00:00
|
|
|
const auth = PortalAuthProvider.create("https://alpha.pinner.xyz")
|
2024-03-13 13:38:01 +00:00
|
|
|
return (
|
|
|
|
<Refine
|
2024-03-18 14:09:37 +00:00
|
|
|
authProvider={auth}
|
2024-03-13 13:38:01 +00:00
|
|
|
routerProvider={routerProvider}
|
2024-03-15 19:59:02 +00:00
|
|
|
dataProvider={defaultProvider}
|
2024-03-19 01:41:21 +00:00
|
|
|
notificationProvider={notificationProvider}
|
2024-03-15 19:59:02 +00:00
|
|
|
resources={[
|
|
|
|
{ name: 'files' },
|
|
|
|
{ name: 'users' }
|
|
|
|
]}
|
2024-03-13 13:38:01 +00:00
|
|
|
>
|
2024-03-18 14:09:37 +00:00
|
|
|
<SdkContextProvider sdk={(auth as PortalAuthProvider).sdk}>
|
|
|
|
<Outlet/>
|
|
|
|
</SdkContextProvider>
|
2024-03-13 13:38:01 +00:00
|
|
|
</Refine>
|
|
|
|
);
|
2024-03-05 16:56:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function HydrateFallback() {
|
2024-03-13 13:38:01 +00:00
|
|
|
return <p>Loading...</p>;
|
2024-03-05 16:56:17 +00:00
|
|
|
}
|