44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import type { LoaderArgs } from '@remix-run/node';
|
|
import { json, redirect } from '@remix-run/node';
|
|
|
|
import { getUserId } from '~/session.server';
|
|
|
|
export async function loader({ request }: LoaderArgs) {
|
|
const userId = await getUserId(request);
|
|
if (userId) return redirect('/time-entries');
|
|
return json({});
|
|
}
|
|
|
|
export default function Index() {
|
|
return (
|
|
<div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
|
|
<h1>Welcome to Remix</h1>
|
|
<ul>
|
|
<li>
|
|
<a
|
|
target="_blank"
|
|
href="https://remix.run/tutorials/blog"
|
|
rel="noreferrer"
|
|
>
|
|
15m Quickstart Blog Tutorial
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
target="_blank"
|
|
href="https://remix.run/tutorials/jokes"
|
|
rel="noreferrer"
|
|
>
|
|
Deep Dive Jokes App Tutorial
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
|
|
Remix Docs
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|