Skip to content

Commit

Permalink
fix: props page
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-mesnil committed Oct 17, 2023
1 parent 1102c3b commit 8e50b89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions website/app/components/[id]/[subPage]/props.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { kebabCase } from 'lodash'

import { PageProps } from './page'

import { Properties } from '@/build-app/components/Props'
import { TableOfContent } from '@/build-app/components/TableOfContent'
import { getComponentProperties } from '@/build-app/utils/components-properties'
import { getPropertiesTree } from '@/build-app/utils/page-tree'
import { getPages, getStaticParams } from '@/build-app/utils/pages-components'
import { getName } from '@/build-app/utils/transform-name'

export async function generateStaticParams() {
const pages = getPages()
Expand All @@ -16,7 +15,7 @@ export async function generateStaticParams() {

const Page = ({ params }: PageProps) => {
const { id } = params
const properties = getComponentProperties(kebabCase(id))
const properties = getComponentProperties(getName(id))

if (!properties) return null

Expand Down
5 changes: 2 additions & 3 deletions website/build-app/utils/transform-name.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import lowerCase from 'lodash/lowerCase'
import upperFirst from 'lodash/upperFirst'
import { camelCase, upperFirst } from 'lodash'

export function getName(name: string) {
return upperFirst(lowerCase(name))
return upperFirst(camelCase(name))
}

0 comments on commit 8e50b89

Please sign in to comment.