MCPcopy Create free account
hub / github.com/dailydotdev/apps / getSquadOpenGraph

Function getSquadOpenGraph

packages/webapp/next-seo.ts:91–112  ·  view source on GitHub ↗
({
  squad,
}: {
  squad?: Pick<Source, 'id' | 'image' | 'public'>;
})

Source from the content-addressed store, hash-verified

89};
90
91export const getSquadOpenGraph = ({
92 squad,
93}: {
94 squad?: Pick<Source, 'id' | 'image' | 'public'>;
95}): Partial<OpenGraph> => {
96 // The share card is screenshotted from an anonymous render, which can only
97 // read public squads — private ones keep the plain image behavior.
98 if (squad?.id && squad.public) {
99 return {
100 images: [
101 { url: getShareImageUrl('squads', squad.id), width: 1200, height: 630 },
102 ],
103 };
104 }
105
106 return {
107 images:
108 squad?.image && squad.image !== cloudinarySquadsImageFallback
109 ? [{ url: squad.image }]
110 : defaultOpenGraph.images,
111 };
112};
113
114// Canonical marketing tagline. Static surfaces that can't import this TS
115// constant keep their own copy — the extension locale JSON

Callers 2

getStaticPropsFunction · 0.90
getServerSidePropsFunction · 0.90

Calls 1

getShareImageUrlFunction · 0.85

Tested by

no test coverage detected