Skip to content
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
2 changes: 1 addition & 1 deletion frontend/src/custom/ActionConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { IoIosWarning } from "react-icons/io";
borderColor: 'black',
borderWidth: '2px'
}}
className=" bg-white rounded-lg shadow-2xl p-8 max-w-xl w-full mx-4 transform transition-all duration-300"
className=" bg-white rounded-md shadow-2xl p-8 max-w-xl w-full mx-4 transform transition-all duration-300"
onClick={(e) => e.stopPropagation()}
>

Expand Down
63 changes: 38 additions & 25 deletions frontend/src/main-page/grants/GrantPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
import { toJS } from "mobx";

import { fetchGrants } from "./filter-bar/processGrantData.ts";

import { UserStatus } from "../../../../middle-layer/types/UserStatus.ts";
import { Navigate } from "react-router-dom";

interface GrantPageProps {
showOnlyMyGrants?: boolean; //if true, filters grants by user email
Expand Down Expand Up @@ -50,38 +51,50 @@ function GrantPage({ showOnlyMyGrants = false }: GrantPageProps) {
}
}, [showNewGrantModal, wasGrantSubmitted]);

return (
<div className="grant-page px-8">
<div className="top-half">
</div>
return user ? (
user?.position !== UserStatus.Inactive ? (
<div className="grant-page px-8">
<div className="top-half"></div>
<div className="flex justify-end align-middle p-4 gap-4">
<GrantSearch />
<AddGrantButton onClick={() => setShowNewGrantModal(true)} />
</div>
<div className="grid grid-cols-5 gap-8 px-4">
<div className="col-span-1">
<FilterBar/>
<div className="grid grid-cols-5 gap-8 px-4">
<div className="col-span-1">
<FilterBar />
</div>
<div className="bot-half col-span-4">
<div className="grant-list-container">
<GrantList
selectedGrantId={
selectedGrant ? selectedGrant.grantId : undefined
}
onClearSelectedGrant={() => setSelectedGrant(null)}
currentUserEmail={currentUserEmail}
showOnlyMyGrants={showOnlyMyGrants}
/>
</div>
</div>
</div>
<div className="bot-half col-span-4">
<div className="grant-list-container">
<GrantList
selectedGrantId={
selectedGrant ? selectedGrant.grantId : undefined
}
onClearSelectedGrant={() => setSelectedGrant(null)}
currentUserEmail={currentUserEmail}
showOnlyMyGrants={showOnlyMyGrants}
<div className="hidden-features">
{showNewGrantModal && (
<NewGrantModal
grantToEdit={null}
onClose={async () => {
setShowNewGrantModal(false);
setWasGrantSubmitted(true);
}}
isOpen={showNewGrantModal}
/>
</div>
)}
</div>
</div>
<div className="hidden-features">
{showNewGrantModal && (
<NewGrantModal grantToEdit={null} onClose={async () => {setShowNewGrantModal(false); setWasGrantSubmitted(true);} } isOpen={showNewGrantModal} />
)}
</div>
</div>
) : (
<Navigate to="restricted" replace />
)
) : (
<Navigate to="/login" replace />
);
}
}

export default GrantPage;
14 changes: 7 additions & 7 deletions frontend/src/main-page/grants/grant-list/GrantItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const GrantItem: React.FC<GrantItemProps> = observer(
{/*Left column of gray labels */}
<div className="w-1/2 mr-2">
{/*Application date and grant start date row*/}
<div className="flex space-x-4 w-full mb-4">
<div className="flex space-x-4 w-full">
{/*Application date*/}
<div className="w-1/2 mb-3">
<label
Expand Down Expand Up @@ -336,7 +336,7 @@ const GrantItem: React.FC<GrantItemProps> = observer(
Report Deadlines
</label>
<div
className="p-2 rounded-md h-52 w-4/5 overflow-auto grip "
className="p-2 rounded-md h-[13.5rem] w-4/5 overflow-auto grip "
style={{
backgroundColor: "#F58D5C",
borderStyle: "solid",
Expand Down Expand Up @@ -404,14 +404,14 @@ const GrantItem: React.FC<GrantItemProps> = observer(
className="w-4/5 border-l border-black bg-[#FFCEB6] rounded-r-md"
>
<h2
className="truncate px-2 text-left font-bold h-10 w-full text-gray-700 rounded flex items-center"
className="truncate px-2 text-left font-bold h-8 w-full text-gray-700 rounded flex items-center"
id="grid-city"
>
{" "}
{curGrant.bcan_poc?.POC_name ?? "Unknown"}{" "}
</h2>
<h2
className="truncate px-2 text-left h-10 w-full text-gray-700 rounded flex items-center"
className="truncate px-2 text-left h-8 w-full text-gray-700 rounded flex items-center"
id="grid-city"
title={
curGrant.bcan_poc?.POC_email ?? "----------"
Expand Down Expand Up @@ -448,14 +448,14 @@ const GrantItem: React.FC<GrantItemProps> = observer(
className="w-4/5 border-l border-black bg-[#FFCEB6] rounded-r-md"
>
<h2
className="truncate px-2 text-left font-bold h-10 w-full text-gray-700 rounded-md flex items-center"
className="truncate px-2 text-left font-bold h-8 w-full text-gray-700 rounded-md flex items-center"
id="grid-city"
>
{" "}
{curGrant.grantmaker_poc?.POC_name ?? "Unknown"}
</h2>
<h2
className="truncate px-2 text-left h-10 w-full text-gray-700 rounded-md flex items-center"
className="truncate px-2 text-left h-8 w-full text-gray-700 rounded-md flex items-center"
id="grid-city"
title={
curGrant.grantmaker_poc?.POC_email ??
Expand Down Expand Up @@ -552,7 +552,7 @@ const GrantItem: React.FC<GrantItemProps> = observer(
Scope Documents
</label>
<div
className="p-2 rounded-md h-48 overflow-auto grip grid-cols-1 gap-4"
className="p-2 rounded-md h-[11.5rem] overflow-auto grip grid-cols-1 gap-4"
style={{
backgroundColor: ButtonColorOption.GRAY,
borderStyle: "solid",
Expand Down