From 283888d645554b687bfa65a9fd0e50813bd763ea Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 27 Aug 2023 15:23:13 +0800 Subject: [PATCH] feat(openapi): allow app back action which back to app list --- .../src/MainPanel/AppInfo/index.tsx | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/client/web/plugins/com.msgbyte.openapi/src/MainPanel/AppInfo/index.tsx b/client/web/plugins/com.msgbyte.openapi/src/MainPanel/AppInfo/index.tsx index c96830ed..ef6794e5 100644 --- a/client/web/plugins/com.msgbyte.openapi/src/MainPanel/AppInfo/index.tsx +++ b/client/web/plugins/com.msgbyte.openapi/src/MainPanel/AppInfo/index.tsx @@ -1,10 +1,21 @@ import React, { useMemo } from 'react'; -import { SidebarView } from '@capital/component'; -import { Loadable } from '@capital/common'; +import { Icon, SidebarView } from '@capital/component'; +import { Loadable, useEvent } from '@capital/common'; import { useOpenAppInfo } from '../context'; import { Translate } from '../../translate'; +import styled from 'styled-components'; import './index.less'; +const MenuTitle = styled.div` + display: flex; + + .iconify { + margin-right: 4px; + font-size: 16px; + cursor: pointer; + } +`; + // const Summary = Loadable(() => import('./Summary')); const Profile = Loadable(() => import('./Profile')); const Bot = Loadable(() => import('./Bot')); @@ -12,13 +23,21 @@ const Webpage = Loadable(() => import('./Webpage')); const OAuth = Loadable(() => import('./OAuth')); const AppInfo: React.FC = React.memo(() => { - const { appName } = useOpenAppInfo(); + const { appName, onSelectApp } = useOpenAppInfo(); + + const handleBack = useEvent(() => { + onSelectApp(null); + }); const menu = useMemo( () => [ { type: 'group', - title:
{appName}
, + title: ( + + {appName} + + ), children: [ // { // type: 'item',