From d77eef44ff192f7da8ad92275ccef9c1865e7105 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Mon, 10 Jul 2023 16:04:40 +0800 Subject: [PATCH] feat(plugin): add bo data fallback in discover --- client/web/src/plugin/component/index.tsx | 1 + .../src/DiscoverPanel/index.tsx | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/web/src/plugin/component/index.tsx b/client/web/src/plugin/component/index.tsx index e022217c..d015f3f7 100644 --- a/client/web/src/plugin/component/index.tsx +++ b/client/web/src/plugin/component/index.tsx @@ -74,3 +74,4 @@ export { JumpToGroupPanelButton, JumpToConverseButton, } from '@/components/JumpToButton'; +export { NoData } from '@/components/NoData'; diff --git a/server/plugins/com.msgbyte.discover/web/plugins/com.msgbyte.discover/src/DiscoverPanel/index.tsx b/server/plugins/com.msgbyte.discover/web/plugins/com.msgbyte.discover/src/DiscoverPanel/index.tsx index cccc0907..be2520b7 100644 --- a/server/plugins/com.msgbyte.discover/web/plugins/com.msgbyte.discover/src/DiscoverPanel/index.tsx +++ b/server/plugins/com.msgbyte.discover/web/plugins/com.msgbyte.discover/src/DiscoverPanel/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useAsync } from '@capital/common'; -import { LoadingSpinner, ErrorView } from '@capital/component'; +import { LoadingSpinner, ErrorView, NoData } from '@capital/component'; import { request } from '../request'; import styled from 'styled-components'; import { DiscoverServerCard } from './DiscoverServerCard'; @@ -14,6 +14,7 @@ interface DiscoverServerItem { const Root = styled.div` width: 100%; + overflow: auto; `; const DiscoverServerHeader = styled.div` @@ -52,11 +53,15 @@ export const DiscoverPanel: React.FC = React.memo(() => { return ( {Translate.discoverHeader} - - {list.map((item, i) => ( - - ))} - + {Array.isArray(list) && list.length > 0 ? ( + + {list.map((item, i) => ( + + ))} + + ) : ( + + )} ); });