-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2108 from ever-co/feat/maintenace
Feat: Maintenace page
- Loading branch information
Showing
37 changed files
with
265 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
'use client'; | ||
|
||
import Maintenance from '@components/pages/maintenance'; | ||
|
||
const Error = () => { | ||
return <>Error Page...</>; | ||
return ( | ||
<> | ||
<Maintenance /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Error; |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { getDefaultRequest } from '@app/services/server/requests/default'; | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function GET() { | ||
return NextResponse.json(await getDefaultRequest()); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use client'; | ||
|
||
import React, { useCallback, useEffect } from 'react'; | ||
import { useQuery } from './useQuery'; | ||
import { getDefaultAPI } from '@app/services/client/api'; | ||
|
||
export function useCheckAPI() { | ||
const { queryCall } = useQuery(getDefaultAPI); | ||
const [isApiWork, setIsApiWork] = React.useState(true); | ||
|
||
const checkAPI = useCallback(() => { | ||
queryCall() | ||
.then(() => { | ||
setIsApiWork(true); | ||
}) | ||
.catch(() => { | ||
setIsApiWork(false); | ||
}); | ||
}, [queryCall]); | ||
|
||
useEffect(() => { | ||
checkAPI(); | ||
}, [checkAPI]); | ||
|
||
return { | ||
isApiWork | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import api from '../axios'; | ||
|
||
export function getDefaultAPI() { | ||
return api.get(`/`); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { serverFetch } from '../fetch'; | ||
|
||
export function getDefaultRequest() { | ||
return serverFetch({ | ||
path: `/`, | ||
method: 'GET' | ||
}); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client'; | ||
import { RocketIcon } from '@radix-ui/react-icons'; | ||
import { Text } from 'lib/components'; | ||
import { useTranslations } from 'next-intl'; | ||
function Maintenance() { | ||
const t = useTranslations(); | ||
return ( | ||
<div className="h-screen flex flex-col gap-4 justify-center items-center "> | ||
<RocketIcon width={200} height={200} className="text-xl text-chetwodeBlue" /> | ||
<div className="m-auto relative my-6 pt-12 flex justify-center items-center gap-4 text-center "> | ||
<Text className="text-[78px] text-center font-semibold text-chetwodeBlue"> | ||
{t('pages.maintenance.HEADING_TITLE')} | ||
</Text> | ||
</div> | ||
|
||
<Text className="text-[40px] my-4 font-bold text-center text-[#282048] dark:text-light--theme"> | ||
{t('pages.maintenance.HEADING_DESCRIPTION')} | ||
</Text> | ||
</div> | ||
); | ||
} | ||
|
||
export default Maintenance; |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export const RocketIcon = ({ | ||
width, | ||
height, | ||
fill = '#8C7AE4', | ||
className | ||
}: { | ||
width: number; | ||
height: number; | ||
fill?: string; | ||
className?: string; | ||
}) => { | ||
return ( | ||
<svg | ||
width={width} | ||
height={height} | ||
// viewBox={`0 0 ${width} ${height}`} | ||
fill={fill} | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<path | ||
d="M6.85357 3.85355L7.65355 3.05353C8.2981 2.40901 9.42858 1.96172 10.552 1.80125C11.1056 1.72217 11.6291 1.71725 12.0564 1.78124C12.4987 1.84748 12.7698 1.97696 12.8965 2.10357C13.0231 2.23018 13.1526 2.50125 13.2188 2.94357C13.2828 3.37086 13.2779 3.89439 13.1988 4.44801C13.0383 5.57139 12.591 6.70188 11.9464 7.34645L7.49999 11.7929L6.35354 10.6465C6.15827 10.4512 5.84169 10.4512 5.64643 10.6465C5.45117 10.8417 5.45117 11.1583 5.64643 11.3536L7.14644 12.8536C7.34171 13.0488 7.65829 13.0488 7.85355 12.8536L8.40073 12.3064L9.57124 14.2572C9.65046 14.3893 9.78608 14.4774 9.9389 14.4963C10.0917 14.5151 10.2447 14.4624 10.3535 14.3536L12.3535 12.3536C12.4648 12.2423 12.5172 12.0851 12.495 11.9293L12.0303 8.67679L12.6536 8.05355C13.509 7.19808 14.0117 5.82855 14.1887 4.58943C14.2784 3.9618 14.2891 3.33847 14.2078 2.79546C14.1287 2.26748 13.9519 1.74482 13.6035 1.39645C13.2552 1.04809 12.7325 0.871332 12.2045 0.792264C11.6615 0.710945 11.0382 0.721644 10.4105 0.8113C9.17143 0.988306 7.80189 1.491 6.94644 2.34642L6.32322 2.96968L3.07071 2.50504C2.91492 2.48278 2.75773 2.53517 2.64645 2.64646L0.646451 4.64645C0.537579 4.75533 0.484938 4.90829 0.50375 5.0611C0.522563 5.21391 0.61073 5.34954 0.742757 5.42876L2.69364 6.59928L2.14646 7.14645C2.0527 7.24022 2.00002 7.3674 2.00002 7.50001C2.00002 7.63261 2.0527 7.75979 2.14646 7.85356L3.64647 9.35356C3.84173 9.54883 4.15831 9.54883 4.35357 9.35356C4.54884 9.1583 4.54884 8.84172 4.35357 8.64646L3.20712 7.50001L3.85357 6.85356L6.85357 3.85355ZM10.0993 13.1936L9.12959 11.5775L11.1464 9.56067L11.4697 11.8232L10.0993 13.1936ZM3.42251 5.87041L5.43935 3.85356L3.17678 3.53034L1.80638 4.90074L3.42251 5.87041ZM2.35356 10.3535C2.54882 10.1583 2.54882 9.8417 2.35356 9.64644C2.1583 9.45118 1.84171 9.45118 1.64645 9.64644L0.646451 10.6464C0.451188 10.8417 0.451188 11.1583 0.646451 11.3535C0.841713 11.5488 1.1583 11.5488 1.35356 11.3535L2.35356 10.3535ZM3.85358 11.8536C4.04884 11.6583 4.04885 11.3417 3.85359 11.1465C3.65833 10.9512 3.34175 10.9512 3.14648 11.1465L1.14645 13.1464C0.95119 13.3417 0.951187 13.6583 1.14645 13.8535C1.34171 14.0488 1.65829 14.0488 1.85355 13.8536L3.85358 11.8536ZM5.35356 13.3535C5.54882 13.1583 5.54882 12.8417 5.35356 12.6464C5.1583 12.4512 4.84171 12.4512 4.64645 12.6464L3.64645 13.6464C3.45119 13.8417 3.45119 14.1583 3.64645 14.3535C3.84171 14.5488 4.1583 14.5488 4.35356 14.3535L5.35356 13.3535ZM9.49997 6.74881C10.1897 6.74881 10.7488 6.1897 10.7488 5.5C10.7488 4.8103 10.1897 4.25118 9.49997 4.25118C8.81026 4.25118 8.25115 4.8103 8.25115 5.5C8.25115 6.1897 8.81026 6.74881 9.49997 6.74881Z" | ||
fill="currentColor" | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
></path> | ||
</svg> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { I_UserProfilePage } from '@app/hooks'; | ||
import { TaskCard } from './task/task-card'; | ||
import { I_TaskFilter } from './task/task-filters'; | ||
|
||
type Props = { | ||
tabFiltered: I_TaskFilter; | ||
profile: I_UserProfilePage; | ||
}; | ||
|
||
/** | ||
* It renders a list of tasks, with the first task being the active task, and the rest being the last | ||
* 24 hours of tasks | ||
* @param - `profile` - The user profile page data. | ||
* @returns A component that displays a user's profile page. | ||
*/ | ||
export function UserProfileTask({ profile, tabFiltered }: Props) { | ||
const tasks = tabFiltered.tasksFiltered; | ||
const otherTasks = tasks.filter((t) => | ||
profile.member?.running == true ? t.id !== profile.activeUserTeamTask?.id : t | ||
); | ||
|
||
return ( | ||
<div className="mt-10"> | ||
<ul className="flex flex-col gap-6"> | ||
{otherTasks.map((task) => { | ||
return ( | ||
<li key={task.id}> | ||
<TaskCard | ||
task={task} | ||
isAuthUser={profile.isAuthUser} | ||
activeAuthTask={false} | ||
viewType={tabFiltered.tab === 'unassigned' ? 'unassign' : 'default'} | ||
profile={profile} | ||
taskBadgeClassName={` ${ | ||
task.issueType === 'Bug' | ||
? '!px-[0.3312rem] py-[0.2875rem]' | ||
: '!px-[0.375rem] py-[0.375rem]' | ||
} rounded-sm`} | ||
taskTitleClassName="mt-[0.0625rem]" | ||
/> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</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
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
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
Oops, something went wrong.