Refactor content fetching and enhance UI mods
Refactored content fetching in the docs and blog pages to use a new 'getDocs' function to improve code reuse. Made minor adjustments to the UI in 'makerkit/page.tsx'. This involved modifying the layout and adding conditionals to tackle optional props. Also added a new textarea component reference in the UI package.
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
import { Cms, createCmsClient } from '@kit/cms';
|
||||
|
||||
import { DocsNavigation } from '~/(marketing)/docs/_components/docs-navigation';
|
||||
import { getDocs } from '~/(marketing)/docs/_lib/server/docs.loader';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
|
||||
async function DocsLayout({ children }: React.PropsWithChildren) {
|
||||
const cms = await createCmsClient();
|
||||
const { resolvedLanguage } = await createI18nServerInstance();
|
||||
|
||||
const { items: pages } = await cms.getContentItems({
|
||||
collection: 'documentation',
|
||||
language: resolvedLanguage,
|
||||
});
|
||||
const pages = await getDocs(resolvedLanguage);
|
||||
|
||||
return (
|
||||
<div className={'flex'}>
|
||||
|
||||
Reference in New Issue
Block a user