This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Add, Setting2 } from "iconsax-react";
|
||||
import { Add, ArrowRight } from "iconsax-react";
|
||||
import { FC } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import Button from "../../../../components/Button";
|
||||
import { Pages } from "../../../../config/Pages";
|
||||
|
||||
@@ -13,23 +13,33 @@ type Props = {
|
||||
|
||||
const ProjectListHeader: FC<Props> = ({ title, workspaceId, onSettingsClick }) => {
|
||||
const { t } = useTranslation("global");
|
||||
const createProjectLink = workspaceId
|
||||
? `${Pages.taskmanager.createProject}?workspaceId=${workspaceId}`
|
||||
: Pages.taskmanager.createProject;
|
||||
|
||||
const createProjectLink = workspaceId ? `${Pages.taskmanager.createProject}?workspaceId=${workspaceId}` : Pages.taskmanager.createProject;
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<div className="flex w-full justify-between items-center">
|
||||
<h1>{title}</h1>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<Button onClick={onSettingsClick} className="flex items-center gap-2 bg-[#C3C7DD] text-black whitespace-nowrap px-4">
|
||||
<Setting2 size={18} color="black" />
|
||||
<span>{t("sidebar.setting")}</span>
|
||||
<Button
|
||||
onClick={() => navigate(-1)}
|
||||
className="flex items-center gap-2 bg-[#C3C7DD] text-black whitespace-nowrap px-4"
|
||||
>
|
||||
<ArrowRight
|
||||
size={18}
|
||||
color="black"
|
||||
/>
|
||||
<span>برگشت</span>
|
||||
</Button>
|
||||
|
||||
<Link to={createProjectLink}>
|
||||
<Button onClick={onSettingsClick} className="flex items-center gap-2 whitespace-nowrap px-4">
|
||||
<Add size={18} color="white" />
|
||||
<Button
|
||||
onClick={onSettingsClick}
|
||||
className="flex items-center gap-2 whitespace-nowrap px-4"
|
||||
>
|
||||
<Add
|
||||
size={18}
|
||||
color="white"
|
||||
/>
|
||||
<span>{t("taskmanager.new_project")}</span>
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user