style: auto format whole project
This commit is contained in:
@@ -16,7 +16,7 @@ import AddNewAppConnection from 'components/AddNewAppConnection';
|
||||
import PageTitle from 'components/PageTitle';
|
||||
import AppRow from 'components/AppRow';
|
||||
import SearchInput from 'components/SearchInput';
|
||||
import useFormatMessage from 'hooks/useFormatMessage'
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import { GET_CONNECTED_APPS } from 'graphql/queries/get-connected-apps';
|
||||
import * as URLS from 'config/urls';
|
||||
|
||||
@@ -24,7 +24,9 @@ export default function Applications(): React.ReactElement {
|
||||
const navigate = useNavigate();
|
||||
const formatMessage = useFormatMessage();
|
||||
const [appName, setAppName] = React.useState(null);
|
||||
const { data, loading } = useQuery(GET_CONNECTED_APPS, { variables: {name: appName } });
|
||||
const { data, loading } = useQuery(GET_CONNECTED_APPS, {
|
||||
variables: { name: appName },
|
||||
});
|
||||
|
||||
const apps: IApp[] = data?.getConnectedApps;
|
||||
const hasApps = apps?.length;
|
||||
@@ -39,13 +41,12 @@ export default function Applications(): React.ReactElement {
|
||||
|
||||
const NewAppConnectionLink = React.useMemo(
|
||||
() =>
|
||||
React.forwardRef<HTMLAnchorElement, Omit<LinkProps, 'to'>>(function InlineLink(
|
||||
linkProps,
|
||||
ref,
|
||||
) {
|
||||
return <Link ref={ref} to={URLS.NEW_APP_CONNECTION} {...linkProps} />;
|
||||
}),
|
||||
[],
|
||||
React.forwardRef<HTMLAnchorElement, Omit<LinkProps, 'to'>>(
|
||||
function InlineLink(linkProps, ref) {
|
||||
return <Link ref={ref} to={URLS.NEW_APP_CONNECTION} {...linkProps} />;
|
||||
}
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -60,7 +61,14 @@ export default function Applications(): React.ReactElement {
|
||||
<SearchInput onChange={onSearchChange} />
|
||||
</Grid>
|
||||
|
||||
<Grid container item xs="auto" sm="auto" alignItems="center" order={{ xs: 1, sm: 2 }}>
|
||||
<Grid
|
||||
container
|
||||
item
|
||||
xs="auto"
|
||||
sm="auto"
|
||||
alignItems="center"
|
||||
order={{ xs: 1, sm: 2 }}
|
||||
>
|
||||
<ConditionalIconButton
|
||||
type="submit"
|
||||
variant="contained"
|
||||
@@ -78,22 +86,30 @@ export default function Applications(): React.ReactElement {
|
||||
|
||||
<Divider sx={{ mt: [2, 0], mb: 2 }} />
|
||||
|
||||
{loading && <CircularProgress data-test="apps-loader" sx={{ display: 'block', margin: '20px auto' }} />}
|
||||
{loading && (
|
||||
<CircularProgress
|
||||
data-test="apps-loader"
|
||||
sx={{ display: 'block', margin: '20px auto' }}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!loading && !hasApps && (<NoResultFound
|
||||
text={formatMessage('apps.noConnections')}
|
||||
to={URLS.NEW_APP_CONNECTION}
|
||||
/>)}
|
||||
{!loading && !hasApps && (
|
||||
<NoResultFound
|
||||
text={formatMessage('apps.noConnections')}
|
||||
to={URLS.NEW_APP_CONNECTION}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
{!loading && apps?.map((app: IApp) => (
|
||||
<AppRow key={app.name} application={app} />
|
||||
))}
|
||||
{!loading &&
|
||||
apps?.map((app: IApp) => <AppRow key={app.name} application={app} />)}
|
||||
|
||||
<Routes>
|
||||
<Route path="/new" element={<AddNewAppConnection onClose={goToApps} />} />
|
||||
<Route
|
||||
path="/new"
|
||||
element={<AddNewAppConnection onClose={goToApps} />}
|
||||
/>
|
||||
</Routes>
|
||||
</Container>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user