mirror of
https://github.com/docmost/docmost.git
synced 2025-11-14 16:51:47 +10:00
show button only if necessary
This commit is contained in:
@ -13,9 +13,9 @@ import { IconArrowRight } from "@tabler/icons-react";
|
||||
|
||||
export default function SpaceGrid() {
|
||||
const { t } = useTranslation();
|
||||
const { data, isLoading } = useGetSpacesQuery({ page: 1, limit: 9 });
|
||||
const { data, isLoading } = useGetSpacesQuery({ page: 1, limit: 10 });
|
||||
|
||||
const cards = data?.items.map((space, index) => (
|
||||
const cards = data?.items.slice(0, 9).map((space, index) => (
|
||||
<Card
|
||||
key={space.id}
|
||||
p="xs"
|
||||
@ -55,6 +55,7 @@ export default function SpaceGrid() {
|
||||
|
||||
<SimpleGrid cols={{ base: 1, xs: 2, sm: 3 }}>{cards}</SimpleGrid>
|
||||
|
||||
{data?.items && data.items.length > 9 && (
|
||||
<Group justify="flex-end" mt="lg">
|
||||
<Button
|
||||
component={Link}
|
||||
@ -66,6 +67,7 @@ export default function SpaceGrid() {
|
||||
{t("View all spaces")}
|
||||
</Button>
|
||||
</Group>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user