Skip to content

Commit

Permalink
chore(templates): improve types for rowLabel custom components
Browse files Browse the repository at this point in the history
  • Loading branch information
akhrarovsaid committed Jan 23, 2025
1 parent 5689c65 commit d1003af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions templates/website/src/Footer/RowLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client'
import { Header } from '@/payload-types'
import { RowLabelProps, useRowLabel } from '@payloadcms/ui'
import { useRowLabel } from '@payloadcms/ui'
import type { ArrayFieldClientProps } from 'payload'

export const RowLabel: React.FC<RowLabelProps> = () => {
export const RowLabel: React.FC<ArrayFieldClientProps> = () => {
const data = useRowLabel<NonNullable<Header['navItems']>[number]>()

const label = data?.data?.link?.label
Expand Down
5 changes: 3 additions & 2 deletions templates/website/src/Header/RowLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client'
import { Header } from '@/payload-types'
import { RowLabelProps, useRowLabel } from '@payloadcms/ui'
import { useRowLabel } from '@payloadcms/ui'
import type { ArrayFieldClientProps } from 'payload'

export const RowLabel: React.FC<RowLabelProps> = () => {
export const RowLabel: React.FC<ArrayFieldClientProps> = () => {
const data = useRowLabel<NonNullable<Header['navItems']>[number]>()

const label = data?.data?.link?.label
Expand Down
5 changes: 3 additions & 2 deletions templates/with-vercel-website/src/Footer/RowLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client'
import { Header } from '@/payload-types'
import { RowLabelProps, useRowLabel } from '@payloadcms/ui'
import { useRowLabel } from '@payloadcms/ui'
import type { ArrayFieldClientProps } from 'payload'

export const RowLabel: React.FC<RowLabelProps> = (props) => {
export const RowLabel: React.FC<ArrayFieldClientProps> = () => {
const data = useRowLabel<NonNullable<Header['navItems']>[number]>()

const label = data?.data?.link?.label
Expand Down
5 changes: 3 additions & 2 deletions templates/with-vercel-website/src/Header/RowLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client'
import { Header } from '@/payload-types'
import { RowLabelProps, useRowLabel } from '@payloadcms/ui'
import { useRowLabel } from '@payloadcms/ui'
import type { ArrayFieldClientProps } from 'payload'

export const RowLabel: React.FC<RowLabelProps> = (props) => {
export const RowLabel: React.FC<ArrayFieldClientProps> = () => {
const data = useRowLabel<NonNullable<Header['navItems']>[number]>()

const label = data?.data?.link?.label
Expand Down

0 comments on commit d1003af

Please sign in to comment.