Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions components/builder-helper.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
import badgeList from '../public/.meta/badge-list.json'
import badgeListLegacy from '../public/.meta/badges.json'

// const examples = [...badgeList.live, ...badgeList.static].reduce((accu, curr) => {
// return (accu as any).concat(Object.entries(curr.examples))
// }, [] as [string, string][])

type BadgeExamples = {
[pathname: string]: string
}
type BadgeList = {
[id: string]: {
title: string;
examples: BadgeExamples;
examples?: BadgeExamples;
}
}


const examples = extractExampleList(badgeList)

function extractExampleList (badgeList: BadgeList): BadgeExamples {
let examples = {}

Object.entries(badgeList).forEach((x) => {
examples = { ...examples, ...x[1].examples }
})
let examples: BadgeExamples = {}

// Also apply legacy examples
badgeListLegacy.live.forEach((x) => {
examples = { ...examples, ...x.examples }
Object.values(badgeList).forEach((meta) => {
examples = { ...examples, ...(meta.examples || {}) }
})

return examples
Expand Down
74 changes: 0 additions & 74 deletions libs/badge-list.ts

This file was deleted.

2 changes: 0 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

const { withSentryConfig } = require('@sentry/nextjs')

const badgeList = require('./public/.meta/badges.json')

const nextConfig = {
reactStrictMode: true,
optimizeFonts: false,
Expand Down
Loading
Loading