Skip to content

Commit

Permalink
Merge pull request #2958 from ever-co/develop
Browse files Browse the repository at this point in the history
Stage
  • Loading branch information
evereq authored Aug 27, 2024
2 parents cadc699 + 1e30f3c commit 31a4eaf
Show file tree
Hide file tree
Showing 31 changed files with 1,021 additions and 486 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"Bowser",
"Btns",
"Konviser",
"Ruslan",
"Bugsnag",
"buildjet",
"cacheable",
Expand Down
7 changes: 7 additions & 0 deletions apps/web/.env
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ APP_NAME="Ever Teams"
APP_SIGNATURE="Ever Teams"
APP_LOGO_URL="https://app.ever.team/assets/ever-teams.png"


#Footer links
NEXT_PUBLIC_EVER_TEAMS_LINK="https://ever.team"
NEXT_PUBLIC_EVER_PLATFORM_LINK="https://ever.co"
NEXT_PUBLIC_EVER_LEGAL_TERM="https://demo.gauzy.co/#/pages/legal/terms"
NEXT_PUBLIC_EVER_LEGAL_PRIVACY="https://demo.gauzy.co/#/pages/legal/privacy"

# Cookies
NEXT_PUBLIC_COOKIE_DOMAINS=ever.team

Expand Down
6 changes: 6 additions & 0 deletions apps/web/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ APP_NAME='Ever Teams'
APP_SIGNATURE='Ever Teams'
APP_LOGO_URL='https://app.ever.team/assets/ever-teams.png'

#Footer links
NEXT_PUBLIC_EVER_TEAMS_LINK="https://ever.team"
NEXT_PUBLIC_EVER_PLATFORM_LINK="https://ever.co"
NEXT_PUBLIC_EVER_LEGAL_TERM="https://demo.gauzy.co/#/pages/legal/terms"
NEXT_PUBLIC_EVER_LEGAL_PRIVACY="https://demo.gauzy.co/#/pages/legal/privacy"

# Cookies
NEXT_PUBLIC_COOKIE_DOMAINS=ever.team

Expand Down
103 changes: 57 additions & 46 deletions apps/web/app/[locale]/calendar/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CalendarDays } from "lucide-react";
import React from "react";
import { DateRange } from "react-day-picker";
import { LuCalendarDays } from "react-icons/lu";
import { Input } from "@components/ui/input";

export function HeadCalendar({
openModal,
Expand Down Expand Up @@ -65,54 +66,65 @@ export function HeadTimeSheet({ timesheet }: { timesheet?: timesheetCalendar })
from: new Date(2022, 0, 20),
to: addDays(new Date(2022, 0, 20), 20)
});
console.log(timesheet);
return (
<div>
<div className='flex items-center justify-between w-full dark:!bg-dark--theme h-28'>
{timesheet === 'TimeSheet' && (
<div className='flex items-center space-x-5 dark:!bg-dark--theme '>
<div>
<CustomSelect />
</div>
<DatePicker
buttonVariant={'link'}
className="dark:bg-dark--theme-light rounded-lg"
buttonClassName={'decoration-transparent flex items-center w-full border-gray-300 justify-start text-left font-normal text-black h-10 border dark:border-slate-600 rounded-md"'}
customInput={
<>
<CalendarDays className="h-5 w-5 dark:text-gray-500" />
<Button
variant={"outline"}
className={cn(
"w-[230px] justify-start text-left font-normal text-black h-10 border border-transparent dark:border-transparent",
!date && "text-muted-foreground"
)}>
{date?.from ? (
date.to ? (
<>
{format(date.from, "LLL dd, y")} -{" "}
{format(date.to, "LLL dd, y")}
</>
) : (
format(date.from, "LLL dd, y")
)
) : (
<span>Pick a date</span>
)}
</Button>
</>
}
mode={'range'}
numberOfMonths={2}
initialFocus
defaultMonth={date?.from}
selected={date}
onSelect={(value) => {
value && setDate(value);
}}
<div className="flex justify-between items-center w-full p-2 gap-x-3">
<Input
className="border w-1/4 dark:border-gray-700"
placeholder="Filter time logs"
required
value=""
name="filter"
/>
<div>
<TimeSheetFilter />

<div className='flex items-center justify-end space-x-5 dark:!bg-dark--theme w-full p-2 '>
<div>
<CustomSelect />
</div>
<div className="">
<DatePicker
buttonVariant={'link'}
className="dark:bg-dark--theme-light rounded-lg"
buttonClassName={'decoration-transparent flex items-center w-full bg-white dark:bg-dark--theme-light border-gray-300 justify-start text-left font-normal text-black h-10 border dark:border-slate-600 rounded-md"'}
customInput={
<>
<CalendarDays className="h-5 w-5 dark:text-gray-500" />
<Button
variant={"outline"}
className={cn(
"w-[260px] justify-start text-left font-normal text-black h-10 border border-transparent dark:border-transparent ",
!date && "text-muted-foreground"
)}>
{date?.from ? (
date.to ? (
<>
{format(date.from, "LLL dd, y")} -{" "}
{format(date.to, "LLL dd, y")}
</>
) : (
format(date.from, "LLL dd, y")
)
) : (
<span>Pick a date</span>
)}
</Button>
</>
}
mode={'range'}
numberOfMonths={2}
initialFocus
defaultMonth={date?.from}
selected={date}
onSelect={(value) => {
value && setDate(value);
}}
/>
</div>
<div>
<TimeSheetFilter />
</div>
</div>
</div>
)}
Expand All @@ -133,9 +145,8 @@ export function CustomSelect() {
return (
<Select
value={selectedValue}
onValueChange={handleSelectChange}
>
<SelectTrigger className="w-[180px] border border-gray-200 dark:border-gray-700 bg-transparent">
onValueChange={handleSelectChange}>
<SelectTrigger className="w-[180px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-dark--theme-light">
<SelectValue placeholder="Select a daily" />
</SelectTrigger>
<SelectContent>
Expand Down
19 changes: 8 additions & 11 deletions apps/web/app/[locale]/calendar/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useTranslations } from 'next-intl';
import { useParams } from 'next/navigation';
import React, { useMemo } from 'react';
import { useRecoilValue } from 'recoil';
import { HeadCalendar, HeadTimeSheet } from './component';
import { HeadCalendar } from './component';
import { AddManualTimeModal } from 'lib/features/manual-time/add-manual-time-modal';
import { SetupTimeSheet, timesheetCalendar } from 'lib/features/integrations/calendar';

Expand Down Expand Up @@ -44,7 +44,7 @@ const CalendarPage = () => {
case 'Calendar':
return <SetupFullCalendar />;
case 'TimeSheet':
return <SetupTimeSheet />;
return <SetupTimeSheet timesheet={calendarTimeSheet} />
default:
return null;
}
Expand All @@ -55,17 +55,15 @@ const CalendarPage = () => {
<MainLayout
showTimer={isTrackingEnabled}
footerClassName="hidden"
className="h-[calc(100vh-22px)] shadow-xl"
className="h-full shadow-xl"
>
<AddManualTimeModal
closeModal={closeManualTimeModal}
isOpen={isManualTimeModalOpen}
params='AddManuelTime'
/>


<div
className='fixed top-20 flex flex-col border-b-[1px] dark:border-[#26272C] z-10 mx-0 w-full bg-white dark:bg-dark-high shadow-lg shadow-gray-100 dark:shadow-gray-700 '
className='fixed top-20 flex flex-col border-b-[1px] dark:border-gray-800 z-10 mx-0 w-full bg-white dark:bg-dark-high shadow-lg shadow-gray-100 dark:shadow-gray-700 '
>
<Container fullWidth={fullWidth}>
<div className="flex bg-white dark:bg-dark-high flex-row items-start justify-between mt-12">
Expand All @@ -81,15 +79,14 @@ const CalendarPage = () => {
<HeadCalendar
openModal={openManualTimeModal}
timesheet={calendarTimeSheet}
setCalendarTimeSheet={setCalendarTimeSheet} />
<div className='border border-gray-100 dark:border-gray-700 w-full'></div>
<HeadTimeSheet timesheet={calendarTimeSheet} />
setCalendarTimeSheet={setCalendarTimeSheet}

/>
<div className='border border-gray-100 dark:border-gray-800 w-full'></div>
</div>
</Container>
</div>

<div className='mt-[325px] mb-40'>
<div className='mt-[15vh] mb-32'>
<Container fullWidth={fullWidth}>
{renderComponent()}
</Container>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { useTimer } from '@app/hooks';
import { ITimerStatusEnum, OT_Member } from '@app/interfaces';
import { isValidUrl } from '@app/utils';
import { getTimerStatusValue, TimerStatus } from 'lib/features';
import { cn } from 'lib/utils';
import { useMemo } from 'react';
import stc from 'string-to-color';
import { Avatar, Text } from 'lib/components';
import { imgTitle } from '@app/helpers';
import { TableActionPopover } from 'lib/settings/table-action-popover';

export function UserProfileDetail({ member }: { member?: OT_Member }) {
const user = useMemo(() => member?.employee.user, [member?.employee.user]);

const userName = `${user?.firstName || ''} ${user?.lastName || ''}`;
const imgUrl = user?.image?.thumbUrl || user?.image?.fullUrl || user?.imageUrl;
const imageUrl = useMemo(() => imgUrl, [imgUrl]);
const size = 100;
const { timerStatus } = useTimer();
// const isManager = activeTeamManagers.find((member) => member.employee.user?.id === member?.employee.user?.id);
const timerStatusValue: ITimerStatusEnum = useMemo(() => {
return getTimerStatusValue(timerStatus, member, false);
}, [timerStatus, member]);
return (
<div className="flex items-center mb-4 space-x-4 md:mb-0">
<div
className={cn(
`w-[100px] h-[100px]`, // removed the size variable from width and height, as passing variables is not supported by tailwind
'flex justify-center items-center relative',
'rounded-full text-white',
'shadow-md text-7xl dark:text-6xl font-thin font-PlusJakartaSans ',
!imageUrl && 'dark:border-[0.375rem] dark:border-[#26272C]'
)}
style={{
backgroundColor: `${stc(userName)}80`
}}
>
{imageUrl && isValidUrl(imageUrl) ? (
<Avatar
size={size}
className="relative dark:border-[0.375rem] dark:border-[#26272C]"
imageUrl={imageUrl}
alt={userName}
imageTitle={userName.charAt(0)}
>
<TimerStatus
status={timerStatusValue}
className="absolute z-20 bottom-3 right-[10%] -mb-5 border-[0.2956rem] border-white dark:border-[#26272C]"
tooltipClassName="mt-24 dark:mt-20 mr-3"
/>
</Avatar>
) : (
<>
{imgTitle(userName).charAt(0)}

<TimerStatus
status={timerStatusValue}
className="absolute z-20 border-[0.2956rem] border-white dark:border-[#26272C]"
tooltipClassName="absolute -bottom-[0.625rem] dark:-bottom-[0.75rem] right-[10%] w-[1.875rem] h-[1.875rem] rounded-full"
/>
</>
)}
</div>
<div className="flex flex-col gap-3.5 w-full">
<div className="flex items-center gap-x-4">
<Text.Heading as="h3" className="text-2xl md:text-4xl">
{user?.firstName} {user?.lastName}
</Text.Heading>
<div className="h-8 w-8">
<TableActionPopover member={member!} status="profile" />
</div>
</div>
<Text className="text-lg text-gray-500">{user?.email}</Text>
</div>
</div>
);
}
Loading

0 comments on commit 31a4eaf

Please sign in to comment.