From b037c4ceb1407f5bd56fe312d307e5206a6bfe29 Mon Sep 17 00:00:00 2001 From: ikethecoder Date: Thu, 27 May 2021 10:06:14 -0700 Subject: [PATCH] redirect upd --- src/nextapp/pages/redirect/[id].tsx | 120 ++++++++++++++++------------ 1 file changed, 71 insertions(+), 49 deletions(-) diff --git a/src/nextapp/pages/redirect/[id].tsx b/src/nextapp/pages/redirect/[id].tsx index 4ea8d333d..c3789d761 100644 --- a/src/nextapp/pages/redirect/[id].tsx +++ b/src/nextapp/pages/redirect/[id].tsx @@ -1,5 +1,13 @@ import * as React from 'react'; -import { Container, Alert, AlertIcon, AlertTitle, AlertDescription, Link, VStack } from '@chakra-ui/react'; +import { + Container, + Alert, + AlertIcon, + AlertTitle, + AlertDescription, + Link, + VStack, +} from '@chakra-ui/react'; import Head from 'next/head'; import { useAuth } from '@/shared/services/auth'; import { GetServerSideProps, InferGetServerSidePropsType } from 'next'; @@ -7,36 +15,45 @@ import { Box, Center, Heading, Icon } from '@chakra-ui/react'; import { FaExclamationCircle } from 'react-icons/fa'; export const getServerSideProps: GetServerSideProps = async (context) => { - const { id } = context.params; - return { - props: { - id - }, - } - } + const { id } = context.params; + return { + props: { + id, + }, + }; +}; -const RedirectPage: React.FC> = ({id}) => { +const RedirectPage: React.FC< + InferGetServerSidePropsType +> = ({ id }) => { const sources = { - "kq": { - title: "Key Requester (KQ) End-of-Life", - description: "The KQ application has been demised and replaced with the API Services Portal. To get a key to an API, go to the Directory page and request access." - }, - "argg": { - title: "API Registration Generator (ARGG) End-of-Life", - description: "The ARGG application has been demised and replaced with the API Services Portal. To register an API so that it is discoverable, find the 'Gateway Administration API' in the Directory and Request access to get started.", - moreDetails: '/devportal/docs/news-portal-release' - }, - "api-spec-editor": { - title: "API Spec Editor End-of-Life", - description: "The API Spec Editor application has been demised and replaced with a Swagger Console." - }, - "api-console": { - title: "API Console End-of-Life", - description: "The API Console application has been demised and replaced with a Swagger Console." - } - } + kq: { + title: 'API Key Request (KQ) End-of-Life', + description: + "The KQ application has been demised and replaced with the API Services Portal. To get a key to an API, go to the Directory page and request access.", + moreDetails: '/devportal/docs/news-portal-release-1', + }, + argg: { + title: 'API Registration Generator (ARGG) End-of-Life', + description: + "The ARGG application has been demised and replaced with the API Services Portal. To register an API so that it is discoverable, find the 'Gateway Administration API' in the Directory and Request access to get started.", + moreDetails: '/devportal/docs/news-portal-release-1', + }, + 'api-spec-editor': { + title: 'API Spec Editor End-of-Life', + description: + 'The API Spec Editor application has been demised and replaced with an API Swagger Console.', + moreDetails: '/devportal/docs/news-portal-release-1', + }, + 'api-console': { + title: 'API Console End-of-Life', + description: + 'The API Console application has been demised and replaced with a Swagger Console.', + moreDetails: '/devportal/docs/news-portal-release-1', + }, + }; if (!(id in sources)) { - return <> + return <>; } return ( <> @@ -44,29 +61,34 @@ const RedirectPage: React.FCAPI Services Portal | Redirect - - - - {sources[id].title} - - - - {sources[id].moreDetails && ( - {`More Details...`} - )} - + + + + {sources[id].title} + + + {sources[id].moreDetails && ( + {`More Details...`} + )} - ) -} + ); +}; export default RedirectPage;