-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9044abd
commit 74d9ef3
Showing
8 changed files
with
119 additions
and
86 deletions.
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
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
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,5 @@ | ||
import React from 'react'; | ||
|
||
export default function User() { | ||
return <div>User</div>; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
import * as React from 'react'; | ||
import Card from '@mui/material/Card'; | ||
import CardContent from '@mui/material/CardContent'; | ||
import CardMedia from '@mui/material/CardMedia'; | ||
import Typography from '@mui/material/Typography'; | ||
import CardActionArea from '@mui/material/CardActionArea'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
interface UserCardProps { | ||
id: number; | ||
name: string; | ||
imgurl: string; | ||
} | ||
|
||
export default function UserCard({ id, name, imgurl }: UserCardProps) { | ||
const navigate = useNavigate(); | ||
|
||
const redirectToUser = (userId: number) => { | ||
navigate(`/home/${userId}`); | ||
}; | ||
|
||
return ( | ||
<Card sx={{ maxWidth: 345 }} onClick={() => redirectToUser(id)}> | ||
<CardActionArea> | ||
<CardMedia | ||
component="img" | ||
height="140" | ||
image={imgurl} | ||
alt="green meow" | ||
/> | ||
<CardContent> | ||
<Typography gutterBottom variant="h5" component="div"> | ||
{name} | ||
</Typography> | ||
</CardContent> | ||
</CardActionArea> | ||
</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