Skip to content

Commit

Permalink
feat: part3 - temp changes for demo purpose only
Browse files Browse the repository at this point in the history
  • Loading branch information
YounixM committed Oct 4, 2024
1 parent cacde7b commit 409fe56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
8 changes: 4 additions & 4 deletions app/docs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export default async function Page({ params }: { params: { slug: string[] } }) {
<div className="doc-content">
<h2 className="mt-2 text-3xl">{title}</h2>
<MDXLayoutRenderer code={post.body.code} components={components} toc={post.toc || []} />
<PageFeedback />
<DocsPrevNext />
{/* <PageFeedback />
<DocsPrevNext /> */}
</div>

{!hide_table_of_contents && toc && Array.isArray(toc) && toc.length > 0 && (
{/* {!hide_table_of_contents && toc && Array.isArray(toc) && toc.length > 0 && (
<div className="doc-toc">
<div className="mb-3 text-xs uppercase"> On this page </div>
Expand All @@ -87,7 +87,7 @@ export default async function Page({ params }: { params: { slug: string[] } }) {
})}
</div>
</div>
)}
)} */}
</div>

{/* </DocLayout> */}
Expand Down
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<SectionContainer>
<div className="relative flex h-screen flex-col justify-between ">
<SearchProvider searchConfig={siteMetadata.search as SearchConfig}>
<TopNav />
{/* <TopNav /> */}
<main className="mb-auto mt-[48px]">{children}</main>
</SearchProvider>
<MainFooter />
{/* <MainFooter /> */}
</div>
</SectionContainer>
</ThemeProviders>
Expand Down
23 changes: 3 additions & 20 deletions components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,10 @@ const Tabs = ({ children, entityName }) => {
return React.isValidElement(element)
}

const [activeTab, setActiveTab] = useState(null)
const firstValidChild = childrenArray.find(isValidElement)
const initialActiveTab = firstValidChild ? firstValidChild.props.value : null

useEffect(() => {
// Find the first valid React element to set as the initial active tab
const firstValidChild = childrenArray.find(isValidElement)
const initialActiveTab = firstValidChild ? firstValidChild.props.value : null

if (source !== 'onboarding') {
setActiveTab(initialActiveTab)
} else {
setActiveTab(environment || initialActiveTab)
}
}, [source, environment, childrenArray])

// useEffect(() => {
// console.log('Tabs - activeTab', activeTab)

// if (activeTab) {
// router.replace(`?source=${source}&environment=${activeTab}`)
// }
// }, [activeTab])
const [activeTab, setActiveTab] = useState(environment || initialActiveTab)

return (
<div className="w-full">
Expand Down

0 comments on commit 409fe56

Please sign in to comment.