ff1bca1816
- Fixes #5504 - Fixes #5503 - Return 404 when the page does not exist - Modified the footer in order to align it properly - Removed "noticed something to change" in each table of content - Fixed the URLs of the edit module - Added the edit module to Developers - Fixed header style on the REST API page. - Edited the README to point to Developers - Fixed selected state when clicking on sidebar elements --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { DocsArticlesProps } from '@/content/user-guide/constants/getDocsArticles';
|
|
|
|
export const getCardPath = (
|
|
card: DocsArticlesProps,
|
|
basePath: string,
|
|
isSection: boolean,
|
|
sectionName?: string,
|
|
) => {
|
|
const isPlayground = [
|
|
'core-api-rest',
|
|
'metadata-api-rest',
|
|
'core-api-graphql',
|
|
'metadata-api-graphql',
|
|
];
|
|
|
|
if (isPlayground.includes(card.fileName)) {
|
|
const apiType = card.fileName.includes('rest') ? 'rest-api' : 'graphql';
|
|
const apiName = card.fileName.includes('core') ? 'core' : 'metadata';
|
|
return `${basePath}/${apiType}/${apiName}`;
|
|
} else if (card.fileName.includes('storybook')) {
|
|
return 'https://storybook.twenty.com';
|
|
} else if (card.fileName.includes('components')) {
|
|
return `/twenty-ui`;
|
|
} else {
|
|
if (sectionName) {
|
|
return card.numberOfFiles > 1
|
|
? `${basePath}section/${sectionName}/${card.fileName}`
|
|
: `${basePath}${card.fileName}`;
|
|
} else {
|
|
return card.numberOfFiles > 1 && !isSection
|
|
? `${basePath}/section/${card.fileName}`
|
|
: `${basePath}/${card.fileName}`;
|
|
}
|
|
}
|
|
};
|