Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use Remix #65

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Update _index.tsx
eurunuela committed Oct 2, 2023
commit df0aeb8de6c6d2ff2e7ef621ac33722381e69654
25 changes: 10 additions & 15 deletions app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -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%]">
@@ -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.
}