mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
refactor(console): open docs website for M2M app guide (#2011)
This commit is contained in:
parent
dc7243288d
commit
2e2aa728e3
1 changed files with 17 additions and 9 deletions
|
@ -18,6 +18,7 @@ import Drawer from '@/components/Drawer';
|
||||||
import LinkButton from '@/components/LinkButton';
|
import LinkButton from '@/components/LinkButton';
|
||||||
import TabNav, { TabNavItem } from '@/components/TabNav';
|
import TabNav, { TabNavItem } from '@/components/TabNav';
|
||||||
import useApi, { RequestError } from '@/hooks/use-api';
|
import useApi, { RequestError } from '@/hooks/use-api';
|
||||||
|
import useDocumentationUrl from '@/hooks/use-documentation-url';
|
||||||
import Back from '@/icons/Back';
|
import Back from '@/icons/Back';
|
||||||
import Delete from '@/icons/Delete';
|
import Delete from '@/icons/Delete';
|
||||||
import More from '@/icons/More';
|
import More from '@/icons/More';
|
||||||
|
@ -54,6 +55,7 @@ const ApplicationDetails = () => {
|
||||||
const api = useApi();
|
const api = useApi();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const formMethods = useForm<Application>();
|
const formMethods = useForm<Application>();
|
||||||
|
const documentationUrl = useDocumentationUrl();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
|
@ -145,15 +147,21 @@ const ApplicationDetails = () => {
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.operations}>
|
<div className={styles.operations}>
|
||||||
{/* TODO: @Charles figure out a better way to check guide availability */}
|
{/* TODO: @Charles figure out a better way to check guide availability */}
|
||||||
{data.type !== ApplicationType.MachineToMachine && (
|
<Button
|
||||||
<Button
|
title="application_details.check_guide"
|
||||||
title="application_details.check_guide"
|
size="large"
|
||||||
size="large"
|
onClick={() => {
|
||||||
onClick={() => {
|
if (data.type === ApplicationType.MachineToMachine) {
|
||||||
setIsReadmeOpen(true);
|
window.open(
|
||||||
}}
|
`${documentationUrl}/docs/recipes/integrate-logto/machine-to-machine/`,
|
||||||
/>
|
'_blank'
|
||||||
)}
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setIsReadmeOpen(true);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<Drawer isOpen={isReadmeOpen} onClose={onCloseDrawer}>
|
<Drawer isOpen={isReadmeOpen} onClose={onCloseDrawer}>
|
||||||
<Guide isCompact app={data} onClose={onCloseDrawer} />
|
<Guide isCompact app={data} onClose={onCloseDrawer} />
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
Loading…
Add table
Reference in a new issue