diff --git a/app/components/empty.js b/app/components/empty.js new file mode 100644 index 00000000..9e3d5144 --- /dev/null +++ b/app/components/empty.js @@ -0,0 +1,72 @@ +import React from 'react' +import styled from 'styled-components' +import Icon from './icon' + +const Main = styled.main` + position: relative; + .skeleton { + position: fixed; + top: 3.5rem; + left: 1.25rem; + width: 232px; + max-width: 100vw; + } + .dotted-lines { + position: absolute; + top: 0.25rem; + right: 5.5rem; + width: 17rem; + z-index: 3; + } + .create-new-dat, + .link { + position: absolute; + width: 15rem; + color: var(--color-neutral-30); + svg { + display: inline-block; + width: 2rem; + height: 2rem; + } + } + .create-new-dat { + top: 14.5rem; + right: 4rem; + } + .link { + top: 6rem; + right: 8.5rem; + svg { + margin-bottom: -0.75rem; + } + } +` + +const Empty = () => ( +
+ +
+ +
+ +

Download A Dat

+

+ … and keep data up-to-date +
+ by entering the link here. +

+
+
+ +

Share a Folder

+

+ … and sync changes by sharing +
+ the link with someone else. +

+
+
+
+) + +export default Empty diff --git a/app/components/table.js b/app/components/table.js index e5a60f59..0d2e12fa 100644 --- a/app/components/table.js +++ b/app/components/table.js @@ -3,6 +3,7 @@ import React from 'react' import styled from 'styled-components' import TableRow from './table-row' +import Empty from './empty' const StyledTable = styled.table` width: 100%; @@ -39,31 +40,35 @@ const StyledTable = styled.table` } ` -const Table = ({ dats, shareDat, onDeleteDat }) => ( -
- - - - - Link - Status - Size - Peers - - - - - {Object.keys(dats).map(key => ( - - ))} - - -
-) +const Table = ({ dats, shareDat, onDeleteDat }) => { + if (!Object.keys(dats).length) return + + return ( +
+ + + + + Link + Status + Size + Peers + + + + + {Object.keys(dats).map(key => ( + + ))} + + +
+ ) +} export default Table