Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[N/A] adds "projects-comparison" feature flag #184

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 30 additions & 23 deletions client/src/containers/overview/project-details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from "next/link";

import { PROJECT_SCORE } from "@shared/entities/project-score.enum";
import { useAtom } from "jotai";
import { ChevronUp, ChevronDown, NotebookPen } from "lucide-react";
import { ChevronUp, ChevronDown, NotebookPen, Plus } from "lucide-react";

import {
renderCurrency,
Expand All @@ -13,6 +13,8 @@ import { cn } from "@/lib/utils";

import { projectDetailsAtom } from "@/app/(overview)/store";

import { useFeatureFlags } from "@/hooks/use-feature-flags";

import ParametersProjects from "@/containers/overview/project-details/parameters";

import BarChart from "@/components/ui/bar-chart";
Expand Down Expand Up @@ -141,6 +143,7 @@ const projectData = {

export default function ProjectDetails() {
const [projectDetails, setProjectDetails] = useAtom(projectDetailsAtom);
const featureFlags = useFeatureFlags();

const handleOpenDetails = (open: boolean) =>
setProjectDetails({ ...projectDetails, isOpen: open });
Expand Down Expand Up @@ -363,17 +366,19 @@ export default function ProjectDetails() {
<h3 className="text-md">Scorecard ratings</h3>
</Label>
</div>
{/*<div className="flex items-center gap-2">*/}
{/* <Label className="text-xs text-big-stone-200">*/}
{/* Compare with a different project*/}
{/* </Label>*/}
{/* <Button*/}
{/* variant="outline"*/}
{/* className="h-8 w-8 p-0 hover:bg-transparent"*/}
{/* >*/}
{/* <Plus className="h-4 w-4" />*/}
{/* </Button>*/}
{/*</div>*/}
{featureFlags["project-comparison"] && (
<div className="flex items-center gap-2">
<Label className="text-xs text-big-stone-200">
Compare with a different project
</Label>
<Button
variant="outline"
className="h-8 w-8 p-0 hover:bg-transparent"
>
<Plus className="h-4 w-4" />
</Button>
</div>
)}
</div>
<div className="mt-2">
{projectData.scorecard.map((item, index) => (
Expand Down Expand Up @@ -413,17 +418,19 @@ export default function ProjectDetails() {
<h3 className="text-md">Cost estimates</h3>
</Label>
</div>
{/*<div className="flex items-center gap-2">*/}
{/* <Label className="text-xs text-big-stone-200">*/}
{/* Compare with a different project*/}
{/* </Label>*/}
{/* <Button*/}
{/* variant="outline"*/}
{/* className="h-8 w-8 p-0 hover:bg-transparent"*/}
{/* >*/}
{/* <Plus className="h-4 w-4" />*/}
{/* </Button>*/}
{/*</div>*/}
{featureFlags["project-comparison"] && (
<div className="flex items-center gap-2">
<Label className="text-xs text-big-stone-200">
Compare with a different project
</Label>
<Button
variant="outline"
className="h-8 w-8 p-0 hover:bg-transparent"
>
<Plus className="h-4 w-4" />
</Button>
</div>
)}
</div>
<div>
{projectData.costEstimates.map((estimate) => (
Expand Down
1 change: 1 addition & 0 deletions client/src/hooks/use-feature-flags.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const FEATURE_FLAGS = {
"edit-project": false,
"share-information": false,
"project-comparison": false,
} as const;

type FeatureFlags = typeof FEATURE_FLAGS;
Expand Down
Loading