-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrated Developer Docs #5683
Merged
Merged
Migrated Developer Docs #5683
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8ed2eb5
add docs
ady-beraud f588e4b
layout + docs
ady-beraud 9296b77
modified layout
ady-beraud 4da0e22
Merge branch 'main' into add-docs-twenty
ady-beraud 231cdb3
Docs migration
ady-beraud 37fa2e0
refactor code + responsive design
ady-beraud 913784a
integrated algolia for docs + removed useless code in mdx files
ady-beraud 7b4295d
remove console log
ady-beraud 3c9831d
restore table
ady-beraud 087d858
Rename docs to developers
FelixMalfait 54747c7
Fix playground, update content
FelixMalfait a84a758
Collapse
FelixMalfait 568d4ae
Attempt to add link to developer doc on user guide
FelixMalfait 3389b15
Margin bottom
FelixMalfait b2bac8c
modifications
ady-beraud b9933e4
Merge branch 'main' into add-docs-twenty
ady-beraud cdd38d8
Merge branch 'main' into add-docs-twenty
FelixMalfait 522eed9
Basic infos
FelixMalfait File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+333 KB
packages/twenty-website/public/images/docs/getting-started/doc-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.1 KB
packages/twenty-website/public/images/docs/server/add-custom-objects.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+147 KB
packages/twenty-website/public/images/docs/server/custom-object-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-16.9 KB
(22%)
packages/twenty-website/public/images/user-guide/what-is-twenty/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
'use client'; | ||
import styled from '@emotion/styled'; | ||
import { usePathname } from 'next/navigation'; | ||
|
||
import DocsCard from '@/app/_components/docs/DocsCard'; | ||
import { Breadcrumbs } from '@/app/_components/ui/layout/Breadcrumbs'; | ||
import mq from '@/app/_components/ui/theme/mq'; | ||
import { Theme } from '@/app/_components/ui/theme/theme'; | ||
import UserGuideCard from '@/app/_components/user-guide/UserGuideCard'; | ||
import { UserGuideArticlesProps } from '@/content/user-guide/constants/getUserGuideArticles'; | ||
import { DocsArticlesProps } from '@/content/user-guide/constants/getDocsArticles'; | ||
import { constructSections } from '@/shared-utils/constructSections'; | ||
import { filterDocsIndex } from '@/shared-utils/filterDocsIndex'; | ||
import { getUriAndLabel } from '@/shared-utils/pathUtils'; | ||
|
||
const StyledContainer = styled.div` | ||
${mq({ | ||
|
@@ -26,12 +31,14 @@ const StyledWrapper = styled.div` | |
|
||
@media (max-width: 450px) { | ||
padding: ${Theme.spacing(10)} 30px ${Theme.spacing(20)}; | ||
align-items: center; | ||
align-items: flex-start; | ||
width: 340px; | ||
} | ||
|
||
@media (min-width: 450px) and (max-width: 800px) { | ||
padding: ${Theme.spacing(10)} 50px ${Theme.spacing(20)}; | ||
align-items: center; | ||
align-items: flex-start; | ||
width: 440px; | ||
} | ||
|
||
@media (min-width: 1500px) { | ||
|
@@ -45,12 +52,25 @@ const StyledTitle = styled.div` | |
font-size: ${Theme.font.size.sm}; | ||
color: ${Theme.text.color.quarternary}; | ||
font-weight: ${Theme.font.weight.medium}; | ||
margin-bottom: 32px; | ||
width: 100%; | ||
|
||
@media (min-width: 450px) and (max-width: 800px) { | ||
width: 340px; | ||
margin-bottom: 24px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
`; | ||
|
||
const StyledSection = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
@media (min-width: 801px) { | ||
align-items: flex-start; | ||
} | ||
&:not(:last-child) { | ||
margin-bottom: 50px; | ||
} | ||
`; | ||
|
||
|
@@ -63,6 +83,10 @@ const StyledHeader = styled.div` | |
width: 340px; | ||
margin-bottom: 24px; | ||
} | ||
@media (min-width: 450px) and (max-width: 800px) { | ||
margin-bottom: 24px; | ||
width: 340px; | ||
} | ||
`; | ||
|
||
const StyledHeading = styled.h1` | ||
|
@@ -71,6 +95,7 @@ const StyledHeading = styled.h1` | |
font-size: 40px; | ||
color: ${Theme.text.color.primary}; | ||
margin: 0px; | ||
margin-top: 32px; | ||
@media (max-width: 800px) { | ||
font-size: 28px; | ||
} | ||
|
@@ -102,28 +127,60 @@ const StyledContent = styled.div` | |
} | ||
`; | ||
|
||
interface UserGuideProps { | ||
userGuideArticleCards: UserGuideArticlesProps[]; | ||
interface DocsProps { | ||
docsArticleCards: DocsArticlesProps[]; | ||
isSection?: boolean; | ||
} | ||
|
||
export default function UserGuideMain({ | ||
userGuideArticleCards, | ||
}: UserGuideProps) { | ||
export default function DocsMain({ | ||
docsArticleCards, | ||
isSection = false, | ||
}: DocsProps) { | ||
const sections = constructSections(docsArticleCards, isSection); | ||
const pathname = usePathname(); | ||
const { uri, label } = getUriAndLabel(pathname); | ||
|
||
const BREADCRUMB_ITEMS = [ | ||
{ | ||
uri: uri, | ||
label: label, | ||
}, | ||
]; | ||
|
||
return ( | ||
<StyledContainer> | ||
<StyledWrapper> | ||
<StyledTitle>User Guide</StyledTitle> | ||
<StyledHeader> | ||
<StyledHeading>User Guide</StyledHeading> | ||
<StyledSubHeading> | ||
A brief guide to grasp the basics of Twenty | ||
</StyledSubHeading> | ||
</StyledHeader> | ||
<StyledContent> | ||
{userGuideArticleCards.map((card) => { | ||
return <UserGuideCard key={card.title} card={card} />; | ||
})} | ||
</StyledContent> | ||
{isSection ? ( | ||
<Breadcrumbs | ||
items={BREADCRUMB_ITEMS} | ||
activePage={sections[0].name} | ||
separator="/" | ||
/> | ||
) : ( | ||
<StyledTitle>{label}</StyledTitle> | ||
)} | ||
{sections.map((section, index) => { | ||
const filteredArticles = isSection | ||
? docsArticleCards | ||
: filterDocsIndex(docsArticleCards, section.name); | ||
Comment on lines
+163
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure |
||
return ( | ||
<StyledSection key={index}> | ||
<StyledHeader> | ||
<StyledHeading>{section.name}</StyledHeading> | ||
<StyledSubHeading>{section.info}</StyledSubHeading> | ||
</StyledHeader> | ||
<StyledContent> | ||
{filteredArticles.map((card) => ( | ||
<DocsCard | ||
key={card.title} | ||
card={card} | ||
isSection={isSection} | ||
/> | ||
))} | ||
</StyledContent> | ||
</StyledSection> | ||
); | ||
})} | ||
</StyledWrapper> | ||
</StyledContainer> | ||
); | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reduced border radius from 8px to 6px for consistency.