Skip to content

Commit

Permalink
Update _index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
eurunuela committed Oct 2, 2023
1 parent 53539d8 commit df0aeb8
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ export const meta: V2_MetaFunction = () => {
];
};

// export async function loader() {
// return [
// {
// info: "This is an example of a tabbed interface.",
// path: "/User/rica/data/tedana/results",
// },
// ];
// }
// Set default values and save into cookies
export const loader = async ({ request }: ActionArgs) => {
const session = await getSession(request.headers.get("Cookie"));
session.set("info", "This is an example of a tabbed interface.");
session.set("path", "/User/rica/data/tedana/results");
// etc.
return { message: "Hello, World!" };
};

export default function Index() {
let data = useLoaderData();

console.log("data", data);

return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<div className="flex flex-col h-[100%]">
Expand All @@ -32,10 +34,3 @@ export default function Index() {
</div>
);
}

export async function action({ request }: ActionArgs) {
const session = await getSession(request.headers.get("Cookie"));
session.set("info", "This is an example of a tabbed interface.");
session.set("path", "/User/rica/data/tedana/results");
// etc.
}

0 comments on commit df0aeb8

Please # to comment.