diff --git a/packages/console/src/pages/ApplicationDetails/index.tsx b/packages/console/src/pages/ApplicationDetails/index.tsx index 54307f530..30c0670ab 100644 --- a/packages/console/src/pages/ApplicationDetails/index.tsx +++ b/packages/console/src/pages/ApplicationDetails/index.tsx @@ -52,7 +52,7 @@ const mapToUriOriginFormatArrays = (value?: string[]) => function ApplicationDetails() { const { id, guideId, tab } = useParams(); const { navigate, match } = useTenantPathname(); - const isGuideView = id && guideId && match(`/applications/${id}/guide/${guideId}`); + const isGuideView = !!id && !!guideId && match(`/applications/${id}/guide/${guideId}`); const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const { data, error, mutate } = useSWR( @@ -145,6 +145,18 @@ function ApplicationDetails() { setIsReadmeOpen(false); }; + if (isGuideView) { + return ( + { + navigate(`/applications/${id}`); + }} + /> + ); + } + return ( )} - {isGuideView && ( - { - navigate(`/applications/${id}`); - }} - /> - )} ); } diff --git a/packages/console/src/pages/Applications/components/Guide/index.tsx b/packages/console/src/pages/Applications/components/Guide/index.tsx index 88c92613e..70415d9f8 100644 --- a/packages/console/src/pages/Applications/components/Guide/index.tsx +++ b/packages/console/src/pages/Applications/components/Guide/index.tsx @@ -51,7 +51,7 @@ export const GuideContext = createContext({ type Props = { className?: string; guideId: string; - app: ApplicationResponse; + app?: ApplicationResponse; isCompact?: boolean; onClose: () => void; }; @@ -67,20 +67,21 @@ function Guide({ className, guideId, app, isCompact, onClose }: Props) { const memorizedContext = useMemo( () => conditional( - !!guide && { - metadata: guide.metadata, - Logo: guide.Logo, - app, - endpoint: tenantEndpoint?.toString() ?? '', - alternativeEndpoint: conditional(isCustomDomainActive && tenantEndpoint?.toString()), - redirectUris: app.oidcClientMetadata.redirectUris, - postLogoutRedirectUris: app.oidcClientMetadata.postLogoutRedirectUris, - isCompact: Boolean(isCompact), - sampleUrls: { - origin: 'http://localhost:3001/', - callback: 'http://localhost:3001/callback', - }, - } + !!guide && + !!app && { + metadata: guide.metadata, + Logo: guide.Logo, + app, + endpoint: tenantEndpoint?.toString() ?? '', + alternativeEndpoint: conditional(isCustomDomainActive && tenantEndpoint?.toString()), + redirectUris: app.oidcClientMetadata.redirectUris, + postLogoutRedirectUris: app.oidcClientMetadata.postLogoutRedirectUris, + isCompact: Boolean(isCompact), + sampleUrls: { + origin: 'http://localhost:3001/', + callback: 'http://localhost:3001/callback', + }, + } ) satisfies GuideContextType | undefined, [guide, app, tenantEndpoint, isCustomDomainActive, isCompact] ); @@ -88,7 +89,9 @@ function Guide({ className, guideId, app, isCompact, onClose }: Props) { return ( <> - {memorizedContext ? ( + {!app && } + {!!app && !guide && } + {memorizedContext && ( - ) : ( - )} {memorizedContext && ( diff --git a/packages/console/src/pages/Applications/components/GuideModal/index.tsx b/packages/console/src/pages/Applications/components/GuideModal/index.tsx index 9c06066f2..8528d5466 100644 --- a/packages/console/src/pages/Applications/components/GuideModal/index.tsx +++ b/packages/console/src/pages/Applications/components/GuideModal/index.tsx @@ -15,21 +15,14 @@ type Props = { }; function GuideModal({ guideId, app, onClose }: Props) { - if (!app) { - return null; - } - const closeModal = () => { - onClose(app.id); + if (app) { + onClose(app.id); + } }; return ( - +
diff --git a/packages/console/src/pages/Applications/components/StepsSkeleton/index.module.scss b/packages/console/src/pages/Applications/components/StepsSkeleton/index.module.scss index ca2252314..e221c5164 100644 --- a/packages/console/src/pages/Applications/components/StepsSkeleton/index.module.scss +++ b/packages/console/src/pages/Applications/components/StepsSkeleton/index.module.scss @@ -1,4 +1,5 @@ @use '@/scss/underscore' as _; +@use '@/scss/dimensions' as dim; .step { display: flex; @@ -6,6 +7,8 @@ padding: _.unit(5) _.unit(6); border-radius: 16px; background-color: var(--color-layer-1); + max-width: dim.$guide-main-content-max-width; + margin: 0 auto; .index { @include _.shimmering-animation;