Skip to content

Commit

Permalink
show banner if gateways on Get Started
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyjux committed Jun 20, 2024
1 parent 50174ce commit f4293f0
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions src/nextapp/pages/manager/gateways/get-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import GatewayGetStarted from '@/components/gateway-get-started';
import PageHeader from '@/components/page-header';
import { useApi } from '@/shared/services/api';
import {
Box,
Container,
Heading
Flex,
Icon,
Heading,
Link,
Text
} from '@chakra-ui/react';
import { FaInfoCircle } from 'react-icons/fa';
import { gql } from 'graphql-request';
import Head from 'next/head';
import React from 'react';
Expand All @@ -13,7 +19,11 @@ const NamespacesPage: React.FC = () => {
const { data, isSuccess, isError } = useApi(
'allNamespaces',
{ query },
{ suspense: false }
{
suspense: false,
refetchOnWindowFocus: true,
refetchOnReconnect: true,
}
);

return (
Expand All @@ -23,15 +33,33 @@ const NamespacesPage: React.FC = () => {
API Program Services | My Gateways
</title>
</Head>
{isError && (
<Heading>Gateways Failed to Load</Heading>
)}
{(isSuccess && data.allNamespaces.length != 0) && (
<Box width="100%" bgColor="#DAE7F0" color="bc-blue" boxShadow="md">
<Container maxW="6xl" py={6}>
<Flex align="center" justify="space-between" gridGap={8}>
<Flex align="center" gridGap={4}>
<Icon as={FaInfoCircle} boxSize="6" />
<Text fontSize="sm" fontWeight="bold">
You have gateways. Visit the{' '}
<Link
href={'/manager/gateways'}
target="_blank"
color="bc-link"
textDecor="underline"
>My Gateways page</Link>
{' '}to manage them.
</Text>
</Flex>
</Flex>
</Container>
</Box>
)}
<Container maxW="6xl">
<PageHeader title={'My Gateways'} />
<>
{isError && (
<Heading>Gateways Failed to Load</Heading>
)}
{(isSuccess && data.allNamespaces.length != 0) && (
<Heading>Gateways Found!</Heading>
)}
<GatewayGetStarted />
</>
</Container>
Expand Down

0 comments on commit f4293f0

Please sign in to comment.