Skip to content

Commit

Permalink
Merge pull request #1993 from ever-co/develop
Browse files Browse the repository at this point in the history
Update/view mode icon (#1992)
  • Loading branch information
evereq authored Dec 12, 2023
2 parents c3203ec + aa49461 commit 3d823d1
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apps/web/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ export const APPLICATION_LANGUAGES_CODE = [
export enum IssuesView {
CARDS = 'CARDS',
TABLE = 'TABLE',
BLOCKS = 'BLOCKS'
BLOCKS = 'BLOCKS',
KANBAN = 'KANBAN'
}

export const TaskStatus = {
Expand Down
9 changes: 9 additions & 0 deletions apps/web/components/ui/svgs/kanaban.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function KanbanIcon({
className
}: {
className?: string
}) {
return (
<svg className={className} xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path fill="currentColor" d="M0 1h7V0H0zm8 0h7V0H8zM.5 3a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5zm8 0a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5z"/></svg>
)
}
2 changes: 1 addition & 1 deletion apps/web/lib/components/Kanban.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function InnerItemList({items, title}: {
}) {
return (
<>
<section className="flex flex-col gap-2.5 max-h-[520px] overflow-scroll ">
<section className="flex flex-col gap-2.5 max-h-[520px] overflow-y-scroll overflow-x-hidden">
{items.map((item: ITeamTask, index: number) => (
<Draggable key={item.id} draggableId={item.id} index={index}>
{(dragProvided: DraggableProvided, dragSnapshot: DraggableStateSnapshot) => (
Expand Down
26 changes: 21 additions & 5 deletions apps/web/lib/components/kanban-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { DraggableProvided } from "react-beautiful-dnd";
import CircularProgress from "@components/ui/svgs/circular-progress";
import PriorityIcon from "@components/ui/svgs/priority-icon";
import { Tag } from "@app/interfaces";
import { useTimer } from "@app/hooks";
import { pad } from "@app/helpers";
import { TaskStatus } from "@app/constants";

function getStyle(provided: DraggableProvided, style: any) {
if (!style) {
Expand Down Expand Up @@ -134,6 +137,10 @@ export default function Item(props: any) {
isClone,
index,
} = props;

const {
fomatedTimeCounter: { hours, minutes, seconds }
} = useTimer();

return (
<section
Expand Down Expand Up @@ -173,12 +180,21 @@ export default function Item(props: any) {
</div>
</div>
<div className="flex flex-row justify-between items-center pt-4">
<div className="flex flex-row items-center gap-2">
<small className="text-grey text-xs text-normal">Worked:</small>
<p className="text-black dark:text-white font-medium text-sm">0 h 0 m </p>
</div>

{item.status === TaskStatus.INPROGRESS ? (
<div className="flex flex-row items-center gap-2">
<small className="text-grey text-xs text-normal">Live:</small>
<p className="text-[#219653] font-medium text-sm">{pad(hours)}:{pad(minutes)}:{pad(seconds)} </p>
</div>
): (
<div className="flex flex-row items-center gap-2">
<small className="text-grey text-xs text-normal">Worked:</small>
<p className="text-black dark:text-white font-medium text-sm">{pad(hours)}:{pad(minutes)}:{pad(seconds)} </p>
</div>
)}

<div className="relative">
<div className="w-10 flex flex-row justify-end items-center relative bg-primary">
<div className="w-10 flex h-fit flex-row justify-end items-center relative bg-primary">
{item.members.map((option: any, index: number)=> {
return (
<Image
Expand Down
38 changes: 37 additions & 1 deletion apps/web/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useOrganizationTeams } from '@app/hooks';
import { clsxm } from '@app/utils';
import NoTeam from '@components/pages/main/no-team';
import { withAuthentication } from 'lib/app/authenticator';
import { Breadcrumb, Card, Container } from 'lib/components';
import { Breadcrumb, Card, Container, Tooltip } from 'lib/components';
import { PeopleIcon } from 'lib/components/svgs';
import {
AuthUserTaskInput,
Expand All @@ -19,6 +19,8 @@ import { useState } from 'react';
import { IssuesView } from '@app/constants';
import { TableCellsIcon, QueueListIcon, Squares2X2Icon } from '@heroicons/react/24/solid';
import { useNetworkState } from '@uidotdev/usehooks';
import { useRouter } from 'next/router';
import KanbanIcon from '@components/ui/svgs/kanaban';
import Offline from '@components/pages/offline';
import UserTeamTableHeader from 'lib/features/team/user-team-table/user-team-table-header';

Expand All @@ -28,6 +30,7 @@ function MainPage() {
const breadcrumb = [...(t('pages.home.BREADCRUMB', { returnObjects: true }) as any), activeTeam?.name || ''];
const [view, setView] = useState<IssuesView>(IssuesView.CARDS);
const { online } = useNetworkState();
const router = useRouter();

if (!online) {
return <Offline />;
Expand All @@ -44,6 +47,10 @@ function MainPage() {

{/* <Collaborative /> */}
<div className="flex items-end gap-1">
<Tooltip
label={'Cards'}
placement="top-start"
>
<button
className={clsxm(
'rounded-md px-3 py-1 text-sm font-medium',
Expand All @@ -55,6 +62,11 @@ function MainPage() {
>
<QueueListIcon className="w-5 h-5 inline" />
</button>
</Tooltip>
<Tooltip
label={'Table'}
placement="top-start"
>
<button
className={clsxm(
'rounded-md px-3 py-1 text-sm font-medium',
Expand All @@ -66,6 +78,11 @@ function MainPage() {
>
<TableCellsIcon className="w-5 h-5 inline" />
</button>
</Tooltip>
<Tooltip
label={'Blocks'}
placement="top-start"
>
<button
className={clsxm(
'rounded-md px-3 py-1 text-sm font-medium',
Expand All @@ -77,6 +94,25 @@ function MainPage() {
>
<Squares2X2Icon className="w-5 h-5 inline" />
</button>
</Tooltip>
<Tooltip
label={'Kanban'}
placement="top-start"
>
<button
className={clsxm(
'rounded-md px-3 py-1 text-sm font-medium',
view === IssuesView.KANBAN
? 'bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-gray-100'
: 'text-gray-700 dark:text-gray-300'
)}
onClick={() => {
router.push('/kanban');
}}
>
<KanbanIcon />
</button>
</Tooltip>
</div>
</div>

Expand Down

0 comments on commit 3d823d1

Please sign in to comment.