mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-22 15:09:43 +00:00
部分配置支持环境变量
This commit is contained in:
@@ -24,28 +24,30 @@ const Tabs = ({ children }) => {
|
||||
}
|
||||
|
||||
const [currentTab, setCurrentTab] = useState(0)
|
||||
|
||||
function tabClickHandle (i) {
|
||||
setCurrentTab(i)
|
||||
}
|
||||
|
||||
return (
|
||||
< >
|
||||
{<div className='hidden lg:block mb-5 bg-white dark:bg-gray-800 duration-200'>
|
||||
<ul className='flex justify-center space-x-5 pb-4 dark:text-gray-400 text-gray-600'>
|
||||
{children.map((item, index) => {
|
||||
return <li key={index} className={(currentTab === index ? 'font-black border-b-2 border-red-400 text-red-400 animate__animated animate__jello ' : 'font-extralight cursor-pointer') + ' text-sm font-sans '} onClick={() => { tabClickHandle(index) }}>
|
||||
{item?.key}
|
||||
</li>
|
||||
})}
|
||||
</ul>
|
||||
{children.map((item, index) => {
|
||||
return <section key={index} className={`${currentTab === index ? 'block animate__animated animate__fadeIn animate__faster' : 'hidden'}`}>
|
||||
{item}
|
||||
</section>
|
||||
})}
|
||||
</div>}
|
||||
|
||||
</>)
|
||||
return <div className='mb-5 bg-white dark:bg-gray-800 duration-200'>
|
||||
<ul className='flex justify-center space-x-5 pb-4 dark:text-gray-400 text-gray-600'>
|
||||
{children.map((item, index) => {
|
||||
return <li key={index}
|
||||
className={(currentTab === index ? 'font-black border-b-2 border-red-400 text-red-400 animate__animated animate__jello ' : 'font-extralight cursor-pointer') + ' text-sm font-sans '}
|
||||
onClick={() => {
|
||||
tabClickHandle(index)
|
||||
}}>
|
||||
{item?.key}
|
||||
</li>
|
||||
})}
|
||||
</ul>
|
||||
{children.map((item, index) => {
|
||||
return <section key={index}
|
||||
className={`${currentTab === index ? 'block animate__animated animate__fadeIn animate__faster' : 'hidden'}`}>
|
||||
{item}
|
||||
</section>
|
||||
})}
|
||||
</div>
|
||||
}
|
||||
|
||||
export default Tabs
|
||||
|
||||
Reference in New Issue
Block a user