Edit logo, schema

Took 1 hour 58 minutes
This commit is contained in:
Lucàs
2023-03-28 14:00:38 +02:00
parent e3344c5103
commit 28be7ce223
6 changed files with 86 additions and 28 deletions
+10 -10
View File
@@ -43,8 +43,8 @@ model User {
OtherUserLikesID String[] @db.ObjectId
OtherUserLikes User[] @relation("Likes", fields: [OtherUserLikesID], references: [id])
MatchId String[] @db.ObjectId
Match Match[] @relation(fields: [MatchId], references: [id])
MatchID String[] @db.ObjectId
Match Match[] @relation(fields: [MatchID], references: [id])
Notification Notification[]
}
@@ -55,16 +55,16 @@ model Notification {
createdAt DateTime @default(now())
hasBeenConsulted Boolean @default(false)
UserId String @db.ObjectId
User User @relation(fields: [UserId], references: [id])
UserID String @db.ObjectId
User User @relation(fields: [UserID], references: [id])
}
model Match {
id String @id @default(auto()) @map("_id") @db.ObjectId
createdAt DateTime @default(now())
UserId String[] @db.ObjectId
User User[] @relation(fields: [UserId], references: [id])
UserID String[] @db.ObjectId
User User[] @relation(fields: [UserID], references: [id])
}
model Passion {
@@ -74,8 +74,8 @@ model Passion {
updatedAt DateTime @updatedAt
// Les utilisateurs qui on en commun cette passion
UserId String[] @db.ObjectId
User User[] @relation(fields: [UserId], references: [id])
UserID String[] @db.ObjectId
User User[] @relation(fields: [UserID], references: [id])
}
model Chat {
@@ -84,8 +84,8 @@ model Chat {
createdAt DateTime @default(now())
// Les utilisateurs qui ont un chat en commun
User User[] @relation(fields: [UserId], references: [id])
UserId String[] @db.ObjectId
User User[] @relation(fields: [UserID], references: [id])
UserID String[] @db.ObjectId
}
model Message {
+2 -16
View File
@@ -1,17 +1,3 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="100pt" height="100pt" viewBox="0 0 416.000000 416.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,416.000000) scale(0.100000,-0.100000)"
fill="#805AD5" stroke="none">
<path d="M1912 3100 c-245 -64 -439 -266 -498 -517 -21 -89 -14 -258 14 -365
58 -217 202 -494 410 -791 114 -163 233 -312 249 -312 15 0 178 218 288 385
295 448 425 781 395 1013 -20 163 -82 288 -200 407 -169 170 -426 240 -658
180z m73 -435 c20 -8 49 -29 65 -47 l30 -32 30 32 c130 142 373 19 346 -175
-12 -93 -86 -193 -262 -358 l-114 -107 -111 104 c-175 163 -253 268 -265 361
-21 154 140 282 281 222z"/>
</g>
<svg width="44" height="64" viewBox="0 0 44 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.3529 0.678014C8.50033 2.7293 2.28238 9.20365 0.391357 17.2485C-0.28172 20.1011 -0.0573611 25.5178 0.840075 28.9472C2.69905 35.9024 7.31443 44.7806 13.9811 54.2998C17.6349 59.5242 21.4491 64.2998 21.9619 64.2998C22.4426 64.2998 27.667 57.3126 31.1926 51.9601C40.6478 37.6011 44.8144 26.928 43.8529 19.4921C43.2119 14.2678 41.2247 10.2613 37.4426 6.44724C32.026 0.998526 23.7888 -1.24506 16.3529 0.678014ZM18.6926 14.6203C19.3337 14.8767 20.2632 15.5498 20.776 16.1267L21.7375 17.1524L22.6991 16.1267C26.8657 11.5754 34.6542 15.5178 33.7888 21.7357C33.4042 24.7165 31.0324 27.9216 25.3914 33.2101L21.7375 36.6395L18.1798 33.3062C12.5708 28.0819 10.0708 24.7165 9.68623 21.7357C9.01315 16.7998 14.1734 12.6972 18.6926 14.6203Z" fill="#805AD5"/>
</svg>

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 858 B

+18
View File
@@ -0,0 +1,18 @@
import {Card, Text, Flex} from '@chakra-ui/react';
type Props = {
sender: 'me' | 'other'
message: string
}
export default function Message(props: Props) {
const {align, message} = props;
return (
<Flex alignItems={align === "me" ? 'end' : "start"}>
<Card display={'flex'} px={2} py={1} bg={'purple.500'}>
<Text>{message}</Text>
</Card>
</Flex>
);
}
+1 -1
View File
@@ -48,7 +48,7 @@ export default function Navbar({variant = "fixed"}: Props) {
backdropFilter={'auto'} backdropBlur={'20px'} px={10} py={2}>
<Flex align={'center'}>
<Box flexBasis={'100%'}>
<Image src={"/logo.svg"} h={"100px"} objectFit={"contain"}/>
<Image src={"/logo.svg"} h={"3rem"} objectFit={"contain"}/>
</Box>
<Flex gap={5} justify={'center'} flexBasis={'100%'}>
@@ -26,7 +26,7 @@ export default function CardUser(props) {
};
return (
<Card maxW="md" borderRadius={'1rem'} overflow={'hidden'}>
<Card w={"100%"} h={"100%"} borderRadius={'1rem'} overflow={'hidden'}>
<CardHeader>
<Carousel borderRadius={"1rem"} images={interestingUser.images}/>
</CardHeader>
+54
View File
@@ -0,0 +1,54 @@
import {Container, Flex, Text} from '@chakra-ui/react';
import Head from 'next/head';
import {websiteName} from '@/lib/constants';
import {useSession} from 'next-auth/react';
import {useRouter} from 'next/router';
import {useEffect} from 'react';
import Message from '@/components/Message';
export default function Chat() {
const router = useRouter();
const {data: session, status} = useSession();
const {id} = router.query;
useEffect(() => {
switch (status) {
case 'loading':
return;
case 'unauthenticated':
return router.push('/login');
case 'authenticated':
fetch(`/api/chats/${id}`).then(res => res.json()).then(chat => {
if (!chat.UserID.contain(session?.user?.id)) router.push('/login');
});
return;
}
}, [status]);
if (status === "loading") return <Text>Loading...</Text>
const messages = [
{sender: "me", message: "salut"},
{sender: "other", message: "salut"},
{sender: "me", message: "salut"},
{sender: "other", message: "salut"},
{sender: "me", message: "salut"},
{sender: "other", message: "salut"},
]
return (
<>
<Head><title>{websiteName}</title></Head>
<Container>
<Flex direction={'column'}>
{
messages.map(m => <Message sender={m.sender} message={m.message}/>)
}
</Flex>
<Text>Hello World {session?.user?.firstName ?? ""}</Text>
</Container>
</>
);
}