mirror of
https://github.com/Infisical/infisical.git
synced 2025-03-25 14:05:03 +00:00
Added to auto-redirect to the no projects page
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 228 KiB |
246
frontend/public/images/dragon-cant-find.svg
Normal file
246
frontend/public/images/dragon-cant-find.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 122 KiB |
@ -1,19 +1,40 @@
|
||||
import { useEffect } from 'react';
|
||||
import Image from 'next/image';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
import Button from '~/components/basic/buttons/Button';
|
||||
import { getTranslatedServerSideProps } from '~/utilities/withTranslateProps';
|
||||
|
||||
import getWorkspaces from './api/workspace/getWorkspaces';
|
||||
|
||||
export default function NoProjects() {
|
||||
const router = useRouter();
|
||||
|
||||
const redirectUser = async () => {
|
||||
const workspaces = await getWorkspaces();
|
||||
if (workspaces.length > 0) {
|
||||
router.push('/dashboard/' + workspaces[0]._id);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
// on initial load - run auth check
|
||||
(async () => {
|
||||
await redirectUser()
|
||||
})();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className='h-full flex flex-col items-center justify-center text-gray-300 text-lg text-center w-11/12 mr-auto'>
|
||||
<div className='mb-4 mr-16'>
|
||||
<div className='mb-6 mt-16 mr-16'>
|
||||
<Image
|
||||
src='/images/dragon-cant-find.png'
|
||||
src='/images/dragon-cant-find.svg'
|
||||
height={270}
|
||||
width={436}
|
||||
alt='google logo'
|
||||
></Image>
|
||||
</div>
|
||||
<div className='p-4 rounded-md bg-bunker-500 mb-8 text-bunker-300 shadow-xl'>
|
||||
<div className='px-4 rounded-md bg-bunker-500 mb-8 text-bunker-300 shadow-xl py-6'>
|
||||
<div className='max-w-md'>
|
||||
You are not part of any projects in this organization yet. When you
|
||||
do, they will appear here.
|
||||
@ -22,6 +43,9 @@ export default function NoProjects() {
|
||||
Create a new project, or ask other organization members to give you
|
||||
neccessary permissions.
|
||||
</div>
|
||||
<div className='mt-6 mx-2'>
|
||||
<Button text="Check again" onButtonPressed={redirectUser} size="md" color="mineshaft"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user