-
Notifications
You must be signed in to change notification settings - Fork 4
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 #2367 from zeitgeistpm/tr-preview-card-twitter
OG image adjustments
- Loading branch information
Showing
3 changed files
with
81 additions
and
39 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,19 +1,23 @@ | ||
import { range } from "lodash-es"; | ||
import { union } from "lib/types/union"; | ||
import { prodTags } from "./markets"; | ||
|
||
const tags = [...prodTags, "untagged"] as const; | ||
|
||
const generateImagePaths = (basePath: string, imageCount: number) => { | ||
return Array(imageCount) | ||
.fill(0) | ||
.map((_, index) => `${basePath}/${index + 1}.png`); | ||
}; | ||
export const CATEGORY_IMAGES = union<(typeof tags)[number]>().exhaustAsRecord({ | ||
Sports: range(1, 6).map((i) => `/categories/sports/${i}.png`), | ||
Politics: range(1, 5).map((i) => `/categories/politics/${i}.png`), | ||
Technology: range(1, 5).map((i) => `/categories/tech/${i}.png`), | ||
Crypto: range(1, 5).map((i) => `/categories/crypto/${i}.png`), | ||
Science: range(1, 5).map((i) => `/categories/science/${i}.png`), | ||
News: range(1, 6).map((i) => `/categories/news/${i}.png`), | ||
Dotsama: range(1, 2).map((i) => `/categories/dotsama/${i}.png`), | ||
Zeitgeist: range(1, 2).map((i) => `/categories/zeitgeist/${i}.png`), | ||
Finance: range(1, 5).map((i) => `/categories/finance/${i}.png`), | ||
Entertainment: range(1, 5).map((i) => `/categories/entertainment/${i}.png`), | ||
untagged: range(1, 2).map((i) => `/categories/zeitgeist/${i}.png`), | ||
Sports: generateImagePaths("/categories/sports", 5), | ||
Politics: generateImagePaths("/categories/politics", 4), | ||
Technology: generateImagePaths("/categories/tech", 4), | ||
Crypto: generateImagePaths("/categories/crypto", 4), | ||
Science: generateImagePaths("/categories/science", 4), | ||
News: generateImagePaths("/categories/news", 5), | ||
Dotsama: generateImagePaths("/categories/dotsama", 1), | ||
Zeitgeist: generateImagePaths("/categories/zeitgeist", 1), | ||
Finance: generateImagePaths("/categories/finance", 4), | ||
Entertainment: generateImagePaths("/categories/entertainment", 4), | ||
untagged: generateImagePaths("/categories/zeitgeist", 1), | ||
}); |
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