Skip to content

Commit

Permalink
feat: add profile card
Browse files Browse the repository at this point in the history
  • Loading branch information
Melichka committed Sep 2, 2024
1 parent d5d8c3f commit 9662305
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Card } from "@mui/material"
import { styled } from "@mui/material/styles"

export const ProfileCardContainer = styled(Card)({
display: "flex",
alignItems: "center",
padding: "16px",
cursor: "pointer",
transition: "0.3s",
flexDirection: "row",
width: "100%",
"&:hover": {
boxShadow: "0px 4px 20px rgba(0, 0, 0, 0.1)",
},
})

export const Avatar = styled("img")({
width: "50px",
height: "50px",
borderRadius: "50%",
marginRight: "16px",
})

export const ProfileName = styled("div")({
flexGrow: 1,
fontSize: "18px",
fontWeight: "bold",
})

export const ArrowIcon = styled("div")({
marginLeft: "auto",
display: "flex",
alignItems: "center",
})
27 changes: 27 additions & 0 deletions application/frontend/src/components/ProfileCard/ProfileCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"

import ArrowForwardIcon from "@mui/icons-material/ArrowForward"

import { ArrowIcon, Avatar, ProfileCardContainer, ProfileName } from "./ProfileCard.styled"

interface ProfileCardProps {
profile: {
id: number
name: string
avatar: string
}
}

export const ProfileCard: React.FC<ProfileCardProps> = ({ profile }) => {
return (
<ProfileCardContainer>
<Avatar src={profile.avatar} alt={profile.name} />
<ProfileName>{profile.name}</ProfileName>
<ArrowIcon>
<ArrowForwardIcon />
</ArrowIcon>
</ProfileCardContainer>
)
}

export default ProfileCard
1 change: 1 addition & 0 deletions application/frontend/src/components/ProfileCard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ProfileCard } from "./ProfileCard"

0 comments on commit 9662305

Please sign in to comment.