diff --git a/src/components/UI/DataTable.tsx b/src/components/UI/DataTable.tsx index 1aa5341ce9..55df07c493 100644 --- a/src/components/UI/DataTable.tsx +++ b/src/components/UI/DataTable.tsx @@ -1,4 +1,15 @@ -import { Link, Table, Thead, Tr, Th, TableContainer, Text, Tbody, Td } from '@chakra-ui/react'; +import { + Link, + Table, + Thead, + Tr, + Th, + TableContainer, + Text, + Tbody, + Td, + Stack +} from '@chakra-ui/react'; import { FC } from 'react'; import { OpenPGPSignaturesData, ReleaseData } from '../../types'; import { getParsedDate } from '../../utils'; @@ -30,26 +41,34 @@ export const DataTable: FC = ({ columnHeaders, data }) => { pb={4} > - - - {columnHeaders.map((columnHeader, idx) => { - return ( - - ); - })} - - + {data.length > 0 && ( + + + {columnHeaders.map((columnHeader, idx) => { + return ( + + ); + })} + + + )} + {data.length === 0 && ( + + No builds found + + )} + {dataType === 'Releases' && data.map((r: ReleaseData, idx: number) => { return ( diff --git a/src/components/UI/downloads/DownloadsTable.tsx b/src/components/UI/downloads/DownloadsTable.tsx index 7b3263313c..b8a45207c6 100644 --- a/src/components/UI/downloads/DownloadsTable.tsx +++ b/src/components/UI/downloads/DownloadsTable.tsx @@ -12,6 +12,7 @@ interface Props { windowsData: ReleaseData[]; iOSData: ReleaseData[]; androidData: ReleaseData[]; + totalReleasesNumber: number; amountOfReleasesToShow: number; setTotalReleases: (idx: number) => void; } @@ -22,6 +23,7 @@ export const DownloadsTable: FC = ({ windowsData, iOSData, androidData, + totalReleasesNumber, amountOfReleasesToShow, setTotalReleases }) => { @@ -36,7 +38,14 @@ export const DownloadsTable: FC = ({ const LAST_2_LINUX_RELEASES = amountOfReleasesToShow + 12; return ( - + setTotalReleases(totalReleases[idx])}> {DOWNLOADS_TABLE_TABS.map((tab, idx) => { diff --git a/src/pages/downloads.tsx b/src/pages/downloads.tsx index 06f546df22..720f3020ed 100644 --- a/src/pages/downloads.tsx +++ b/src/pages/downloads.tsx @@ -368,6 +368,7 @@ const DownloadsPage: NextPage = ({ data }) => { windowsData={ALL_WINDOWS_STABLE_RELEASES} iOSData={ALL_IOS_STABLE_RELEASES} androidData={ALL_ANDROID_STABLE_RELEASES} + totalReleasesNumber={totalStableReleases} amountOfReleasesToShow={amountStableReleases} setTotalReleases={setTotalStableReleases} /> @@ -423,6 +424,7 @@ const DownloadsPage: NextPage = ({ data }) => { windowsData={ALL_WINDOWS_DEV_BUILDS} iOSData={ALL_IOS_DEV_BUILDS} androidData={ALL_ANDROID_DEV_BUILDS} + totalReleasesNumber={totalDevBuilds} amountOfReleasesToShow={amountDevBuilds} setTotalReleases={setTotalDevBuilds} />
- - {columnHeader} - -
+ + {columnHeader} + +