diff options
| author | Haishan <[email protected]> | 2019-11-14 00:24:50 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2019-11-14 00:24:50 +0800 |
| commit | da26c898fb666f65945b372d8d0e26d418bb272d (patch) | |
| tree | eb08a6db61af3d8b3234426b71845e9d2923d452 /src/components/Connections.js | |
| parent | ab61e8492606c0ba4937467d32835a878b259e34 (diff) | |
chore: add place holder when there is no connections data
Diffstat (limited to 'src/components/Connections.js')
| -rw-r--r-- | src/components/Connections.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/Connections.js b/src/components/Connections.js index 66ce2ef..38b26a2 100644 --- a/src/components/Connections.js +++ b/src/components/Connections.js @@ -4,8 +4,11 @@ import ConnectionTable from 'c/ConnectionTable'; import useRemainingViewPortHeight from '../hooks/useRemainingViewPortHeight'; import { useStoreState } from 'm/store'; import { getClashAPIConfig } from 'd/app'; +import SvgYacd from './SvgYacd'; import * as connAPI from '../api/connections'; +import s from './Connections.module.css'; + const { useEffect, useState } = React; const paddingBottom = 30; @@ -45,7 +48,13 @@ function Conn() { <div style={{ height: containerHeight - paddingBottom, overflow: 'auto' }} > - <ConnectionTable data={conns} /> + {conns.length > 0 ? ( + <ConnectionTable data={conns} /> + ) : ( + <div className={s.placeHolder}> + <SvgYacd width={200} height={200} c1="var(--color-text)" /> + </div> + )} </div> </div> </div> |
