saleor-apps-redis_apl/apps/invoice-hub/src/pages/index.tsx

28 lines
754 B
TypeScript
Raw Normal View History

2023-01-20 16:08:35 +00:00
import { NextPage } from "next";
import { useAppBridge } from "@saleor/app-sdk/app-bridge";
import { useEffect } from "react";
import { useIsMounted } from "usehooks-ts";
import { useRouter } from "next/router";
const IndexPage: NextPage = () => {
const { appBridgeState } = useAppBridge();
const isMounted = useIsMounted();
const { replace } = useRouter();
useEffect(() => {
if (isMounted() && appBridgeState?.ready) {
replace("/configuration");
}
}, [isMounted, appBridgeState?.ready]);
return (
<div>
<h1>Saleor Invoices</h1>
<p>This is Saleor App that allows invoices generation</p>
<p>Install app in your Saleor instance and open in with Dashboard</p>
</div>
);
};
export default IndexPage;