-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from JimTheCat/CU-8696pcy8n_Create-friends-pag…
…e_Patryk-Kosiski Cu 8696pcy8n create friends page patryk kosiski
- Loading branch information
Showing
6 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {Avatar, Card, Group, Stack, Text} from "@mantine/core"; | ||
import {useNavigate} from "react-router-dom"; | ||
|
||
export const FriendDetailed = (props: { friend: any }) => { | ||
|
||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<Card | ||
p="lg" | ||
withBorder | ||
shadow={"lg"} | ||
onClick={() => navigate(`/profile/${props.friend.tag}`)} | ||
style={{cursor: "pointer"}} | ||
> | ||
{/*Friend detailed view*/} | ||
<Group justify="space-between"> | ||
<Avatar src={props.friend.avatar} size={"lg"} radius={180}/> | ||
<Stack gap={0}> | ||
<Text>{props.friend.name}</Text> | ||
<Text>{props.friend.tag}</Text> | ||
</Stack> | ||
</Group> | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './FriendDetailed'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {Card, Center, Group, SimpleGrid, Text, Title} from "@mantine/core"; | ||
import {FriendDetailed} from "../../Components/FriendDetailed"; | ||
|
||
type SuggestedUser = { | ||
id: number; | ||
name: string; | ||
avatar: string; | ||
tag: string; | ||
}; | ||
|
||
const dummyUsers: SuggestedUser[] = [ | ||
{id: 1, name: "Alice Johnson", avatar: "https://via.placeholder.com/40", tag: "@alicejohnson"}, | ||
{id: 2, name: "Bob Smith", avatar: "https://via.placeholder.com/40", tag: "@bobsmith"}, | ||
{id: 3, name: "Charlie Brown", avatar: "https://via.placeholder.com/40", tag: "@charliebrown"}, | ||
{id: 4, name: "David Johnson", avatar: "https://via.placeholder.com/40", tag: "@davidjohnson"}, | ||
{id: 5, name: "Eve Johnson", avatar: "https://via.placeholder.com/40", tag: "@evejohnson"}, | ||
{id: 6, name: "Frank Johnson", avatar: "https://via.placeholder.com/40", tag: "@frankjohnson"}, | ||
{id: 7, name: "Grace Johnson", avatar: "https://via.placeholder.com/40", tag: "@gracejohnson"}, | ||
{id: 8, name: "Hannah Johnson", avatar: "https://via.placeholder.com/40", tag: "@hannahjohnson"}, | ||
{id: 9, name: "Isaac Johnson", avatar: "https://via.placeholder.com/40", tag: "@isaacjohnson"}, | ||
{id: 10, name: "Jack Johnson", avatar: "https://via.placeholder.com/40", tag: "@jackjohnson"}, | ||
{id: 11, name: "Katie Johnson", avatar: "https://via.placeholder.com/40", tag: "@katiejohnson"}, | ||
]; | ||
|
||
export const Friends = () => { | ||
return ( | ||
<Center> | ||
<Card shadow="sm" padding="lg" m={"md"} radius="md" w={"fit-content"} withBorder> | ||
<Group justify={"space-between"} align={"flex-start"}> | ||
<Title mb={"md"} order={2}> | ||
List of friends | ||
</Title> | ||
<Text> | ||
Total friends: {dummyUsers.length} | ||
</Text> | ||
</Group> | ||
{/*List of friends*/} | ||
<SimpleGrid cols={3} spacing="lg"> | ||
{dummyUsers.map((user) => ( | ||
<FriendDetailed key={user.id} friend={user}/> | ||
))} | ||
</SimpleGrid> | ||
</Card> | ||
</Center> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Friends' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters