Skip to content

Commit

Permalink
provide icons for all category
Browse files Browse the repository at this point in the history
  • Loading branch information
michalstruck committed Feb 26, 2025
1 parent b078fa3 commit 46d9346
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/api/v2/public/apps/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { errorResponse } from "@/api/helpers/errors";
import { getAPIServiceGraphqlClient } from "@/api/helpers/graphql";
import { validateRequestSchema } from "@/api/helpers/validate-request-schema";
import { getAllLocalisedCategoriesWithUrls } from "@/lib/categories";
import {
AllCategory,
getAllLocalisedCategoriesWithUrls,
} from "@/lib/categories";
import { NativeApps } from "@/lib/constants";
import { parseLocale } from "@/lib/languages";
import { AppStatsReturnType } from "@/lib/types";
Expand Down Expand Up @@ -214,6 +217,7 @@ export const GET = async (request: NextRequest) => {
top_apps: rankApps(formattedTopApps, metricsData),
highlights: highlightedApps,
},
all_category: AllCategory,
categories: getAllLocalisedCategoriesWithUrls(locale), // TODO: Localise
},
{
Expand Down
6 changes: 6 additions & 0 deletions web/lib/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ export const Categories = [
},
] as const;

export const AllCategory = {
name: "All",
id: "all",
icon_url: `${process.env.NEXT_PUBLIC_IMAGES_CDN_URL}/category-icons/all.png`,
} as const;

export type Category = (typeof Categories)[number];

export const CategoryNameIterable: Category["name"][] = Categories.map(
Expand Down

0 comments on commit 46d9346

Please sign in to comment.