import React from 'react'; import clsx from 'clsx'; import { FormattedMessage as Message } from 'react-intl'; import { Helmet } from 'react-helmet'; 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 messages from './ApplicationsIndex.intl.json'; import cubeIcon from './icons/cube.svg'; import loadingCubeIcon from './icons/loading-cube.svg'; import toolsIcon from './icons/tools.svg'; import ApplicationsList from './list'; 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 (
); }