-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
649 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { LoaderFunction } from "@remix-run/cloudflare"; | ||
import { Form, Link, Outlet } from "@remix-run/react"; | ||
import { Typography } from "@supabase/ui"; | ||
import { Users } from "react-feather"; | ||
import { getSession } from "~/auth.server"; | ||
import Logout from "./__auth/logout"; | ||
|
||
export const loader: LoaderFunction = async ({ request, context }) => { | ||
await getSession(context, request); | ||
return {}; | ||
}; | ||
|
||
const Sidebar = () => { | ||
return ( | ||
<div className="flex flex-col w-64 h-screen px-4 py-8 overflow-y-auto border-r" aria-label="Sidebar"> | ||
<div className="overflow-y-auto py-4 px-3rounded"> | ||
<h2 className="text-xl font-semibold text-center text-red-500"> | ||
<Link to="/app"> | ||
reconfigured | ||
</Link> | ||
</h2> | ||
<div className="flex flex-col justify-between mt-6"> | ||
<aside> | ||
<ul> | ||
<li> | ||
<Link className="flex items-center px-4 py-2 rounded-md" to="/app/userprofile"> | ||
<Typography.Link>User Profile</Typography.Link> | ||
</Link> | ||
</li> | ||
<li> | ||
<Link className="flex items-center px-4 py-2 rounded-md" to="/app/teams"> | ||
<Typography.Link>Teams</Typography.Link> | ||
</Link> | ||
</li> | ||
<li> | ||
<Form action="/logout" method="post"> | ||
<button> | ||
<Typography.Link className="flex items-center px-4 py-2 rounded-md">Logout</Typography.Link> | ||
</button> | ||
</Form> | ||
</li> | ||
</ul> | ||
</aside> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default function App() { | ||
return ( | ||
<> | ||
<div className="flex"> | ||
<Sidebar /> | ||
<div className="w-full h-full p-4 m-8 overflow-y-auto"> | ||
{/* <div className="flex p-40 border-4 border-dotted"> */} | ||
<Outlet /> | ||
{/* </div> */} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { LoaderFunction } from "@remix-run/cloudflare"; | ||
import Title from "@supabase/ui/dist/cjs/components/Typography/Title"; | ||
import { getSession } from "~/auth.server"; | ||
|
||
export const loader: LoaderFunction = async ({ request, context }) => { | ||
await getSession(context, request) | ||
return {} | ||
} | ||
|
||
export default function App() { | ||
return ( | ||
<> | ||
<Title>This is app</Title> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { ActionFunction, LoaderFunction } from "@remix-run/cloudflare"; | ||
import { Form, useTransition } from "@remix-run/react"; | ||
import { Button, Input } from "@supabase/ui"; | ||
import Title from "@supabase/ui/dist/cjs/components/Typography/Title"; | ||
import { getSession, getSupabase } from "~/auth.server"; | ||
|
||
export const loader: LoaderFunction = async ({ request, context }) => { | ||
await getSession(context, request); | ||
return {}; | ||
}; | ||
|
||
export const action: ActionFunction = async ({ request, context }) => { | ||
const session = await getSession(context, request); | ||
const supabase = await getSupabase(context, session); | ||
const formData = await request.formData(); | ||
const { error } = await supabase | ||
.rpc('create_group', { | ||
group_name: (formData.get('name') as string) | ||
}) | ||
if (error) throw error; | ||
return {}; | ||
} | ||
|
||
export default function Teams() { | ||
const { state } = useTransition() | ||
return ( | ||
<> | ||
<Title>Teams</Title> | ||
<Form method="post"> | ||
<div className="sbui--col sbui-space-y-3"> | ||
<Input name="name" label="Create New Team" placeholder="Team name" /> | ||
<Button htmlType="submit" disabled={state === "submitting"}> | ||
{state === "submitting" ? "Creating..." : "Create team"} | ||
</Button> | ||
</div> | ||
|
||
</Form> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.