@ -16,45 +16,47 @@ export default function ServicesGroup({ group, services, layout, fiveColumns, di
className = { classNames (
layout ? . style === "row" ? "basis-full" : "basis-full md:basis-1/2 lg:basis-1/3 xl:basis-1/4" ,
layout ? . style !== "row" && fiveColumns ? "3xl:basis-1/5" : "" ,
"flex-1 p-1"
layout ? . header === false ? "flex-1 px-1 -my-1" : "flex-1 p-1" ,
) }
>
< Disclosure defaultOpen >
{ ( { open } ) => (
< >
< Disclosure.Button disabled = { disableCollapse } className = "flex w-full select-none items-center group" >
{ layout ? . icon &&
< div className = "flex-shrink-0 mr-2 w-7 h-7" >
< ResolvedIcon icon = { layout . icon } / >
< / div >
< Disclosure defaultOpen >
{ ( { open } ) => (
< >
{ layout ? . header !== false &&
< Disclosure.Button disabled = { disableCollapse } className = "flex w-full select-none items-center group" >
{ layout ? . icon &&
< div className = "flex-shrink-0 mr-2 w-7 h-7" >
< ResolvedIcon icon = { layout . icon } / >
< / div >
}
< h2 className = "flex text-theme-800 dark:text-theme-300 text-xl font-medium" > { services . name } < / h2 >
< MdKeyboardArrowDown className = { classNames (
disableCollapse ? 'hidden' : '' ,
'transition-all opacity-0 group-hover:opacity-100 ml-auto text-theme-800 dark:text-theme-300 text-xl' ,
open ? '' : 'rotate-90'
) } / >
< / Disclosure.Button >
}
< h2 className = "flex text-theme-800 dark:text-theme-300 text-xl font-medium" > { services . name } < / h2 >
< MdKeyboardArrowDown className = { classNames (
disableCollapse ? 'hidden' : '' ,
'transition-all opacity-0 group-hover:opacity-100 ml-auto text-theme-800 dark:text-theme-300 text-xl' ,
open ? '' : 'rotate-90'
) } / >
< / Disclosure.Button >
< Transition
/ / O t h e r w i s e t h e t r a n s i t i o n g r o u p d o e s d i s p l a y : n o n e a n d c a n c e l s a n i m a t i o n
className = "!block"
unmount = { false }
beforeLeave = { ( ) => {
panel . current . style . height = ` ${ panel . current . scrollHeight } px ` ;
setTimeout ( ( ) => { panel . current . style . height = ` 0 ` } , 1 ) ;
} }
beforeEnter = { ( ) => {
panel . current . style . height = ` 0px ` ;
setTimeout ( ( ) => { panel . current . style . height = ` ${ panel . current . scrollHeight } px ` } , 1 ) ;
} }
>
< Disclosure.Panel className = "transition-all overflow-hidden duration-300 ease-out" ref = { panel } static >
< List group = { group } services = { services . services } layout = { layout } / >
< / Disclosure.Panel >
< / Transition >
< / >
) }
< / Disclosure >
< Transition
/ / O t h e r w i s e t h e t r a n s i t i o n g r o u p d o e s d i s p l a y : n o n e a n d c a n c e l s a n i m a t i o n
className = "!block"
unmount = { false }
beforeLeave = { ( ) => {
panel . current . style . height = ` ${ panel . current . scrollHeight } px ` ;
setTimeout ( ( ) => { panel . current . style . height = ` 0 ` } , 1 ) ;
} }
beforeEnter = { ( ) => {
panel . current . style . height = ` 0px ` ;
setTimeout ( ( ) => { panel . current . style . height = ` ${ panel . current . scrollHeight } px ` } , 1 ) ;
} }
>
< Disclosure.Panel className = "transition-all overflow-hidden duration-300 ease-out" ref = { panel } static >
< List group = { group } services = { services . services } layout = { layout } / >
< / Disclosure.Panel >
< / Transition >
< / >
) }
< / Disclosure >
< / div >
) ;
}