-
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 #12 from aswanthabam/feature
feat : Dashboard Basic
- Loading branch information
Showing
10 changed files
with
288 additions
and
24 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
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,118 @@ | ||
.userCard { | ||
/* width: calc(100% - 40px); */ | ||
width: calc(100% - 40px); | ||
height: 60vw; | ||
max-width: 500px; | ||
max-height: 300px; | ||
padding: 20px; | ||
border-radius: 20px; | ||
position: relative; | ||
background: var(--color-2); | ||
|
||
.top { | ||
width: 100%; | ||
display: flex; | ||
gap: 50px; | ||
align-items: center; | ||
.img { | ||
width: 60px; | ||
height: 60px; | ||
& img { | ||
width: 60px; | ||
height: 60px; | ||
border-radius: 50%; | ||
border: 5px solid var(--color-4); | ||
} | ||
} | ||
|
||
.details { | ||
& span { | ||
display: block; | ||
} | ||
.name { | ||
font-size: 20px; | ||
} | ||
.college { | ||
font-size: 13px; | ||
color: var(--color-4); | ||
} | ||
.course { | ||
font-size: 10px; | ||
color: var(--color-4); | ||
} | ||
} | ||
} | ||
|
||
.bottom { | ||
margin-top: 20px; | ||
.userId { | ||
position: absolute; | ||
background: var(--color-4); | ||
width: calc(100% - 20px); | ||
bottom: 0; | ||
left: 0; | ||
padding: 10px; | ||
border-radius: 0 0 20px 20px; | ||
display: flex; | ||
justify-content: space-between; | ||
color: var(--color-orange); | ||
font-weight: 600; | ||
|
||
.email { | ||
font-size: 13px; | ||
color: var(--color-3); | ||
} | ||
} | ||
.participate { | ||
width: calc(100% - 0px); | ||
height: 100px; | ||
padding: 10px 0; | ||
/* padding: 10px; */ | ||
border-top: 2px solid var(--color-4); | ||
color: var(--color-black); | ||
& h5 { | ||
font-size: 15px; | ||
} | ||
.events { | ||
display: block; | ||
margin-top: 10px; | ||
font-size: 13px; | ||
color: var(--color-green); | ||
|
||
& span { | ||
display: inline-block; | ||
background: var(--color-3); | ||
padding: 5px 10px; | ||
border-radius: 5px; | ||
margin-right: 10px; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media screen and (min-width: 768px) { | ||
.userCard { | ||
.top { | ||
.img { | ||
width: 100px; | ||
height: 100px; | ||
& img { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
} | ||
.details { | ||
.name { | ||
font-size: 30px; | ||
} | ||
.college { | ||
font-size: 20px; | ||
} | ||
.course { | ||
font-size: 15px; | ||
} | ||
} | ||
} | ||
} | ||
} |
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,61 @@ | ||
import style from "./UserCard.module.css"; | ||
import { _Event, _UserDetails } from "../../types"; | ||
import { useEffect } from "react"; | ||
import defaultProfile from "../../assets/frlIf.png"; | ||
|
||
interface UserCardProps { | ||
details: _UserDetails; | ||
participations: [] | null; | ||
} | ||
|
||
const UserCard: React.FC<UserCardProps> = ({ details, participations }) => { | ||
// useEffect(() => {}); | ||
var year: string; | ||
if (details.year == 1) year = "1st Year"; | ||
else if (details.year == 2) year = "2nd Year"; | ||
else if (details.year == 3) year = "3rd Year"; | ||
else year = details.year + " Year"; | ||
console.log(participations); | ||
var pars = ""; | ||
if (!participations || participations!.length < 1) | ||
pars = "<span>Not Registered in any events!</span>"; | ||
else { | ||
for (var i = 0; i < participations!.length; i++) { | ||
pars += "<span>" + (participations![i] as any)["name"] + "</span>"; | ||
// if (i < participations!.length - 1) { | ||
// pars += ", "; | ||
// } | ||
} | ||
} | ||
return ( | ||
<div className={style.userCard}> | ||
<div className={style.top}> | ||
<div className={style.img}> | ||
<img src={details.picture ? details.picture : defaultProfile} /> | ||
</div> | ||
<div className={style.details}> | ||
<h2 className={style.name}>{details.name}</h2> | ||
<span className={style.college}>{details.college}</span> | ||
<span className={style.course}> | ||
{details.course} - {year} | ||
</span> | ||
</div> | ||
</div> | ||
<div className={style.bottom}> | ||
<span className={style.userId}> | ||
<span className={style.email}>{details.email}</span> | ||
<span>{details.userId} </span> | ||
</span> | ||
<div className={style.participate}> | ||
<h5>Registered Events</h5> | ||
<div | ||
className={style.events} | ||
dangerouslySetInnerHTML={{ __html: pars }} | ||
></div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserCard; |
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
Oops, something went wrong.