Skip to content

Commit

Permalink
feat: poke plans
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh committed Oct 26, 2023
1 parent bf42a4f commit db221c8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
11 changes: 8 additions & 3 deletions front/components/poke/PokeNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ export const PokeNavbar: React.FC = () => (
>
<div className="flex items-center">
<Logo type="colored-grey" className="-mr-5 h-4 w-32 p-0" />
<Link href="/poke">
<div className="text-stucture-300 text-sm italic">Poké</div>
</Link>
<div className="flex flex-row gap-4">
<Link href="/poke">
<div className="text-stucture-300 text-sm italic">Poké</div>
</Link>
<Link href="/poke/plans">
<div className="text-stucture-300 text-sm italic">Plans</div>
</Link>
</div>
</div>
</nav>
);
Expand Down
12 changes: 1 addition & 11 deletions front/pages/api/w/[wId]/subscription/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ async function handler(
}

switch (req.method) {
case "GET":
// Should return the list of featured plans
return apiError(req, res, {
status_code: 404,
api_error: {
type: "invalid_request_error",
message: "Not implemented yet.",
},
});

case "POST":
const newPlan = await subscribeWorkspaceToPlan(auth, {
planCode: req.body.planCode,
Expand All @@ -65,7 +55,7 @@ async function handler(
status_code: 405,
api_error: {
type: "method_not_supported_error",
message: "The method passed is not supported, GET is expected.",
message: "The method passed is not supported, POST is expected.",
},
});
}
Expand Down
28 changes: 28 additions & 0 deletions front/pages/poke/plans.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { GetServerSideProps, InferGetServerSidePropsType } from "next";
import { useRouter } from "next/router";
import React from "react";

import PokeNavbar from "@app/components/poke/PokeNavbar";

export const getServerSideProps: GetServerSideProps<{
hello: string;
}> = async (context) => {
return {
props: {
hello: "world",
},
};
};

const PlansPage = ({
hello,
}: InferGetServerSidePropsType<typeof getServerSideProps>) => {
const router = useRouter();
return (
<div className="min-h-screen bg-structure-50">
<PokeNavbar />
</div>
);
};

export default PlansPage;

0 comments on commit db221c8

Please sign in to comment.