0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-03 21:48:55 -05:00

feat(console): add complete tutorial doc links for app guide (#5397)

This commit is contained in:
Xiao Yijun 2024-02-10 21:21:05 +08:00 committed by GitHub
parent db9f67f55b
commit ecdf047711
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 77 additions and 4 deletions

View file

@ -7,6 +7,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
description: 'Enables direct communication between machines.',
target: ApplicationType.MachineToMachine,
isFeatured: true,
fullTutorial: {
title: 'Full machine-to-machine integration tutorial',
url: 'https://docs.logto.io/sdk/m2m',
},
});
export default metadata;

View file

@ -10,6 +10,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'kotlin',
path: 'android-sample-kotlin',
},
fullTutorial: {
title: 'Full Android SDK tutorial',
url: 'https://docs.logto.io/sdk/android',
},
});
export default metadata;

View file

@ -11,6 +11,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
path: 'packages/react-sample',
},
isFeatured: true,
fullTutorial: {
title: 'Full React SDK tutorial',
url: 'https://docs.logto.io/sdk/react',
},
});
export default metadata;

View file

@ -10,6 +10,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'js',
path: 'packages/browser-sample',
},
fullTutorial: {
title: 'Full vanilla JS SDK tutorial',
url: 'https://docs.logto.io/sdk/vanilla-js',
},
});
export default metadata;

View file

@ -12,6 +12,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
path: 'packages/vue-sample',
},
isFeatured: true,
fullTutorial: {
title: 'Full Vue SDK tutorial',
url: 'https://docs.logto.io/sdk/vue',
},
});
export default metadata;

View file

@ -30,6 +30,12 @@ export type GuideMetadata = {
/** Indicate whether the application is for third-party use */
isThirdParty?: boolean;
/** The related complete tutorial doc for this guide which will be displayed in the 'Further readings' section. */
fullTutorial?: {
title: string;
url: string;
};
};
/** The guide instance to build in the console. */

View file

@ -10,6 +10,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'csharp',
path: '/',
},
fullTutorial: {
title: 'Full .NET Core (Blazor Server) integration tutorial',
url: 'https://docs.logto.io/sdk/dotnet-core/blazor-server',
},
});
export default metadata;

View file

@ -10,6 +10,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'csharp',
path: '/',
},
fullTutorial: {
title: 'Full .NET Core (Blazor WASM) integration tutorial',
url: 'https://docs.logto.io/sdk/dotnet-core/blazor-wasm',
},
});
export default metadata;

View file

@ -10,6 +10,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'csharp',
path: '/',
},
fullTutorial: {
title: 'Full .NET Core (MVC) integration tutorial',
url: 'https://docs.logto.io/sdk/dotnet-core/mvc',
},
});
export default metadata;

View file

@ -11,6 +11,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'js',
path: 'packages/express-sample',
},
fullTutorial: {
title: 'Full Express SDK tutorial',
url: 'https://docs.logto.io/sdk/express',
},
});
export default metadata;

View file

@ -11,6 +11,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'go',
path: 'gin-sample',
},
fullTutorial: {
title: 'Full Go SDK tutorial',
url: 'https://docs.logto.io/sdk/go',
},
});
export default metadata;

View file

@ -11,6 +11,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'js',
path: 'packages/next-app-dir-sample',
},
fullTutorial: {
title: 'Full Next.js App Router SDK tutorial',
url: 'https://docs.logto.io/sdk/next-app-router',
},
});
export default metadata;

View file

@ -12,6 +12,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
path: 'packages/next-sample',
},
isFeatured: true,
fullTutorial: {
title: 'Full Next.js SDK tutorial',
url: 'https://docs.logto.io/sdk/next',
},
});
export default metadata;

View file

@ -6,6 +6,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
name: 'PHP',
description: 'Integrate Logto into your PHP web app, such as Lavarel.',
target: ApplicationType.Traditional,
fullTutorial: {
title: 'Full PHP SDK tutorial',
url: 'https://docs.logto.io/sdk/php',
},
});
export default metadata;

View file

@ -10,6 +10,10 @@ const metadata: Readonly<GuideMetadata> = Object.freeze({
repo: 'python',
path: 'samples',
},
fullTutorial: {
title: 'Full Python SDK tutorial',
url: 'https://docs.logto.io/sdk/python',
},
});
export default metadata;

View file

@ -1,15 +1,26 @@
import { type Ref, forwardRef } from 'react';
import { type GuideMetadata } from '@/assets/docs/guides/types';
import TextLink from '@/ds-components/TextLink';
import Step, { type Props as StepProps } from '../Step';
type Props = Omit<StepProps, 'children'>;
type Props = Omit<StepProps, 'children'> & {
fullTutorial: GuideMetadata['fullTutorial'];
};
function FurtherReadings(props: Props, ref?: Ref<HTMLDivElement>) {
const { fullTutorial, ...stepProps } = props;
return (
<Step ref={ref} {...props}>
<Step ref={ref} {...stepProps}>
<ul>
{fullTutorial && (
<li>
<TextLink href={fullTutorial.url} targetBlank="noopener">
{fullTutorial.title}
</TextLink>
</li>
)}
<li>
<TextLink href="https://docs.logto.io/docs/recipes/customize-sie/" targetBlank="noopener">
Customize sign-in experience

View file

@ -41,8 +41,8 @@ export default function Steps({ children: reactChildren }: Props) {
const isApiResourceGuide = metadata.target === 'API';
const furtherReadings = useMemo(
() => <FurtherReadings title="Further readings" subtitle="3 articles" />,
[]
() => <FurtherReadings title="Further readings" fullTutorial={metadata.fullTutorial} />,
[metadata.fullTutorial]
);
const children: Array<ReactElement<StepProps, typeof Step>> = useMemo(() => {
const steps = Array.isArray(reactChildren) ? reactChildren : [reactChildren];