-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
279 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
// export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
|
||
const Page = () => null; | ||
export default Page; |
5 changes: 4 additions & 1 deletion
5
src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
// export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
|
||
const Page = () => null; | ||
export default Page; |
5 changes: 4 additions & 1 deletion
5
src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
// export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
|
||
const Page = () => null; | ||
export default Page; |
5 changes: 4 additions & 1 deletion
5
src/app/grants/[grantId]/grantees/[granteeId]/projects/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
// export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
|
||
const Page = () => null; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
// export { GrantsStatsSection as default } from '@/grants/pages/grant-stats-section'; | ||
|
||
const Page = () => null; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 51 additions & 51 deletions
102
src/grants/components/project-selections/project-selections.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
'use client'; | ||
|
||
import { useParams } from 'next/navigation'; | ||
import { useState } from 'react'; | ||
// import { useParams } from 'next/navigation'; | ||
// import { useState } from 'react'; | ||
|
||
import { errMsg } from '@/shared/core/errors'; | ||
// import { errMsg } from '@/shared/core/errors'; | ||
|
||
import { useGranteeProjectFetch } from '@/grants/hooks/use-grantee-project-fetch'; | ||
import { ProjectSelectionItemSkeleton } from '@/grants/components/project-selections/project-selection-item-skeleton'; | ||
// import { ProjectSelectionItemSkeleton } from '@/grants/components/project-selections/project-selection-item-skeleton'; | ||
|
||
import { ProjectSelection } from './project-selection'; | ||
// import { ProjectSelection } from './project-selection'; | ||
|
||
const WRAPPER_CLASSNAME = 'flex w-full gap-3 rounded-20 bg-white/5 p-3'; | ||
// const WRAPPER_CLASSNAME = 'flex w-full gap-3 rounded-20 bg-white/5 p-3'; | ||
|
||
export const ProjectSelections = () => { | ||
const { grantId, granteeId, projectId } = useParams() as { | ||
grantId: string; | ||
granteeId?: string; | ||
projectId?: string; | ||
}; | ||
return null; | ||
// const { grantId, granteeId, projectId } = useParams() as { | ||
// grantId: string; | ||
// granteeId?: string; | ||
// projectId?: string; | ||
// }; | ||
|
||
const [hasError, setHasError] = useState(false); | ||
const showError = () => setHasError(true); | ||
// const [hasError, setHasError] = useState(false); | ||
// const showError = () => setHasError(true); | ||
|
||
const { granteeData, projectData, isLoading, errorMessage } = | ||
useGranteeProjectFetch({ | ||
grantId, | ||
granteeId, | ||
projectId, | ||
}); | ||
// const { granteeData, projectData, isLoading, errorMessage } = | ||
// useGranteeProjectFetch({ | ||
// grantId, | ||
// granteeId, | ||
// projectId, | ||
// }); | ||
|
||
if (isLoading) { | ||
return ( | ||
<div className={WRAPPER_CLASSNAME}> | ||
<ProjectSelectionItemSkeleton /> | ||
<ProjectSelectionItemSkeleton /> | ||
</div> | ||
); | ||
} | ||
// if (isLoading) { | ||
// return ( | ||
// <div className={WRAPPER_CLASSNAME}> | ||
// <ProjectSelectionItemSkeleton /> | ||
// <ProjectSelectionItemSkeleton /> | ||
// </div> | ||
// ); | ||
// } | ||
|
||
if (hasError) { | ||
return <p>Error: {errMsg.INTERNAL}</p>; | ||
} | ||
// if (hasError) { | ||
// return <p>Error: {errMsg.INTERNAL}</p>; | ||
// } | ||
|
||
// This component is stacked with others. Top most component renders the error. | ||
if (errorMessage) return null; | ||
if (!granteeData?.data) return null; | ||
// // This component is stacked with others. Top most component renders the error. | ||
// if (errorMessage) return null; | ||
// if (!granteeData?.data) return null; | ||
|
||
if (!projectData?.data) { | ||
return <p>TODO: No Grantee Project UI</p>; | ||
} | ||
// if (!projectData?.data) { | ||
// return <p>TODO: No Grantee Project UI</p>; | ||
// } | ||
|
||
const baseHref = `/grants/${grantId}/grantees/${granteeData.data.id}/projects`; | ||
// const baseHref = `/grants/${grantId}/grantees/${granteeData.data.id}/projects`; | ||
|
||
return ( | ||
<div className={WRAPPER_CLASSNAME}> | ||
{granteeData.data.projects.map((id, index) => ( | ||
<ProjectSelection | ||
key={id} | ||
projectId={id} | ||
href={`${baseHref}/${id}`} | ||
isActiveBypass={!projectId && index === 0} | ||
showError={showError} | ||
/> | ||
))} | ||
</div> | ||
); | ||
// return ( | ||
// <div className={WRAPPER_CLASSNAME}> | ||
// {granteeData.data.projects.map((id, index) => ( | ||
// <ProjectSelection | ||
// key={id} | ||
// projectId={id} | ||
// href={`${baseHref}/${id}`} | ||
// isActiveBypass={!projectId && index === 0} | ||
// showError={showError} | ||
// /> | ||
// ))} | ||
// </div> | ||
// ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.