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 TabNav, { TabNavItem } from '@/components/TabNav';
|
||||
import useApi, { RequestError } from '@/hooks/use-api';
|
||||
import useDocumentationUrl from '@/hooks/use-documentation-url';
|
||||
import Back from '@/icons/Back';
|
||||
import Delete from '@/icons/Delete';
|
||||
import More from '@/icons/More';
|
||||
|
@ -54,6 +55,7 @@ const ApplicationDetails = () => {
|
|||
const api = useApi();
|
||||
const navigate = useNavigate();
|
||||
const formMethods = useForm<Application>();
|
||||
const documentationUrl = useDocumentationUrl();
|
||||
|
||||
const {
|
||||
handleSubmit,
|
||||
|
@ -145,15 +147,21 @@ const ApplicationDetails = () => {
|
|||
</div>
|
||||
<div className={styles.operations}>
|
||||
{/* TODO: @Charles figure out a better way to check guide availability */}
|
||||
{data.type !== ApplicationType.MachineToMachine && (
|
||||
<Button
|
||||
title="application_details.check_guide"
|
||||
size="large"
|
||||
onClick={() => {
|
||||
if (data.type === ApplicationType.MachineToMachine) {
|
||||
window.open(
|
||||
`${documentationUrl}/docs/recipes/integrate-logto/machine-to-machine/`,
|
||||
'_blank'
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
setIsReadmeOpen(true);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Drawer isOpen={isReadmeOpen} onClose={onCloseDrawer}>
|
||||
<Guide isCompact app={data} onClose={onCloseDrawer} />
|
||||
</Drawer>
|
||||
|
|
Loading…
Add table
Reference in a new issue