From 5de1c2c31dfd84db189a39b592453845f058a31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 23 Feb 2024 17:42:13 +0100 Subject: [PATCH] New folder structure for website (#4159) New folder structure --- .../client-utils}/useDeviceType.ts | 0 .../contributors}/ActivityLog.tsx | 4 +- .../contributors}/AvatarGrid.tsx | 2 +- .../contributors}/Breadcrumb.tsx | 4 +- .../contributors}/CardContainer.tsx | 0 .../contributors}/ContentContainer.tsx | 0 .../contributors/Header.tsx | 0 .../contributors}/ProfileCard.tsx | 2 +- .../contributors}/ProfileInfo.tsx | 2 +- .../contributors}/PullRequestItem.tsx | 4 +- .../contributors}/PullRequests.tsx | 6 +- .../contributors}/ThankYou.tsx | 4 +- .../contributors}/Title.tsx | 0 .../oss-friends/Background.tsx | 0 .../oss-friends/Card.tsx | 0 .../oss-friends/CardContainer.tsx | 0 .../oss-friends/ContentContainer.tsx | 0 .../oss-friends/Header.tsx | 0 .../ui/icons/SvgIcons.tsx} | 17 ++ .../app/{ => _components}/ui/icons/index.ts | 0 .../ui/layout}/Breadcrumbs.tsx | 7 +- .../ui/layout}/ContentContainer.tsx | 0 .../ui/layout}/FooterDesktop.tsx | 8 +- .../ui/layout}/HeaderDesktop.tsx | 5 +- .../ui/layout}/HeaderMobile.tsx | 5 +- .../ui/layout}/Logo.tsx | 0 .../ui/layout}/PostImage.tsx | 0 .../{ => _components}/ui/theme/background.ts | 0 .../app/{ => _components}/ui/theme/border.ts | 0 .../app/{ => _components}/ui/theme/colors.ts | 0 .../app/{ => _components}/ui/theme/font.ts | 0 .../app/{ => _components}/ui/theme/icon.ts | 0 .../app/{ => _components}/ui/theme/text.ts | 0 .../src/app/_components/ui/theme/theme.ts | 18 ++ .../user-guide/UserGuideCard.tsx | 4 +- .../user-guide/UserGuideContent.tsx | 11 +- .../user-guide/UserGuideMain.tsx | 11 +- .../user-guide/UserGuideSidebar.tsx | 13 +- .../user-guide/UserGuideSidebarSection.tsx | 6 +- .../user-guide/UserGuideTableContents.tsx | 2 +- .../user-guide/UserGuideTocComponent.tsx | 0 .../src/app/{ => _server-utils}/get-posts.tsx | 0 .../src/app/components/ExternalArrow.tsx | 16 -- .../src/app/components/Playground.tsx | 31 --- .../app/components/PlaygroundTokenForm.tsx | 190 ------------------ .../contributors/[slug]/page.tsx | 16 +- .../contributors/api/generate/route.tsx | 0 .../{developers => }/contributors/page.tsx | 8 +- .../src/app/developers/docs/graphql/page.tsx | 27 --- .../src/app/developers/docs/layout.tsx | 63 ------ .../src/app/developers/docs/page.tsx | 9 - .../src/app/developers/docs/rest/page.tsx | 33 --- .../src/app/developers/page.tsx | 9 - packages/twenty-website/src/app/layout.css | 1 + packages/twenty-website/src/app/layout.tsx | 8 +- .../src/app/oss-friends/page.tsx | 10 +- packages/twenty-website/src/app/page.tsx | 2 +- .../twenty-website/src/app/releases/page.tsx | 72 ------- .../twenty-website/src/app/ui/theme/theme.ts | 18 -- .../src/app/user-guide/[slug]/page.tsx | 4 +- .../src/app/user-guide/layout.tsx | 11 +- .../src/app/user-guide/page.tsx | 2 +- .../constants/UserGuideHomeCards.ts | 0 .../user-guide/constants/UserGuideIndex.ts | 0 .../formatIntoRelativeDate.ts} | 0 65 files changed, 128 insertions(+), 537 deletions(-) rename packages/twenty-website/src/app/{ui/utilities => _components/client-utils}/useDeviceType.ts (100%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/ActivityLog.tsx (78%) rename packages/twenty-website/src/app/{components => _components/contributors}/AvatarGrid.tsx (94%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/Breadcrumb.tsx (71%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/CardContainer.tsx (100%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/ContentContainer.tsx (100%) rename packages/twenty-website/src/app/{components/developers => _components}/contributors/Header.tsx (100%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/ProfileCard.tsx (96%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/ProfileInfo.tsx (94%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/PullRequestItem.tsx (93%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/PullRequests.tsx (74%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/ThankYou.tsx (81%) rename packages/twenty-website/src/app/{developers/contributors/[slug]/components => _components/contributors}/Title.tsx (100%) rename packages/twenty-website/src/app/{components => _components}/oss-friends/Background.tsx (100%) rename packages/twenty-website/src/app/{components => _components}/oss-friends/Card.tsx (100%) rename packages/twenty-website/src/app/{components => _components}/oss-friends/CardContainer.tsx (100%) rename packages/twenty-website/src/app/{components => _components}/oss-friends/ContentContainer.tsx (100%) rename packages/twenty-website/src/app/{components => _components}/oss-friends/Header.tsx (100%) rename packages/twenty-website/src/app/{components/Icons.tsx => _components/ui/icons/SvgIcons.tsx} (94%) rename packages/twenty-website/src/app/{ => _components}/ui/icons/index.ts (100%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/Breadcrumbs.tsx (93%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/ContentContainer.tsx (100%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/FooterDesktop.tsx (97%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/HeaderDesktop.tsx (95%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/HeaderMobile.tsx (97%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/Logo.tsx (100%) rename packages/twenty-website/src/app/{components => _components/ui/layout}/PostImage.tsx (100%) rename packages/twenty-website/src/app/{ => _components}/ui/theme/background.ts (100%) rename packages/twenty-website/src/app/{ => _components}/ui/theme/border.ts (100%) rename packages/twenty-website/src/app/{ => _components}/ui/theme/colors.ts (100%) rename packages/twenty-website/src/app/{ => _components}/ui/theme/font.ts (100%) rename packages/twenty-website/src/app/{ => _components}/ui/theme/icon.ts (100%) rename packages/twenty-website/src/app/{ => _components}/ui/theme/text.ts (100%) create mode 100644 packages/twenty-website/src/app/_components/ui/theme/theme.ts rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideCard.tsx (88%) rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideContent.tsx (90%) rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideMain.tsx (87%) rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideSidebar.tsx (84%) rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideSidebarSection.tsx (93%) rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideTableContents.tsx (94%) rename packages/twenty-website/src/app/{components => _components}/user-guide/UserGuideTocComponent.tsx (100%) rename packages/twenty-website/src/app/{ => _server-utils}/get-posts.tsx (100%) delete mode 100644 packages/twenty-website/src/app/components/ExternalArrow.tsx delete mode 100644 packages/twenty-website/src/app/components/Playground.tsx delete mode 100644 packages/twenty-website/src/app/components/PlaygroundTokenForm.tsx rename packages/twenty-website/src/app/{developers => }/contributors/[slug]/page.tsx (82%) rename packages/twenty-website/src/app/{developers => }/contributors/api/generate/route.tsx (100%) rename packages/twenty-website/src/app/{developers => }/contributors/page.tsx (82%) delete mode 100644 packages/twenty-website/src/app/developers/docs/graphql/page.tsx delete mode 100644 packages/twenty-website/src/app/developers/docs/layout.tsx delete mode 100644 packages/twenty-website/src/app/developers/docs/page.tsx delete mode 100644 packages/twenty-website/src/app/developers/docs/rest/page.tsx delete mode 100644 packages/twenty-website/src/app/developers/page.tsx delete mode 100644 packages/twenty-website/src/app/releases/page.tsx delete mode 100644 packages/twenty-website/src/app/ui/theme/theme.ts rename packages/twenty-website/src/{app => content}/user-guide/constants/UserGuideHomeCards.ts (100%) rename packages/twenty-website/src/{app => content}/user-guide/constants/UserGuideIndex.ts (100%) rename packages/twenty-website/src/{lib/utils.ts => shared-utils/formatIntoRelativeDate.ts} (100%) diff --git a/packages/twenty-website/src/app/ui/utilities/useDeviceType.ts b/packages/twenty-website/src/app/_components/client-utils/useDeviceType.ts similarity index 100% rename from packages/twenty-website/src/app/ui/utilities/useDeviceType.ts rename to packages/twenty-website/src/app/_components/client-utils/useDeviceType.ts diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ActivityLog.tsx b/packages/twenty-website/src/app/_components/contributors/ActivityLog.tsx similarity index 78% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/ActivityLog.tsx rename to packages/twenty-website/src/app/_components/contributors/ActivityLog.tsx index 692b7521b..ecea57139 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ActivityLog.tsx +++ b/packages/twenty-website/src/app/_components/contributors/ActivityLog.tsx @@ -2,8 +2,8 @@ import { ResponsiveTimeRange } from '@nivo/calendar'; -import { CardContainer } from '@/app/developers/contributors/[slug]/components/CardContainer'; -import { Title } from '@/app/developers/contributors/[slug]/components/Title'; +import { CardContainer } from '@/app/_components/contributors/CardContainer'; +import { Title } from '@/app/_components/contributors/Title'; export const ActivityLog = ({ data, diff --git a/packages/twenty-website/src/app/components/AvatarGrid.tsx b/packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsx similarity index 94% rename from packages/twenty-website/src/app/components/AvatarGrid.tsx rename to packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsx index 28c8b06a7..50512ad2e 100644 --- a/packages/twenty-website/src/app/components/AvatarGrid.tsx +++ b/packages/twenty-website/src/app/_components/contributors/AvatarGrid.tsx @@ -66,7 +66,7 @@ const AvatarGrid = ({ users }: { users: User[] }) => { return ( {users.map((user) => ( - + {user.id} {user.id} diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/Breadcrumb.tsx b/packages/twenty-website/src/app/_components/contributors/Breadcrumb.tsx similarity index 71% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/Breadcrumb.tsx rename to packages/twenty-website/src/app/_components/contributors/Breadcrumb.tsx index b5fea70bf..ea54b05ff 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/Breadcrumb.tsx +++ b/packages/twenty-website/src/app/_components/contributors/Breadcrumb.tsx @@ -1,10 +1,10 @@ 'use client'; -import { Breadcrumbs } from '@/app/components/Breadcrumbs'; +import { Breadcrumbs } from '@/app/_components/ui/layout/Breadcrumbs'; const BREADCRUMB_ITEMS = [ { - uri: '/developers/contributors', + uri: '/contributors', label: 'Contributors', }, ]; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/CardContainer.tsx b/packages/twenty-website/src/app/_components/contributors/CardContainer.tsx similarity index 100% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/CardContainer.tsx rename to packages/twenty-website/src/app/_components/contributors/CardContainer.tsx diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ContentContainer.tsx b/packages/twenty-website/src/app/_components/contributors/ContentContainer.tsx similarity index 100% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/ContentContainer.tsx rename to packages/twenty-website/src/app/_components/contributors/ContentContainer.tsx diff --git a/packages/twenty-website/src/app/components/developers/contributors/Header.tsx b/packages/twenty-website/src/app/_components/contributors/Header.tsx similarity index 100% rename from packages/twenty-website/src/app/components/developers/contributors/Header.tsx rename to packages/twenty-website/src/app/_components/contributors/Header.tsx diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ProfileCard.tsx b/packages/twenty-website/src/app/_components/contributors/ProfileCard.tsx similarity index 96% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/ProfileCard.tsx rename to packages/twenty-website/src/app/_components/contributors/ProfileCard.tsx index 6a836fd09..d24842430 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ProfileCard.tsx +++ b/packages/twenty-website/src/app/_components/contributors/ProfileCard.tsx @@ -3,7 +3,7 @@ import styled from '@emotion/styled'; import { format } from 'date-fns'; -import { GithubIcon } from '@/app/components/Icons'; +import { GithubIcon } from '@/app/_components/ui/icons/SvgIcons'; const ProfileContainer = styled.div` display: flex; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ProfileInfo.tsx b/packages/twenty-website/src/app/_components/contributors/ProfileInfo.tsx similarity index 94% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/ProfileInfo.tsx rename to packages/twenty-website/src/app/_components/contributors/ProfileInfo.tsx index 2e2c9135c..435a93cd2 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ProfileInfo.tsx +++ b/packages/twenty-website/src/app/_components/contributors/ProfileInfo.tsx @@ -2,7 +2,7 @@ import styled from '@emotion/styled'; -import { CardContainer } from '@/app/developers/contributors/[slug]/components/CardContainer'; +import { CardContainer } from '@/app/_components/contributors/CardContainer'; const Container = styled(CardContainer)` flex-direction: row; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/PullRequestItem.tsx b/packages/twenty-website/src/app/_components/contributors/PullRequestItem.tsx similarity index 93% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/PullRequestItem.tsx rename to packages/twenty-website/src/app/_components/contributors/PullRequestItem.tsx index 705d426b8..edb57d0a1 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/PullRequestItem.tsx +++ b/packages/twenty-website/src/app/_components/contributors/PullRequestItem.tsx @@ -2,8 +2,8 @@ import { Tooltip } from 'react-tooltip'; import styled from '@emotion/styled'; import { format } from 'date-fns'; -import { PullRequestIcon } from '@/app/components/Icons'; -import { formatIntoRelativeDate } from '@/lib/utils'; +import { PullRequestIcon } from '@/app/_components/ui/icons/SvgIcons'; +import { formatIntoRelativeDate } from '@/shared-utils/formatIntoRelativeDate'; const StyledTooltip = styled(Tooltip)``; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/PullRequests.tsx b/packages/twenty-website/src/app/_components/contributors/PullRequests.tsx similarity index 74% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/PullRequests.tsx rename to packages/twenty-website/src/app/_components/contributors/PullRequests.tsx index 869730c15..f7822c622 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/PullRequests.tsx +++ b/packages/twenty-website/src/app/_components/contributors/PullRequests.tsx @@ -2,9 +2,9 @@ import styled from '@emotion/styled'; -import { CardContainer } from '@/app/developers/contributors/[slug]/components/CardContainer'; -import { PullRequestItem } from '@/app/developers/contributors/[slug]/components/PullRequestItem'; -import { Title } from '@/app/developers/contributors/[slug]/components/Title'; +import { CardContainer } from '@/app/_components/contributors/CardContainer'; +import { PullRequestItem } from '@/app/_components/contributors/PullRequestItem'; +import { Title } from '@/app/_components/contributors/Title'; const List = styled.div` display: flex; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ThankYou.tsx b/packages/twenty-website/src/app/_components/contributors/ThankYou.tsx similarity index 81% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/ThankYou.tsx rename to packages/twenty-website/src/app/_components/contributors/ThankYou.tsx index 4a93eb6ba..a0a80dba5 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/components/ThankYou.tsx +++ b/packages/twenty-website/src/app/_components/contributors/ThankYou.tsx @@ -2,8 +2,8 @@ import styled from '@emotion/styled'; -import { HeartIcon } from '@/app/components/Icons'; -import { CardContainer } from '@/app/developers/contributors/[slug]/components/CardContainer'; +import { CardContainer } from '@/app/_components/contributors/CardContainer'; +import { HeartIcon } from '@/app/_components/ui/icons/SvgIcons'; const StyledTitle = styled.div` display: flex; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/components/Title.tsx b/packages/twenty-website/src/app/_components/contributors/Title.tsx similarity index 100% rename from packages/twenty-website/src/app/developers/contributors/[slug]/components/Title.tsx rename to packages/twenty-website/src/app/_components/contributors/Title.tsx diff --git a/packages/twenty-website/src/app/components/oss-friends/Background.tsx b/packages/twenty-website/src/app/_components/oss-friends/Background.tsx similarity index 100% rename from packages/twenty-website/src/app/components/oss-friends/Background.tsx rename to packages/twenty-website/src/app/_components/oss-friends/Background.tsx diff --git a/packages/twenty-website/src/app/components/oss-friends/Card.tsx b/packages/twenty-website/src/app/_components/oss-friends/Card.tsx similarity index 100% rename from packages/twenty-website/src/app/components/oss-friends/Card.tsx rename to packages/twenty-website/src/app/_components/oss-friends/Card.tsx diff --git a/packages/twenty-website/src/app/components/oss-friends/CardContainer.tsx b/packages/twenty-website/src/app/_components/oss-friends/CardContainer.tsx similarity index 100% rename from packages/twenty-website/src/app/components/oss-friends/CardContainer.tsx rename to packages/twenty-website/src/app/_components/oss-friends/CardContainer.tsx diff --git a/packages/twenty-website/src/app/components/oss-friends/ContentContainer.tsx b/packages/twenty-website/src/app/_components/oss-friends/ContentContainer.tsx similarity index 100% rename from packages/twenty-website/src/app/components/oss-friends/ContentContainer.tsx rename to packages/twenty-website/src/app/_components/oss-friends/ContentContainer.tsx diff --git a/packages/twenty-website/src/app/components/oss-friends/Header.tsx b/packages/twenty-website/src/app/_components/oss-friends/Header.tsx similarity index 100% rename from packages/twenty-website/src/app/components/oss-friends/Header.tsx rename to packages/twenty-website/src/app/_components/oss-friends/Header.tsx diff --git a/packages/twenty-website/src/app/components/Icons.tsx b/packages/twenty-website/src/app/_components/ui/icons/SvgIcons.tsx similarity index 94% rename from packages/twenty-website/src/app/components/Icons.tsx rename to packages/twenty-website/src/app/_components/ui/icons/SvgIcons.tsx index 661b4021c..91f76461b 100644 --- a/packages/twenty-website/src/app/components/Icons.tsx +++ b/packages/twenty-website/src/app/_components/ui/icons/SvgIcons.tsx @@ -152,3 +152,20 @@ export const HeartIcon = ({ size = 'S', color = 'rgb(179,179,179)' }) => { ); }; + +export const ExternalArrow = () => { + return ( +
+ + + + + +
+ ); +}; diff --git a/packages/twenty-website/src/app/ui/icons/index.ts b/packages/twenty-website/src/app/_components/ui/icons/index.ts similarity index 100% rename from packages/twenty-website/src/app/ui/icons/index.ts rename to packages/twenty-website/src/app/_components/ui/icons/index.ts diff --git a/packages/twenty-website/src/app/components/Breadcrumbs.tsx b/packages/twenty-website/src/app/_components/ui/layout/Breadcrumbs.tsx similarity index 93% rename from packages/twenty-website/src/app/components/Breadcrumbs.tsx rename to packages/twenty-website/src/app/_components/ui/layout/Breadcrumbs.tsx index 0e7ebadc3..0b90803e4 100644 --- a/packages/twenty-website/src/app/components/Breadcrumbs.tsx +++ b/packages/twenty-website/src/app/_components/ui/layout/Breadcrumbs.tsx @@ -5,8 +5,11 @@ import styled from '@emotion/styled'; import { IconChevronLeft } from '@tabler/icons-react'; import Link from 'next/link'; -import { Theme } from '@/app/ui/theme/theme'; -import { DeviceType, useDeviceType } from '@/app/ui/utilities/useDeviceType'; +import { + DeviceType, + useDeviceType, +} from '@/app/_components/client-utils/useDeviceType'; +import { Theme } from '@/app/_components/ui/theme/theme'; const Container = styled.div` display: flex; diff --git a/packages/twenty-website/src/app/components/ContentContainer.tsx b/packages/twenty-website/src/app/_components/ui/layout/ContentContainer.tsx similarity index 100% rename from packages/twenty-website/src/app/components/ContentContainer.tsx rename to packages/twenty-website/src/app/_components/ui/layout/ContentContainer.tsx diff --git a/packages/twenty-website/src/app/components/FooterDesktop.tsx b/packages/twenty-website/src/app/_components/ui/layout/FooterDesktop.tsx similarity index 97% rename from packages/twenty-website/src/app/components/FooterDesktop.tsx rename to packages/twenty-website/src/app/_components/ui/layout/FooterDesktop.tsx index 18b97408b..7015e72c1 100644 --- a/packages/twenty-website/src/app/components/FooterDesktop.tsx +++ b/packages/twenty-website/src/app/_components/ui/layout/FooterDesktop.tsx @@ -3,7 +3,13 @@ import styled from '@emotion/styled'; import { usePathname } from 'next/navigation'; -import { DiscordIcon, GithubIcon2, LinkedInIcon, XIcon } from './Icons'; +import { + DiscordIcon, + GithubIcon2, + LinkedInIcon, + XIcon, +} from '../icons/SvgIcons'; + import { Logo } from './Logo'; const FooterContainer = styled.div` diff --git a/packages/twenty-website/src/app/components/HeaderDesktop.tsx b/packages/twenty-website/src/app/_components/ui/layout/HeaderDesktop.tsx similarity index 95% rename from packages/twenty-website/src/app/components/HeaderDesktop.tsx rename to packages/twenty-website/src/app/_components/ui/layout/HeaderDesktop.tsx index b963571a5..4b9232594 100644 --- a/packages/twenty-website/src/app/components/HeaderDesktop.tsx +++ b/packages/twenty-website/src/app/_components/ui/layout/HeaderDesktop.tsx @@ -3,9 +3,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import { ExternalArrow } from '@/app/components/ExternalArrow'; +import { ExternalArrow } from '@/app/_components/ui/icons/SvgIcons'; + +import { GithubIcon } from '../icons/SvgIcons'; -import { GithubIcon } from './Icons'; import { Logo } from './Logo'; const Nav = styled.nav` diff --git a/packages/twenty-website/src/app/components/HeaderMobile.tsx b/packages/twenty-website/src/app/_components/ui/layout/HeaderMobile.tsx similarity index 97% rename from packages/twenty-website/src/app/components/HeaderMobile.tsx rename to packages/twenty-website/src/app/_components/ui/layout/HeaderMobile.tsx index 207caf880..8f510246d 100644 --- a/packages/twenty-website/src/app/components/HeaderMobile.tsx +++ b/packages/twenty-website/src/app/_components/ui/layout/HeaderMobile.tsx @@ -4,9 +4,10 @@ import { useState } from 'react'; import styled from '@emotion/styled'; import { IBM_Plex_Mono } from 'next/font/google'; -import { ExternalArrow } from '@/app/components/ExternalArrow'; +import { ExternalArrow } from '@/app/_components/ui/icons/SvgIcons'; + +import { GithubIcon } from '../icons/SvgIcons'; -import { GithubIcon } from './Icons'; import { Logo } from './Logo'; const IBMPlexMono = IBM_Plex_Mono({ diff --git a/packages/twenty-website/src/app/components/Logo.tsx b/packages/twenty-website/src/app/_components/ui/layout/Logo.tsx similarity index 100% rename from packages/twenty-website/src/app/components/Logo.tsx rename to packages/twenty-website/src/app/_components/ui/layout/Logo.tsx diff --git a/packages/twenty-website/src/app/components/PostImage.tsx b/packages/twenty-website/src/app/_components/ui/layout/PostImage.tsx similarity index 100% rename from packages/twenty-website/src/app/components/PostImage.tsx rename to packages/twenty-website/src/app/_components/ui/layout/PostImage.tsx diff --git a/packages/twenty-website/src/app/ui/theme/background.ts b/packages/twenty-website/src/app/_components/ui/theme/background.ts similarity index 100% rename from packages/twenty-website/src/app/ui/theme/background.ts rename to packages/twenty-website/src/app/_components/ui/theme/background.ts diff --git a/packages/twenty-website/src/app/ui/theme/border.ts b/packages/twenty-website/src/app/_components/ui/theme/border.ts similarity index 100% rename from packages/twenty-website/src/app/ui/theme/border.ts rename to packages/twenty-website/src/app/_components/ui/theme/border.ts diff --git a/packages/twenty-website/src/app/ui/theme/colors.ts b/packages/twenty-website/src/app/_components/ui/theme/colors.ts similarity index 100% rename from packages/twenty-website/src/app/ui/theme/colors.ts rename to packages/twenty-website/src/app/_components/ui/theme/colors.ts diff --git a/packages/twenty-website/src/app/ui/theme/font.ts b/packages/twenty-website/src/app/_components/ui/theme/font.ts similarity index 100% rename from packages/twenty-website/src/app/ui/theme/font.ts rename to packages/twenty-website/src/app/_components/ui/theme/font.ts diff --git a/packages/twenty-website/src/app/ui/theme/icon.ts b/packages/twenty-website/src/app/_components/ui/theme/icon.ts similarity index 100% rename from packages/twenty-website/src/app/ui/theme/icon.ts rename to packages/twenty-website/src/app/_components/ui/theme/icon.ts diff --git a/packages/twenty-website/src/app/ui/theme/text.ts b/packages/twenty-website/src/app/_components/ui/theme/text.ts similarity index 100% rename from packages/twenty-website/src/app/ui/theme/text.ts rename to packages/twenty-website/src/app/_components/ui/theme/text.ts diff --git a/packages/twenty-website/src/app/_components/ui/theme/theme.ts b/packages/twenty-website/src/app/_components/ui/theme/theme.ts new file mode 100644 index 000000000..23fe85b47 --- /dev/null +++ b/packages/twenty-website/src/app/_components/ui/theme/theme.ts @@ -0,0 +1,18 @@ +import { Background } from '@/app/_components/ui/theme/background'; +import { Border } from '@/app/_components/ui/theme/border'; +import { Color } from '@/app/_components/ui/theme/colors'; +import { Font } from '@/app/_components/ui/theme/font'; +import { Icon } from '@/app/_components/ui/theme/icon'; +import { Text } from '@/app/_components/ui/theme/text'; + +export const Theme = { + color: Color, + border: Border, + background: Background, + text: Text, + spacingMultiplicator: 4, + icon: Icon, + font: Font, + spacing: (...args: number[]) => + args.map((multiplicator) => `${multiplicator * 4}px`).join(' '), +}; diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideCard.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideCard.tsx similarity index 88% rename from packages/twenty-website/src/app/components/user-guide/UserGuideCard.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideCard.tsx index 791e0d927..000e24118 100644 --- a/packages/twenty-website/src/app/components/user-guide/UserGuideCard.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideCard.tsx @@ -2,8 +2,8 @@ import styled from '@emotion/styled'; import { useRouter } from 'next/navigation'; -import { Theme } from '@/app/ui/theme/theme'; -import { UserGuideHomeCardsType } from '@/app/user-guide/constants/UserGuideHomeCards'; +import { Theme } from '@/app/_components/ui/theme/theme'; +import { UserGuideHomeCardsType } from '@/content/user-guide/constants/UserGuideHomeCards'; const StyledContainer = styled.div` color: ${Theme.border.color.plain}; diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideContent.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideContent.tsx similarity index 90% rename from packages/twenty-website/src/app/components/user-guide/UserGuideContent.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideContent.tsx index 71cce0ded..c5c15d360 100644 --- a/packages/twenty-website/src/app/components/user-guide/UserGuideContent.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideContent.tsx @@ -2,10 +2,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import { Breadcrumbs } from '@/app/components/Breadcrumbs'; -import { FileContent } from '@/app/get-posts'; -import { Theme } from '@/app/ui/theme/theme'; -import { DeviceType, useDeviceType } from '@/app/ui/utilities/useDeviceType'; +import { + DeviceType, + useDeviceType, +} from '@/app/_components/client-utils/useDeviceType'; +import { Breadcrumbs } from '@/app/_components/ui/layout/Breadcrumbs'; +import { Theme } from '@/app/_components/ui/theme/theme'; +import { FileContent } from '@/app/_server-utils/get-posts'; const StyledContainer = styled.div<{ devicetype: string }>` width: ${({ devicetype }) => diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideMain.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideMain.tsx similarity index 87% rename from packages/twenty-website/src/app/components/user-guide/UserGuideMain.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideMain.tsx index cf416f6b2..b44aa863f 100644 --- a/packages/twenty-website/src/app/components/user-guide/UserGuideMain.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideMain.tsx @@ -1,10 +1,13 @@ 'use client'; import styled from '@emotion/styled'; -import UserGuideCard from '@/app/components/user-guide/UserGuideCard'; -import { Theme } from '@/app/ui/theme/theme'; -import { DeviceType, useDeviceType } from '@/app/ui/utilities/useDeviceType'; -import { UserGuideHomeCards } from '@/app/user-guide/constants/UserGuideHomeCards'; +import { + DeviceType, + useDeviceType, +} from '@/app/_components/client-utils/useDeviceType'; +import { Theme } from '@/app/_components/ui/theme/theme'; +import UserGuideCard from '@/app/_components/user-guide/UserGuideCard'; +import { UserGuideHomeCards } from '@/content/user-guide/constants/UserGuideHomeCards'; const StyledContainer = styled.div<{ isMobile: boolean }>` width: ${({ isMobile }) => (isMobile ? '100%' : '60%')}; diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideSidebar.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebar.tsx similarity index 84% rename from packages/twenty-website/src/app/components/user-guide/UserGuideSidebar.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideSidebar.tsx index de419eb85..ddbdaa6cc 100644 --- a/packages/twenty-website/src/app/components/user-guide/UserGuideSidebar.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebar.tsx @@ -3,11 +3,14 @@ import styled from '@emotion/styled'; import { useRouter } from 'next/navigation'; -import UserGuideSidebarSection from '@/app/components/user-guide/UserGuideSidebarSection'; -import { IconBook } from '@/app/ui/icons'; -import { Theme } from '@/app/ui/theme/theme'; -import { DeviceType, useDeviceType } from '@/app/ui/utilities/useDeviceType'; -import { UserGuideIndex } from '@/app/user-guide/constants/UserGuideIndex'; +import { + DeviceType, + useDeviceType, +} from '@/app/_components/client-utils/useDeviceType'; +import { IconBook } from '@/app/_components/ui/icons'; +import { Theme } from '@/app/_components/ui/theme/theme'; +import UserGuideSidebarSection from '@/app/_components/user-guide/UserGuideSidebarSection'; +import { UserGuideIndex } from '@/content/user-guide/constants/UserGuideIndex'; const StyledContainer = styled.div<{ isTablet: boolean }>` width: ${({ isTablet }) => (isTablet ? '30%' : '20%')}; diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideSidebarSection.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx similarity index 93% rename from packages/twenty-website/src/app/components/user-guide/UserGuideSidebarSection.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx index a098bf07b..6bdc2724c 100644 --- a/packages/twenty-website/src/app/components/user-guide/UserGuideSidebarSection.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideSidebarSection.tsx @@ -5,9 +5,9 @@ import styled from '@emotion/styled'; import { useRouter } from 'next/navigation'; import { usePathname } from 'next/navigation'; -import { IconChevronDown, IconChevronRight } from '@/app/ui/icons'; -import { Theme } from '@/app/ui/theme/theme'; -import { IndexSubtopic } from '@/app/user-guide/constants/UserGuideIndex'; +import { IconChevronDown, IconChevronRight } from '@/app/_components/ui/icons'; +import { Theme } from '@/app/_components/ui/theme/theme'; +import { IndexSubtopic } from '@/content/user-guide/constants/UserGuideIndex'; const StyledContainer = styled.div` display: flex; diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideTableContents.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideTableContents.tsx similarity index 94% rename from packages/twenty-website/src/app/components/user-guide/UserGuideTableContents.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideTableContents.tsx index ba5e2315b..a395285c4 100644 --- a/packages/twenty-website/src/app/components/user-guide/UserGuideTableContents.tsx +++ b/packages/twenty-website/src/app/_components/user-guide/UserGuideTableContents.tsx @@ -3,7 +3,7 @@ import styled from '@emotion/styled'; import { useRouter } from 'next/navigation'; -import { Theme } from '@/app/ui/theme/theme'; +import { Theme } from '@/app/_components/ui/theme/theme'; const StyledContainer = styled.div` width: 20%; diff --git a/packages/twenty-website/src/app/components/user-guide/UserGuideTocComponent.tsx b/packages/twenty-website/src/app/_components/user-guide/UserGuideTocComponent.tsx similarity index 100% rename from packages/twenty-website/src/app/components/user-guide/UserGuideTocComponent.tsx rename to packages/twenty-website/src/app/_components/user-guide/UserGuideTocComponent.tsx diff --git a/packages/twenty-website/src/app/get-posts.tsx b/packages/twenty-website/src/app/_server-utils/get-posts.tsx similarity index 100% rename from packages/twenty-website/src/app/get-posts.tsx rename to packages/twenty-website/src/app/_server-utils/get-posts.tsx diff --git a/packages/twenty-website/src/app/components/ExternalArrow.tsx b/packages/twenty-website/src/app/components/ExternalArrow.tsx deleted file mode 100644 index dc0040115..000000000 --- a/packages/twenty-website/src/app/components/ExternalArrow.tsx +++ /dev/null @@ -1,16 +0,0 @@ -export const ExternalArrow = () => { - return ( -
- - - - - -
- ); -}; diff --git a/packages/twenty-website/src/app/components/Playground.tsx b/packages/twenty-website/src/app/components/Playground.tsx deleted file mode 100644 index 89a0ff03d..000000000 --- a/packages/twenty-website/src/app/components/Playground.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import React, { ReactNode, useState } from 'react'; - -import TokenForm, { - TokenFormProps, -} from '@/app/components/PlaygroundTokenForm'; - -type PlaygroundProps = TokenFormProps & { - children?: ReactNode; -}; - -const Playground = ({ - children, - setOpenApiJson, - setToken, -}: PlaygroundProps) => { - const [isTokenValid, setIsTokenValid] = useState(false); - - return ( - <> - - {isTokenValid && children} - - ); -}; - -export default Playground; diff --git a/packages/twenty-website/src/app/components/PlaygroundTokenForm.tsx b/packages/twenty-website/src/app/components/PlaygroundTokenForm.tsx deleted file mode 100644 index b333bdf7e..000000000 --- a/packages/twenty-website/src/app/components/PlaygroundTokenForm.tsx +++ /dev/null @@ -1,190 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { TbLoader2 } from 'react-icons/tb'; -import styled from '@emotion/styled'; -import { parseJson } from 'nx/src/utils/json'; - -export type TokenFormProps = { - setOpenApiJson?: (json: object) => void; - setToken?: (token: string) => void; - isTokenValid: boolean; - setIsTokenValid: (boolean: boolean) => void; -}; - -const Container = styled.div` - display: flex; - justify-content: center; - align-items: center; - height: 90vh; -`; - -const Form = styled.form` - text-align: center; - padding: 50px; -`; - -const StyledLink = styled.a` - color: #16233f; - text-decoration: none; - position: relative; - font-weight: bold; - transition: color 0.3s ease; - - [data-theme='dark'] & { - color: #a3c0f8; - } -`; - -const Input = styled.input` - padding: 6px; - margin: 20px 0 5px 0; - max-width: 460px; - width: 100%; - box-sizing: border-box; - background-color: #f3f3f3; - border: 1px solid #ddd; - border-radius: 4px; - - [data-theme='dark'] & { - background-color: #16233f; - } - - &.invalid { - border: 1px solid #f83e3e; - } -`; - -const TokenInvalid = styled.span` - color: #f83e3e; - font-size: 12px; -`; - -const Loader = styled(TbLoader2)` - color: #16233f; - font-size: 2rem; - animation: animate 2s infinite; - - [data-theme='dark'] & { - color: #a3c0f8; - } - - &.not-visible { - visibility: hidden; - } - - @keyframes animate { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(720deg); - } - } -`; - -const LoaderContainer = styled.div` - display: flex; - justify-content: center; - align-items: center; - height: 50px; -`; - -const TokenForm = ({ - setOpenApiJson, - setToken, - isTokenValid, - setIsTokenValid, -}: TokenFormProps) => { - const [isLoading, setIsLoading] = useState(false); - const token = - parseJson(localStorage.getItem('TryIt_securitySchemeValues') || '') - ?.bearerAuth ?? ''; - - const updateToken = async (event: React.ChangeEvent) => { - localStorage.setItem( - 'TryIt_securitySchemeValues', - JSON.stringify({ bearerAuth: event.target.value }), - ); - await submitToken(event.target.value); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const validateToken = (openApiJson: any) => - setIsTokenValid(!!openApiJson.tags); - - const getJson = async (token: string) => { - setIsLoading(true); - - return await fetch('https://api.twenty.com/open-api', { - headers: { Authorization: `Bearer ${token}` }, - }) - .then((res) => res.json()) - .then((result) => { - validateToken(result); - setIsLoading(false); - - return result; - }) - .catch(() => setIsLoading(false)); - }; - - const submitToken = async (token: string) => { - if (isLoading) return; - - const json = await getJson(token); - - setToken && setToken(token); - - setOpenApiJson && setOpenApiJson(json); - }; - - useEffect(() => { - (async () => { - await submitToken(token); - })(); - }); - - // We load playground style using useEffect as it breaks remaining docs style - useEffect(() => { - const styleElement = document.createElement('style'); - styleElement.innerHTML = TokenForm.toString(); - document.head.append(styleElement); - - return () => styleElement.remove(); - }, []); - - return ( - !isTokenValid && ( - -
- -

- - - Token invalid - - - - -

-
-
- ) - ); -}; - -export default TokenForm; diff --git a/packages/twenty-website/src/app/developers/contributors/[slug]/page.tsx b/packages/twenty-website/src/app/contributors/[slug]/page.tsx similarity index 82% rename from packages/twenty-website/src/app/developers/contributors/[slug]/page.tsx rename to packages/twenty-website/src/app/contributors/[slug]/page.tsx index 5038985a1..1bcde3cbe 100644 --- a/packages/twenty-website/src/app/developers/contributors/[slug]/page.tsx +++ b/packages/twenty-website/src/app/contributors/[slug]/page.tsx @@ -2,14 +2,14 @@ export const dynamic = 'force-dynamic'; import { Metadata } from 'next'; -import { Background } from '@/app/components/oss-friends/Background'; -import { ActivityLog } from '@/app/developers/contributors/[slug]/components/ActivityLog'; -import { Breadcrumb } from '@/app/developers/contributors/[slug]/components/Breadcrumb'; -import { ContentContainer } from '@/app/developers/contributors/[slug]/components/ContentContainer'; -import { ProfileCard } from '@/app/developers/contributors/[slug]/components/ProfileCard'; -import { ProfileInfo } from '@/app/developers/contributors/[slug]/components/ProfileInfo'; -import { PullRequests } from '@/app/developers/contributors/[slug]/components/PullRequests'; -import { ThankYou } from '@/app/developers/contributors/[slug]/components/ThankYou'; +import { ActivityLog } from '@/app/_components/contributors/ActivityLog'; +import { Breadcrumb } from '@/app/_components/contributors/Breadcrumb'; +import { ContentContainer } from '@/app/_components/contributors/ContentContainer'; +import { ProfileCard } from '@/app/_components/contributors/ProfileCard'; +import { ProfileInfo } from '@/app/_components/contributors/ProfileInfo'; +import { PullRequests } from '@/app/_components/contributors/PullRequests'; +import { ThankYou } from '@/app/_components/contributors/ThankYou'; +import { Background } from '@/app/_components/oss-friends/Background'; import { findAll } from '@/database/database'; import { pullRequestModel, userModel } from '@/database/model'; diff --git a/packages/twenty-website/src/app/developers/contributors/api/generate/route.tsx b/packages/twenty-website/src/app/contributors/api/generate/route.tsx similarity index 100% rename from packages/twenty-website/src/app/developers/contributors/api/generate/route.tsx rename to packages/twenty-website/src/app/contributors/api/generate/route.tsx diff --git a/packages/twenty-website/src/app/developers/contributors/page.tsx b/packages/twenty-website/src/app/contributors/page.tsx similarity index 82% rename from packages/twenty-website/src/app/developers/contributors/page.tsx rename to packages/twenty-website/src/app/contributors/page.tsx index 8ac05392d..4d00bdf59 100644 --- a/packages/twenty-website/src/app/developers/contributors/page.tsx +++ b/packages/twenty-website/src/app/contributors/page.tsx @@ -1,9 +1,9 @@ export const dynamic = 'force-dynamic'; -import AvatarGrid from '@/app/components/AvatarGrid'; -import { Header } from '@/app/components/developers/contributors/Header'; -import { Background } from '@/app/components/oss-friends/Background'; -import { ContentContainer } from '@/app/components/oss-friends/ContentContainer'; +import AvatarGrid from '@/app/_components/contributors/AvatarGrid'; +import { Header } from '@/app/_components/contributors/Header'; +import { Background } from '@/app/_components/oss-friends/Background'; +import { ContentContainer } from '@/app/_components/oss-friends/ContentContainer'; import { findAll } from '@/database/database'; import { pullRequestModel, userModel } from '@/database/model'; diff --git a/packages/twenty-website/src/app/developers/docs/graphql/page.tsx b/packages/twenty-website/src/app/developers/docs/graphql/page.tsx deleted file mode 100644 index 35cb58f42..000000000 --- a/packages/twenty-website/src/app/developers/docs/graphql/page.tsx +++ /dev/null @@ -1,27 +0,0 @@ -'use client'; - -import { createGraphiQLFetcher } from '@graphiql/toolkit'; -import { GraphiQL } from 'graphiql'; -import dynamic from 'next/dynamic'; - -import 'graphiql/graphiql.css'; - -// Create a named function for your component -function GraphiQLComponent() { - const fetcher = createGraphiQLFetcher({ - url: 'https://api.twenty.com/graphql', - }); - - return ; -} - -// Dynamically import the GraphiQL component with SSR disabled -const GraphiQLWithNoSSR = dynamic(() => Promise.resolve(GraphiQLComponent), { - ssr: false, -}); - -const GraphQLDocs = () => { - return ; -}; - -export default GraphQLDocs; diff --git a/packages/twenty-website/src/app/developers/docs/layout.tsx b/packages/twenty-website/src/app/developers/docs/layout.tsx deleted file mode 100644 index 88c54011b..000000000 --- a/packages/twenty-website/src/app/developers/docs/layout.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { ContentContainer } from '@/app/components/ContentContainer'; - -const DeveloperDocsLayout = ({ children }: { children: React.ReactNode }) => { - return ( - -
-
-

- Install & Maintain -

- - Local setup - {' '} -
- - Self-hosting - {' '} -
- - Upgrade guide - {' '} -

-

- Resources -

- - Contributors Guide - {' '} -
- - GraphQL API - {' '} -
- - Rest API - - - Twenty UI - {' '} -
-
-
- {children} -
-
-
- ); -}; - -export default DeveloperDocsLayout; diff --git a/packages/twenty-website/src/app/developers/docs/page.tsx b/packages/twenty-website/src/app/developers/docs/page.tsx deleted file mode 100644 index 51b49eaf2..000000000 --- a/packages/twenty-website/src/app/developers/docs/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -const DeveloperDocs = () => { - return ( -
-

Developer Docs

-
- ); -}; - -export default DeveloperDocs; diff --git a/packages/twenty-website/src/app/developers/docs/rest/page.tsx b/packages/twenty-website/src/app/developers/docs/rest/page.tsx deleted file mode 100644 index cb90e5f04..000000000 --- a/packages/twenty-website/src/app/developers/docs/rest/page.tsx +++ /dev/null @@ -1,33 +0,0 @@ -'use client'; - -/*import { API } from '@stoplight/elements';/ - -import '@stoplight/elements/styles.min.css'; - -/* -const RestApiComponent = ({ openApiJson }: { openApiJson: any }) => { - // We load spotlightTheme style using useEffect as it breaks remaining docs style - useEffect(() => { - const styleElement = document.createElement('style'); - // styleElement.innerHTML = spotlightTheme.toString(); - document.head.append(styleElement); - - return () => styleElement.remove(); - }, []); - - return ( - - ); -};*/ - -const RestApi = () => { - /* const [openApiJson, setOpenApiJson] = useState({}); - - const children = ;*/ - - return <>API; - - // return {children}; -}; - -export default RestApi; diff --git a/packages/twenty-website/src/app/developers/page.tsx b/packages/twenty-website/src/app/developers/page.tsx deleted file mode 100644 index 81c5803ee..000000000 --- a/packages/twenty-website/src/app/developers/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -const Developers = () => { - return ( -
-

This page should probably be built on Framer

-
- ); -}; - -export default Developers; diff --git a/packages/twenty-website/src/app/layout.css b/packages/twenty-website/src/app/layout.css index 49c2040c4..1e7c318ab 100644 --- a/packages/twenty-website/src/app/layout.css +++ b/packages/twenty-website/src/app/layout.css @@ -10,6 +10,7 @@ body { padding: 0; margin: 0; word-wrap: break-word; + font-family: var(--font-gabarito); } .container { diff --git a/packages/twenty-website/src/app/layout.tsx b/packages/twenty-website/src/app/layout.tsx index 68ae29871..f98e00ebf 100644 --- a/packages/twenty-website/src/app/layout.tsx +++ b/packages/twenty-website/src/app/layout.tsx @@ -1,10 +1,10 @@ import { Metadata } from 'next'; import { Gabarito, Inter } from 'next/font/google'; -import { HeaderMobile } from '@/app/components/HeaderMobile'; +import { HeaderMobile } from '@/app/_components/ui/layout/HeaderMobile'; -import { FooterDesktop } from './components/FooterDesktop'; -import { HeaderDesktop } from './components/HeaderDesktop'; +import { FooterDesktop } from './_components/ui/layout/FooterDesktop'; +import { HeaderDesktop } from './_components/ui/layout/HeaderDesktop'; import EmotionRootStyleRegistry from './emotion-root-style-registry'; import './layout.css'; @@ -37,7 +37,7 @@ export default function RootLayout({ children: React.ReactNode; }) { return ( - + diff --git a/packages/twenty-website/src/app/oss-friends/page.tsx b/packages/twenty-website/src/app/oss-friends/page.tsx index c64bc3f77..9b2f9b453 100644 --- a/packages/twenty-website/src/app/oss-friends/page.tsx +++ b/packages/twenty-website/src/app/oss-friends/page.tsx @@ -1,8 +1,8 @@ -import { Background } from '@/app/components/oss-friends/Background'; -import { Card, OssData } from '@/app/components/oss-friends/Card'; -import { CardContainer } from '@/app/components/oss-friends/CardContainer'; -import { ContentContainer } from '@/app/components/oss-friends/ContentContainer'; -import { Header } from '@/app/components/oss-friends/Header'; +import { Background } from '@/app/_components/oss-friends/Background'; +import { Card, OssData } from '@/app/_components/oss-friends/Card'; +import { CardContainer } from '@/app/_components/oss-friends/CardContainer'; +import { ContentContainer } from '@/app/_components/oss-friends/ContentContainer'; +import { Header } from '@/app/_components/oss-friends/Header'; export default async function OssFriends() { const ossList = await fetch('https://formbricks.com/api/oss-friends'); diff --git a/packages/twenty-website/src/app/page.tsx b/packages/twenty-website/src/app/page.tsx index 5ceda6443..1701230ca 100644 --- a/packages/twenty-website/src/app/page.tsx +++ b/packages/twenty-website/src/app/page.tsx @@ -1,4 +1,4 @@ -import { ContentContainer } from './components/ContentContainer'; +import { ContentContainer } from './_components/ui/layout/ContentContainer'; export default function Home() { return ( diff --git a/packages/twenty-website/src/app/releases/page.tsx b/packages/twenty-website/src/app/releases/page.tsx deleted file mode 100644 index 1d11170b1..000000000 --- a/packages/twenty-website/src/app/releases/page.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { Metadata } from 'next'; -import { compileMDX } from 'next-mdx-remote/rsc'; -import remarkBehead from 'remark-behead'; -import gfm from 'remark-gfm'; - -import { ContentContainer } from '../components/ContentContainer'; - -interface Release { - id: number; - name: string; - body: string; -} - -export const metadata: Metadata = { - title: 'Twenty - Releases', - description: 'Latest releases of Twenty', -}; - -const Home = async () => { - const response = await fetch( - 'https://api.github.com/repos/twentyhq/twenty/releases', - ); - const data: Release[] = await response.json(); - - const releases = await Promise.all( - data.map(async (release) => { - let mdxSource; - try { - mdxSource = await compileMDX({ - source: release.body, - options: { - mdxOptions: { - remarkPlugins: [gfm, [remarkBehead, { depth: 2 }]], - }, - }, - }); - mdxSource = mdxSource.content; - } catch (error) { - console.error('An error occurred during MDX rendering:', error); - mdxSource = `

Oops! Something went wrong.

${error}`; - } - - return { - id: release.id, - name: release.name, - body: mdxSource, - }; - }), - ); - - return ( - -

Releases

- - {releases.map((release, index) => ( -
-

{release.name}

-
{release.body}
-
- ))} -
- ); -}; - -export default Home; diff --git a/packages/twenty-website/src/app/ui/theme/theme.ts b/packages/twenty-website/src/app/ui/theme/theme.ts deleted file mode 100644 index fa4fb9a60..000000000 --- a/packages/twenty-website/src/app/ui/theme/theme.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Background } from '@/app/ui/theme/background'; -import { Border } from '@/app/ui/theme/border'; -import { Color } from '@/app/ui/theme/colors'; -import { Font } from '@/app/ui/theme/font'; -import { Icon } from '@/app/ui/theme/icon'; -import { Text } from '@/app/ui/theme/text'; - -export const Theme = { - color: Color, - border: Border, - background: Background, - text: Text, - spacingMultiplicator: 4, - icon: Icon, - font: Font, - spacing: (...args: number[]) => - args.map((multiplicator) => `${multiplicator * 4}px`).join(' '), -}; diff --git a/packages/twenty-website/src/app/user-guide/[slug]/page.tsx b/packages/twenty-website/src/app/user-guide/[slug]/page.tsx index b796d56db..b2ae85b98 100644 --- a/packages/twenty-website/src/app/user-guide/[slug]/page.tsx +++ b/packages/twenty-website/src/app/user-guide/[slug]/page.tsx @@ -1,5 +1,5 @@ -import UserGuideContent from '@/app/components/user-guide/UserGuideContent'; -import { getPost } from '@/app/get-posts'; +import UserGuideContent from '@/app/_components/user-guide/UserGuideContent'; +import { getPost } from '@/app/_server-utils/get-posts'; export default async function UserGuideSlug({ params, diff --git a/packages/twenty-website/src/app/user-guide/layout.tsx b/packages/twenty-website/src/app/user-guide/layout.tsx index 1e799e7e7..c49fd5bb3 100644 --- a/packages/twenty-website/src/app/user-guide/layout.tsx +++ b/packages/twenty-website/src/app/user-guide/layout.tsx @@ -3,10 +3,13 @@ import { ReactNode } from 'react'; import styled from '@emotion/styled'; import { usePathname } from 'next/navigation'; -import UserGuideSidebar from '@/app/components/user-guide/UserGuideSidebar'; -import UserGuideTableContents from '@/app/components/user-guide/UserGuideTableContents'; -import { Theme } from '@/app/ui/theme/theme'; -import { DeviceType, useDeviceType } from '@/app/ui/utilities/useDeviceType'; +import { + DeviceType, + useDeviceType, +} from '@/app/_components/client-utils/useDeviceType'; +import { Theme } from '@/app/_components/ui/theme/theme'; +import UserGuideSidebar from '@/app/_components/user-guide/UserGuideSidebar'; +import UserGuideTableContents from '@/app/_components/user-guide/UserGuideTableContents'; const StyledContainer = styled.div` width: 100%; diff --git a/packages/twenty-website/src/app/user-guide/page.tsx b/packages/twenty-website/src/app/user-guide/page.tsx index 5e4a71120..8b28fc394 100644 --- a/packages/twenty-website/src/app/user-guide/page.tsx +++ b/packages/twenty-website/src/app/user-guide/page.tsx @@ -1,4 +1,4 @@ -import UserGuideMain from '@/app/components/user-guide/UserGuideMain'; +import UserGuideMain from '@/app/_components/user-guide/UserGuideMain'; export default async function UserGuideHome() { return ; diff --git a/packages/twenty-website/src/app/user-guide/constants/UserGuideHomeCards.ts b/packages/twenty-website/src/content/user-guide/constants/UserGuideHomeCards.ts similarity index 100% rename from packages/twenty-website/src/app/user-guide/constants/UserGuideHomeCards.ts rename to packages/twenty-website/src/content/user-guide/constants/UserGuideHomeCards.ts diff --git a/packages/twenty-website/src/app/user-guide/constants/UserGuideIndex.ts b/packages/twenty-website/src/content/user-guide/constants/UserGuideIndex.ts similarity index 100% rename from packages/twenty-website/src/app/user-guide/constants/UserGuideIndex.ts rename to packages/twenty-website/src/content/user-guide/constants/UserGuideIndex.ts diff --git a/packages/twenty-website/src/lib/utils.ts b/packages/twenty-website/src/shared-utils/formatIntoRelativeDate.ts similarity index 100% rename from packages/twenty-website/src/lib/utils.ts rename to packages/twenty-website/src/shared-utils/formatIntoRelativeDate.ts