diff --git a/apps/frontend/src/components/layout/layout.settings.tsx b/apps/frontend/src/components/layout/layout.settings.tsx deleted file mode 100644 index a2a3c814..00000000 --- a/apps/frontend/src/components/layout/layout.settings.tsx +++ /dev/null @@ -1,256 +0,0 @@ -'use client'; - -import { ReactNode, useCallback, useEffect } from 'react'; -import { Title } from '@gitroom/frontend/components/layout/title'; -import { ContextWrapper } from '@gitroom/frontend/components/layout/user.context'; -import { TopMenu } from '@gitroom/frontend/components/layout/top.menu'; -import { MantineWrapper } from '@gitroom/react/helpers/mantine.wrapper'; -import { ToolTip } from '@gitroom/frontend/components/layout/top.tip'; -import { ShowMediaBoxModal } from '@gitroom/frontend/components/media/media.component'; -import Image from 'next/image'; -import { Toaster, useToaster } from '@gitroom/react/toaster/toaster'; -import { ShowPostSelector } from '@gitroom/frontend/components/post-url-selector/post.url.selector'; -import { OrganizationSelector } from '@gitroom/frontend/components/layout/organization.selector'; -import NotificationComponent from '@gitroom/frontend/components/notifications/notification.component'; -import Link from 'next/link'; -import useSWR from 'swr'; -import { useFetch } from '@gitroom/helpers/utils/custom.fetch'; -import utc from 'dayjs/plugin/utc'; -import weekOfYear from 'dayjs/plugin/weekOfYear'; -import isoWeek from 'dayjs/plugin/isoWeek'; -import isBetween from 'dayjs/plugin/isBetween'; -import { ShowLinkedinCompany } from '@gitroom/frontend/components/launches/helpers/linkedin.component'; -import { SettingsComponent } from '@gitroom/frontend/components/layout/settings.component'; -import { Onboarding } from '@gitroom/frontend/components/onboarding/onboarding'; -import { Support } from '@gitroom/frontend/components/layout/support'; -import { ContinueProvider } from '@gitroom/frontend/components/layout/continue.provider'; -import { CopilotKit } from '@copilotkit/react-core'; -import { Impersonate } from '@gitroom/frontend/components/layout/impersonate'; -import clsx from 'clsx'; -import { BillingComponent } from '@gitroom/frontend/components/billing/billing.component'; -import dynamic from 'next/dynamic'; -import { NewSubscription } from '@gitroom/frontend/components/layout/new.subscription'; -import { useVariables } from '@gitroom/react/helpers/variable.context'; -const ModeComponent = dynamic( - () => import('@gitroom/frontend/components/layout/mode.component'), - { - ssr: false, - } -); -import { extend } from 'dayjs'; -import { useSearchParams } from 'next/navigation'; -import { CheckPayment } from '@gitroom/frontend/components/layout/check.payment'; -import { ChromeExtensionComponent } from '@gitroom/frontend/components/layout/chrome.extension.component'; -import { LanguageComponent } from '@gitroom/frontend/components/layout/language.component'; -import { useT } from '@gitroom/react/translation/get.transation.service.client'; -import i18next from '@gitroom/react/translation/i18next'; -import { MediaSettingsLayout } from '@gitroom/frontend/components/launches/helpers/media.settings.component'; -extend(utc); -extend(weekOfYear); -extend(isoWeek); -extend(isBetween); -export const LayoutSettings = ({ children }: { children: ReactNode }) => { - const fetch = useFetch(); - const t = useT(); - - const { isGeneral } = useVariables(); - const { backendUrl, billingEnabled } = useVariables(); - const searchParams = useSearchParams(); - const load = useCallback(async (path: string) => { - return await (await fetch(path)).json(); - }, []); - const { data: user, mutate } = useSWR('/user/self', load, { - revalidateOnFocus: false, - revalidateOnReconnect: false, - revalidateIfStale: false, - refreshWhenOffline: false, - refreshWhenHidden: false, - }); - if (!user) return null; - return ( - - - - {user.tier === 'FREE' && searchParams.get('check') && ( - - )} - - - - - - - - - -
- {user?.admin && } - -
-
- {user.tier === 'FREE' && isGeneral && billingEnabled ? ( - <> -
-

- {t( - 'join_10000_entrepreneurs_who_use_postiz', - 'Join 10,000+ Entrepreneurs Who Use Postiz' - )} -
- {t( - 'to_manage_all_your_social_media_channels', - 'To Manage All Your Social Media Channels' - )} -

-
- {user?.allowTrial && ( -
-
-
- - - -
-
- {t('100_no_risk_trial', '100% no-risk trial')} -
-
-
-
- - - -
-
- {t( - 'pay_nothing_for_the_first_7_days', - 'Pay nothing for the first 7 days' - )} -
-
-
-
- - - -
-
- {t( - 'cancel_anytime_hassle_free', - 'Cancel anytime, hassle-free' - )} -
-
-
- )} -
- - - ) : ( - <> - - <div className="flex flex-1 flex-col">{children}</div> - </> - )} - </div> - </div> - </div> - </MantineWrapper> - </CopilotKit> - </ContextWrapper> - ); -};