import React from 'react'; import clsx from 'clsx'; import { defineMessages, FormattedMessage as Message } from 'react-intl'; import { Helmet } from 'react-helmet-async'; import { LinkButton } from 'app/components/ui/form'; import { COLOR_GREEN, COLOR_BLUE } from 'app/components/ui'; import { ContactLink } from 'app/components/contact'; import { OauthAppResponse } from 'app/services/api/oauth'; import styles from './applicationsIndex.scss'; import cubeIcon from './icons/cube.svg'; import loadingCubeIcon from './icons/loading-cube.svg'; import toolsIcon from './icons/tools.svg'; import ApplicationsList from './list'; const labels = defineMessages({ addNew: 'Add new', authorization: 'Authorization', }); type Props = { clientId: string | null; resetClientId: () => void; // notify parent to remove clientId from current location.href displayForGuest: boolean; applications: Array; isLoading: boolean; deleteApp: (clientId: string) => Promise; resetApp: (clientId: string, resetClientSecret: boolean) => Promise; }; export default class ApplicationsIndex extends React.Component { render() { return (
{(pageTitle: string) => (

{pageTitle}

)}
), }} />
), }} />
{this.getContent()}
); } getContent() { const { displayForGuest, applications, isLoading, resetApp, deleteApp, clientId, resetClientId } = this.props; if (applications.length > 0) { return ( ); } if (displayForGuest) { return ; } return ; } } function Loader({ noApps }: { noApps: boolean }) { return (
); } function Guest() { return (
); }