-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
62 lines (58 loc) · 1.9 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import GradientLayout from "../components/gradientLayout";
import { GetServerSidePropsContext } from "next";
import prisma from "../lib/prisma";
import { Box, Flex, Text } from "@chakra-ui/layout";
import { Image } from "@chakra-ui/react";
import { useMe } from "../lib/hooks";
import React from "react";
const Home = ({ artists }) => {
const { user, isLoading } = useMe();
return (
<GradientLayout
color="purple"
roundImage
title={`${user?.firstName}'s Artists`}
subtitle="hello"
description={`${user?.playlistCount} public playlists`}
isLoading={isLoading}
image="https://tinted-gym-f99.notion.site/image/https%3A%2F%2Fdl.dropboxusercontent.com%2Fs%2Fbgiv0ssz3xpotz9%2Fpeep.png%3Fdl%3D0?table=block&id=33f9771b-0e6f-4a72-832c-69ed2d41f290&spaceId=511cd811-5561-4a61-b550-c4086b4afafb&width=2000&userId=&cache=v2"
>
<Box color="white" paddingX="40px">
<Box marginBottom="40px">
<Text fontSize={"2xl"} fontWeight="bold">
Top artists this month
</Text>
</Box>
<Flex gap={"2rem"}>
{artists?.map((artist: { id: number; name: string }) => (
<Box
key={artist.id}
bg="gray.900"
borderRadius={"4px"}
padding="15px"
width="20%"
>
<Image
src="https://placekitten.com/300/300"
borderRadius={"100%"}
/>
<Box marginTop={"1rem"}>
<Text fontSize={"large"}>{artist.name}</Text>
<Text fontSize={"small"}>Artist</Text>
</Box>
</Box>
))}
</Flex>
</Box>
</GradientLayout>
);
};
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const artists = await prisma.artist.findMany({});
return {
props: {
artists,
},
};
};
export default Home;