From da26c898fb666f65945b372d8d0e26d418bb272d Mon Sep 17 00:00:00 2001 From: Haishan Date: Thu, 14 Nov 2019 00:24:50 +0800 Subject: chore: add place holder when there is no connections data --- src/components/Connections.js | 11 ++++++++++- src/components/Connections.module.css | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/components/Connections.module.css (limited to 'src') 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() {
- + {conns.length > 0 ? ( + + ) : ( +
+ +
+ )}
diff --git a/src/components/Connections.module.css b/src/components/Connections.module.css new file mode 100644 index 0000000..4991f29 --- /dev/null +++ b/src/components/Connections.module.css @@ -0,0 +1,8 @@ +.placeHolder { + height: 100%; + display: flex; + align-items: center; + justify-content: center; + color: var(--color-background); + opacity: 0.1; +} -- cgit v1.3.1