Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web Spinner] Add User Profile Viewing Page #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pages/profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NextPage } from "next"
import { ReactElement } from "react"
import UserProfile from "src/components/dashboard/UserProfile"
import Menu from "src/components/menu/Menu"
import { AuthenticatedLayout } from "src/layouts"
import styles from "styles/Profile.module.scss"

const Profile: NextPage = (): ReactElement => (
<>
<Menu />
<div className={styles.container}>
<UserProfile />
</div>
</>
)

export default AuthenticatedLayout(Profile)
28 changes: 28 additions & 0 deletions src/components/dashboard/UserProfile/index.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@import "~styles/variables.scss";

.profileCard {
display: flex;
flex-direction: column;
align-items: center;
background-color: $card-background;
padding: 20px;
border-radius: 8px;
box-shadow: $box-shadow;
}

.avatar {
width: 100px;
height: 100px;
border-radius: 50%;
}

.name {
margin-top: 20px;
font-size: 1.5rem;
color: $text-primary;
}

.email {
margin-top: 8px;
color: $text-secondary;
}
17 changes: 17 additions & 0 deletions src/components/dashboard/UserProfile/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ReactElement } from "react"
import { useSelector } from "react-redux"
import styles from "./index.module.scss"

const UserProfile = (): ReactElement => {
const user = useSelector((state: any) => state.auth.user)

return (
<div className={styles.profileCard}>
<img src={user.avatar} alt="User Avatar" className={styles.avatar} />
<h1 className={styles.name}>{user.name}</h1>
<p className={styles.email}>{user.email}</p>
</div>
)
}

export default UserProfile
9 changes: 9 additions & 0 deletions styles/Profile.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import "./variables.scss";
@import "./mixins.scss";

.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}