-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2867 from ever-co/stage
Release
- Loading branch information
Showing
40 changed files
with
1,272 additions
and
382 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
"use client" | ||
import { useOrganizationTeams } from '@app/hooks'; | ||
import { fullWidthState } from '@app/stores/fullWidth'; | ||
import { clsxm } from '@app/utils'; | ||
import HeaderTabs from '@components/pages/main/header-tabs'; | ||
import { PeoplesIcon } from 'assets/svg'; | ||
import { withAuthentication } from 'lib/app/authenticator'; | ||
import { Breadcrumb, Button, Container, Divider } from 'lib/components'; | ||
import { SetupFullCalendar } from 'lib/features' | ||
import { Footer, MainLayout } from 'lib/layout'; | ||
import { useTranslations } from 'next-intl'; | ||
import { useParams } from 'next/navigation'; | ||
import React, { useMemo } from 'react' | ||
import { useRecoilValue } from 'recoil'; | ||
import { LuCalendarDays } from "react-icons/lu"; | ||
|
||
|
||
const CalendarPage = () => { | ||
const t = useTranslations(); | ||
const fullWidth = useRecoilValue(fullWidthState); | ||
const { activeTeam, isTrackingEnabled } = useOrganizationTeams(); | ||
const params = useParams<{ locale: string }>(); | ||
const currentLocale = params ? params.locale : null; | ||
const breadcrumbPath = useMemo( | ||
() => [ | ||
{ title: JSON.parse(t('pages.home.BREADCRUMB')), href: '/' }, | ||
{ title: activeTeam?.name || '', href: '/' }, | ||
{ title: "CALENDAR", href: `/${currentLocale}/calendar` } | ||
], | ||
[activeTeam?.name, currentLocale, t] | ||
); | ||
return ( | ||
<> | ||
<MainLayout | ||
showTimer={isTrackingEnabled} | ||
footerClassName="hidden" | ||
// footerClassName={clsxm("fixed flex flex-col items-end justify-center bottom-0 z-50 bg-white dark:bg-dark-high",!fullWidth && 'left-0 right-0')} | ||
className="h-[calc(100vh-_22px)]" | ||
> | ||
<div className="h-[263.4px] z-10 bg-white dark:bg-dark-high fixed w-full"></div> | ||
<div | ||
className={ | ||
'fixed top-20 flex flex-col border-b-[1px] dark:border-[#26272C] z-10 mx-[0px] w-full bg-white dark:bg-dark-high' | ||
} | ||
> | ||
<Container fullWidth={fullWidth}> | ||
<div className="flex bg-white dark:bg-dark-high flex-row items-start justify-between mt-12"> | ||
<div className="flex justify-center items-center gap-8 h-10"> | ||
<PeoplesIcon className="text-dark dark:text-[#6b7280] h-6 w-6" /> | ||
<Breadcrumb paths={breadcrumbPath} className="text-sm" /> | ||
</div> | ||
<div className="flex h-10 w-max items-center justify-center gap-1"> | ||
<HeaderTabs kanban={true} linkAll={true} /> | ||
</div> | ||
</div> | ||
<div className="flex justify-between items-center mt-10 bg-white dark:bg-dark-high py-2"> | ||
<h1 className="text-4xl font-semibold "> | ||
CALENDAR | ||
</h1> | ||
<div className='flex items-center space-x-3'> | ||
<button | ||
className=' hover:!bg-gray-100 text-xl h-10 w-10 rounded-lg flex items-center justify-center'> | ||
<LuCalendarDays /> | ||
</button> | ||
<button | ||
className='bg-gray-100 text-xl !h-10 !w-10 rounded-lg flex items-center justify-center'> | ||
<LuCalendarDays /> | ||
</button> | ||
<Button | ||
variant='primary' | ||
className='bg-primary dark:!bg-primary-light' | ||
>Add Manuel Time | ||
</Button> | ||
</div> | ||
</div> | ||
</Container> | ||
</div> | ||
<div className='mt-[256px] mb-24 '> | ||
<SetupFullCalendar /> | ||
</div> | ||
</MainLayout> | ||
<div className="bg-white dark:bg-[#1e2025] w-screen z-[5000] fixed bottom-0"> | ||
<Divider /> | ||
<Footer | ||
className={clsxm(' justify-between w-full px-0 mx-auto', fullWidth ? 'px-8' : 'x-container')} | ||
/> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default withAuthentication(CalendarPage, { displayName: 'Calender' }); |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use client'; | ||
|
||
import { usePathname, useSearchParams } from 'next/navigation'; | ||
import { useEffect } from 'react'; | ||
import { usePostHog } from 'posthog-js/react'; | ||
import { POSTHOG_HOST, POSTHOG_KEY } from '@app/constants'; | ||
|
||
export default function PostHogPageView(): null { | ||
const pathname = usePathname(); | ||
const searchParams = useSearchParams(); | ||
const posthog = usePostHog(); | ||
|
||
useEffect(() => { | ||
if (!POSTHOG_KEY.value || !POSTHOG_HOST.value) return; | ||
|
||
// Track pageviews | ||
if (pathname && posthog) { | ||
let url = window.origin + pathname; | ||
if (searchParams.toString()) { | ||
url = url + `?${searchParams.toString()}`; | ||
} | ||
posthog.capture('$pageview', { | ||
$current_url: url | ||
}); | ||
} | ||
}, [pathname, searchParams, posthog]); | ||
|
||
return null; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use client'; | ||
|
||
import { POSTHOG_HOST, POSTHOG_KEY } from '@app/constants'; | ||
import posthog from 'posthog-js'; | ||
import { PostHogProvider } from 'posthog-js/react'; | ||
|
||
const key = POSTHOG_KEY.value; | ||
const host = POSTHOG_HOST.value; | ||
|
||
if (typeof window !== 'undefined' && key && host) { | ||
posthog.init(key, { | ||
api_host: host, | ||
person_profiles: 'identified_only', | ||
capture_pageview: false, | ||
capture_pageleave: true | ||
}); | ||
} | ||
|
||
export function PHProvider({ children }: { children: React.ReactNode }) { | ||
if (!key || !host) { | ||
return <>{children}</>; | ||
} | ||
|
||
return <PostHogProvider client={posthog}>{children}</PostHogProvider>; | ||
} |
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
Oops, something went wrong.