make colelctions optional in react component
This commit is contained in:
@@ -7,11 +7,11 @@ import type { SiteConfigContact } from '../lib/cms/contact/types'
|
||||
type CategoryNavItem = NonNullable<MenuItemsQuery['categories'][number]>
|
||||
|
||||
export interface FooterProps {
|
||||
contacts: readonly SiteConfigContact[]
|
||||
solutionCategories: CategoryNavItem[]
|
||||
contacts?: readonly SiteConfigContact[]
|
||||
solutionCategories?: CategoryNavItem[]
|
||||
}
|
||||
|
||||
export function Footer({ contacts, solutionCategories }: FooterProps) {
|
||||
export function Footer({ contacts = [], solutionCategories = [] }: FooterProps) {
|
||||
return (
|
||||
<footer className="bg-gray-900 text-gray-400 pt-20 pb-10 border-t border-gray-800">
|
||||
<div className="max-w-400 mx-auto px-6 xl:px-12 2xl:px-16">
|
||||
|
||||
@@ -8,12 +8,12 @@ import { navigateHomeSectionAnchor } from '../lib/scrollToHash'
|
||||
type CategoryNavItem = NonNullable<MenuItemsQuery['categories'][number]>
|
||||
|
||||
export interface HeaderProps {
|
||||
contacts: readonly SiteConfigContact[]
|
||||
solutions: readonly CategoryNavItem[]
|
||||
services: readonly CategoryNavItem[]
|
||||
contacts?: readonly SiteConfigContact[]
|
||||
solutions?: readonly CategoryNavItem[]
|
||||
services?: readonly CategoryNavItem[]
|
||||
}
|
||||
|
||||
export function Header({ contacts, solutions, services }: HeaderProps) {
|
||||
export function Header({ contacts = [], solutions = [], services = [] }: HeaderProps) {
|
||||
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
||||
const [isSolutionsOpen, setIsSolutionsOpen] = useState(false)
|
||||
const [isServicesOpen, setIsServicesOpen] = useState(false)
|
||||
|
||||
Reference in New Issue
Block a user