Skip to content

Commit

Permalink
tryin it out
Browse files Browse the repository at this point in the history
  • Loading branch information
jarbacoa committed Apr 20, 2022
1 parent f15b5a8 commit 16eaca6
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions src/pages/turbo/safe/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@ import TurboSafePage from "components/pages/Turbo/TurboSafePage/TurboSafePage";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { useRouter } from "next/router";
import Head from "next/head";
import { chooseBestWeb3Provider } from "utils/web3Providers";
import { createTurboSafe } from "lib/turbo/utils/turboContracts";
import { getSafeInfo } from "lib/turbo/fetchers/safes/getSafeInfo";
import { fetchTokenData } from "hooks/useTokenData";

export async function getStaticProps({
locale,
params,
}: {
locale: string;
params: any;
}) {
const { id } = params;
const provider = chooseBestWeb3Provider();
const turboSafe = createTurboSafe(provider, id);
const collateral = await turboSafe.callStatic.asset();
const { symbol } = await fetchTokenData(collateral);

export async function getStaticProps({ locale }: { locale: string }) {
return {
props: {
...(await serverSideTranslations(locale)),
safeId: id,
symbol,
},
};
}
Expand All @@ -19,25 +37,31 @@ export const getStaticPaths = async () => {
};
};

const Page: NextPage = () => {
const {
query: { id },
} = useRouter();
const Page: NextPage<{
safeId: string;
symbol: string;
}> = ({ safeId, symbol }) => {
return (
<>
<Head>
<title> Safe | Tribe Turbo</title>
<meta property="twitter:card" content="summary" />
<meta property="og:title" content={`Safe| Tribe Turbo`} />
<meta name="twitter:title" content={`Safe | Tribe Turbo`} />
<meta property="og:title" content={`${symbol} Safe | Tribe Turbo`} />
<meta name="twitter:title" content={`${symbol} Safe | Tribe Turbo`} />
<meta
property="og:url"
content={`https://app.rari.capital/turbo/safe/${id}`}
content={`https://app.rari.capital/turbo/safe/${safeId}`}
/>
<meta property="og:image" content="/static/turbo/turbo2.png" />
<meta property="twitter:image" content="/static/turbo/turbo2.png" />
<meta property="og:description" content="Earn costless yield and boost FEI liquidity with Tribe Turbo." />
<meta property="twitter:description" content="Earn costless yield and boost liquidity with Tribe Turbo." />
<meta
property="og:description"
content="Earn costless yield and boost FEI liquidity with Tribe Turbo."
/>
<meta
property="twitter:description"
content="Earn costless yield and boost liquidity with Tribe Turbo."
/>
</Head>
<TurboSafePage />
</>
Expand Down

1 comment on commit 16eaca6

@vercel
Copy link

@vercel vercel bot commented on 16eaca6 Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.