-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from HausDAO/deeplinking
more dynamic launch meta and fixes proposal type
- Loading branch information
Showing
6 changed files
with
84 additions
and
51 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
src/app/dao/[chainid]/[daoid]/[proposaltype]/opengraph-image.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { getGraphUrl } from "@/lib/endpoints"; | ||
import { FIND_DAO_LITE } from "@/lib/graph-queries"; | ||
import { DaoItem } from "@/lib/types"; | ||
import { GraphQLClient } from "graphql-request"; | ||
import { ImageResponse } from "next/og"; | ||
|
||
export const alt = "Farcastle Proposals"; | ||
export const size = { | ||
width: 600, | ||
height: 400, | ||
}; | ||
|
||
export const contentType = "image/png"; | ||
|
||
export default async function Image({ | ||
params, | ||
}: { | ||
params: { chainid: string; daoid: string }; | ||
}) { | ||
const { chainid, daoid } = await params; | ||
|
||
const dhUrl = getGraphUrl({ | ||
chainid, | ||
graphKey: process.env.NEXT_PUBLIC_GRAPH_KEY || "", | ||
subgraphKey: "DAOHAUS", | ||
}); | ||
const graphQLClient = new GraphQLClient(dhUrl); | ||
const daores = (await graphQLClient.request(FIND_DAO_LITE, { daoid })) as { | ||
dao: DaoItem; | ||
}; | ||
|
||
const frameText = daores?.dao?.name | ||
? `Make ${daores.dao.name} Proposal` | ||
: `Make Proposal`; | ||
|
||
return new ImageResponse( | ||
( | ||
<div tw="h-full w-full flex flex-col justify-center items-center relative text-[#00B1CC] bg-[#341A34]"> | ||
<h1 tw="text-4xl">{frameText}</h1> | ||
</div> | ||
), | ||
{ | ||
...size, | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters