Skip to content

Commit

Permalink
Merge branch 'dev' into feature/voyage-overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-Y-Ko authored Jun 21, 2024
2 parents e906e6f + 10bd212 commit 851395c
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const useCalendarLogic = (
check: sprintsData?.some((day) => isSameDay(new Date(day.endDate), date)),
label: "Weekly Check-in Due",
link: weeklyCheckInLink(),
isDisabled: isBefore(date, new Date()),
},
{
id: 3,
Expand Down
1 change: 1 addition & 0 deletions src/app/(main)/dashboard/components/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export default function Calendar({
title={condition.label}
link={condition?.link}
useTargetBlank={false}
isDisabled={condition?.isDisabled}
/>
</div>
) : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,43 @@ type SprintItemProps = {
link: string;
time?: string;
useTargetBlank?: boolean;
isDisabled?: boolean;
};
function SprintItem({
title,
link,
time,
useTargetBlank = true,
isDisabled = false,
}: SprintItemProps) {
return (
<Link href={link} target={useTargetBlank ? "_blank" : ""}>
<Link
href={isDisabled ? "#" : link}
target={useTargetBlank ? "_blank" : ""}
onClick={(e) => isDisabled && e.preventDefault()}
>
<div className="my-4 flex w-full cursor-pointer flex-row items-center justify-between rounded-lg bg-base-100 p-3">
<div>
{time ? (
<time className="text-sm font-medium text-base-300">{time}</time>
<time
className={`text-sm font-medium text-base-300 ${
isDisabled ? "text-neutral" : ""
}`}
>
{time}
</time>
) : null}
<p className="max-w-[150px] cursor-pointer break-words text-base font-medium">
<p
className={`max-w-[150px] cursor-pointer break-words text-base font-medium ${
isDisabled ? "text-neutral" : ""
}`}
>
{title}
</p>
</div>
<ChevronRightIcon className="w-[15px]" />
<ChevronRightIcon
className={`w-[15px] ${isDisabled ? "text-neutral" : ""}`}
/>
</div>
</Link>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { redirect } from "next/navigation";
import ContributionCard from "./ContributionCard";
import CreateIdeationContainer from "./CreateIdeationContainer";
import FinalizedIdeationCard from "./FinalizedIdeationCard";
import IdeationContainer from "./IdeationContainer";
import IdeationProvider from "./IdeationProvider";
import CreateIdeationContainer from "./CreateIdeationContainer";
import ContributionCard from "./ContributionCard";
import VoteCard from "./VoteCard";
import FinalizedIdeationCard from "./FinalizedIdeationCard";
import { type FetchIdeationsProps } from "@/app/(main)/my-voyage/[teamId]/ideation/ideationService";
import { type IdeationData } from "@/store/features/ideation/ideationSlice";
import { getAccessToken } from "@/utils/getCookie";
import { GET } from "@/utils/requests";
import Banner from "@/components/banner/Banner";
import { type AsyncActionResponse, handleAsync } from "@/utils/handleAsync";
import { CacheTag } from "@/utils/cacheTag";
import VoyagePageBannerContainer from "@/components/banner/VoyagePageBannerContainer";
import { type IdeationData } from "@/store/features/ideation/ideationSlice";
import { CacheTag } from "@/utils/cacheTag";
import { getAccessToken } from "@/utils/getCookie";
import { getCurrentVoyageData } from "@/utils/getCurrentVoyageData";
import routePaths from "@/utils/routePaths";
import { getUser } from "@/utils/getUser";
import { handleAsync, type AsyncActionResponse } from "@/utils/handleAsync";
import { GET } from "@/utils/requests";
import routePaths from "@/utils/routePaths";

// import { ideation } from "./fixtures/ideation";

// If user is not logged in, nav should be updated to reflect signed out state
Expand Down Expand Up @@ -99,63 +100,63 @@ export default async function IdeationComponentWrapper({
);
}

if (projectIdeas.length === 0) {
return (
<div className="my-20 flex h-[290px] w-full gap-x-48">
<div className="flex flex-col justify-center">
<h1 className="text-xl font-medium text-base-300">
Be the First to Share!
</h1>
<p className="my-4 text-base font-medium text-base-300">
It looks like no one has posted anything yet, but don’t worry, you
can be the first to create a new project idea and vision for your
team!
</p>
<p className="text-base font-medium text-base-300">
Click on the{" "}
<b className="text-base font-semibold text-base-300">
Add Project Idea
</b>{" "}
button at the top to get started!
</p>
</div>
<Banner
imageLight="/img/empty_ideation_light.png"
imageDark="/img/empty_ideation_dark.png"
alt="ideation_banner"
height="h-[290px]"
width="w-[540px]"
/>
</div>
);
}

return (
<>
<CreateIdeationContainer />
{projectIdeas.map((projectIdea) => (
<IdeationContainer
key={projectIdea.id}
title={projectIdea.title}
project_idea={projectIdea.description}
vision_statement={projectIdea.vision}
isIdeationFinalized={false}
firstChild={
<VoteCard
teamId={teamId}
projectIdeaId={projectIdea.id}
users={projectIdea.projectIdeaVotes}
{!projectIdeas.length ? (
<>
<CreateIdeationContainer />
<div className="my-20 flex h-[290px] w-full gap-x-48">
<div className="flex flex-col justify-center">
<h1 className="text-xl font-medium text-base-300">
Be the First to Share!
</h1>
<p className="my-4 text-base font-medium text-base-300">
It looks like no one has posted anything yet, but don’t worry,
you can be the first to create a new project idea and vision
for your team!
</p>
<p className="text-base font-medium text-base-300">
Click on the{" "}
<b className="text-base font-semibold text-base-300">
Add Project Idea
</b>{" "}
button at the top to get started!
</p>
</div>
<Banner
imageLight="/img/empty_ideation_light.png"
imageDark="/img/empty_ideation_dark.png"
alt="ideation_banner"
height="h-[290px]"
width="w-[540px]"
/>
}
secondChild={
<ContributionCard
projectIdeaId={projectIdea.id}
contributed_by={projectIdea.contributedBy}
isIdeationFinalized={false}
/>
}
/>
))}
</div>
</>
) : (
projectIdeas.map((projectIdea) => (
<IdeationContainer
key={projectIdea.id}
title={projectIdea.title}
project_idea={projectIdea.description}
vision_statement={projectIdea.vision}
isIdeationFinalized={false}
firstChild={
<VoteCard
teamId={teamId}
projectIdeaId={projectIdea.id}
users={projectIdea.projectIdeaVotes}
/>
}
secondChild={
<ContributionCard
projectIdeaId={projectIdea.id}
contributed_by={projectIdea.contributedBy}
isIdeationFinalized={false}
/>
}
/>
))
)}
</>
);
}
Expand Down

0 comments on commit 851395c

Please sign in to comment.