implement code editor as a component

add notif on status 'Installing' click
modify AppInstallModal
This commit is contained in:
Davor 2022-07-28 23:48:55 +02:00
parent 5b728d35d7
commit 3edc690075
13 changed files with 152 additions and 76 deletions

View file

@ -2,6 +2,7 @@
import React, { useState, useCallback, useMemo, useEffect } from 'react';
import { useNavigate } from 'react-router';
import { SearchIcon } from '@heroicons/react/solid';
import { showToast, ToastType } from 'src/common/util/show-toast';
import _, { debounce } from 'lodash';
import { Table } from 'src/components';
import { appAccessList } from 'src/components/UserModal/consts';
@ -61,7 +62,16 @@ export const Apps: React.FC = () => {
return (
<div className="flex items-center">
<div className={`flex-shrink-0 h-4 w-4 rounded-full bg-${getConstForStatus(status, 'colorClass')}`} />
<div className={`ml-2 text-sm text-${getConstForStatus(status, 'colorClass')}`}>{status}</div>
{status === AppStatus.Installing ? (
<div
className={`ml-2 cursor-pointer text-sm text-${getConstForStatus(status, 'colorClass')}`}
onClick={() => showToast('Installing an app can take up to 10 minutes.', ToastType.Success)}
>
{status}
</div>
) : (
<div className={`ml-2 text-sm text-${getConstForStatus(status, 'colorClass')}`}>{status}</div>
)}
</div>
);
},
@ -147,7 +157,9 @@ export const Apps: React.FC = () => {
</div>
</div>
<AppInstallModal appSlug={appSlug} onClose={() => setInstallModalOpen(false)} open={installModalOpen} />
{installModalOpen && (
<AppInstallModal appSlug={appSlug} onClose={() => setInstallModalOpen(false)} open={installModalOpen} />
)}
</div>
);
};