feat: style app connections

This commit is contained in:
Ali BARIN
2021-12-15 21:58:14 +01:00
parent fc85716d07
commit 78375934d7
17 changed files with 232 additions and 34 deletions

View File

@@ -1,18 +1,34 @@
import * as React from 'react';
import { useQuery } from '@apollo/client';
import { GET_APP_CONNECTIONS } from 'graphql/queries/get-app-connections';
import { GET_APP_CONNECTIONS } from 'graphql/queries/get-app-connections';
import AppConnectionRow from 'components/AppConnectionRow';
import NoResultFound from 'components/NoResultFound';
import useFormatMessage from 'hooks/useFormatMessage';
import type { Connection } from 'types/connection';
import * as URLS from 'config/urls';
type AppConnectionsProps = {
appKey: String;
appKey: string;
}
export default function AppConnections(props: AppConnectionsProps) {
const { appKey } = props;
const formatMessage = useFormatMessage();
const { data } = useQuery(GET_APP_CONNECTIONS, { variables: { key: appKey } });
const appConnections: Connection[] = data?.getApp?.connections || [];
const hasConnections = appConnections?.length;
if (!hasConnections) {
return (
<NoResultFound
to={URLS.APP_ADD_CONNECTION(appKey)}
text={formatMessage('app.noConnections')}
/>
);
}
return (
<>
{appConnections.map((appConnection: Connection) => (