-
Notifications
You must be signed in to change notification settings - Fork 5
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 #23 from CMP26Projects/captain-profile
⚛️ Captain profile
- Loading branch information
Showing
6 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
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,53 @@ | ||
import { useSelector } from "react-redux"; | ||
import Button from "../common/Button"; | ||
import PageTitle from "../common/PageTitle"; | ||
import "./CaptainProfile.scss"; | ||
|
||
export default function CaptainProfile() { | ||
const { userInfo } = useSelector((state) => state.auth); | ||
|
||
return ( | ||
<div className="captain-profile"> | ||
<PageTitle title="الصفحة الشخصية" /> | ||
<div className="captain-profile__avatar"> | ||
<img src="./avatar.png" alt="captain avatar" /> | ||
</div> | ||
<h4 className="captain-profile__name"> | ||
{userInfo.firstName} {userInfo.middleName} {userInfo.lastName} | ||
</h4> | ||
<h6 className="captain-profile__type"> | ||
{ | ||
{ | ||
general: "قائد / نائب قائد عام", | ||
regular: "قائد", | ||
unit: "قائد وحدة", | ||
}[userInfo.type] | ||
} | ||
</h6> | ||
<div className="captain-profile__info"> | ||
<h4>وسائل التواصل</h4> | ||
<div className="captain-profile__info__item"> | ||
<h6> رقم التليفون</h6> | ||
<p>{userInfo.phoneNumber}</p> | ||
</div> | ||
<div className="captain-profile__info__item"> | ||
<h6>البريد الالكتروني</h6> | ||
<p>{userInfo.email}</p> | ||
</div> | ||
<div className="captain-profile__info__item"> | ||
<h6>القطاعات</h6> | ||
<p> | ||
{/* TODO: Handle What will be displayed to General and unit captains */} | ||
{userInfo.rSectorBaseName | ||
? userInfo.rSectorBaseName + " " + userInfo.rSectorSuffixName | ||
: "لا يوجد"} | ||
</p> | ||
</div> | ||
{/* TODO: Add the route for The Button Later */} | ||
<Button className="captain-profile__info__btn Button--medium Button--primary"> | ||
تعديل الصفحة الشخصية | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
} |
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,50 @@ | ||
.captain-profile { | ||
&__avatar { | ||
display: flex; | ||
justify-content: center; | ||
margin-block: 1rem; | ||
|
||
img { | ||
border-radius: 50%; | ||
} | ||
} | ||
|
||
&__name, | ||
&__type { | ||
text-align: center; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
&__type { | ||
color: var(--primary-100); | ||
} | ||
|
||
&__info { | ||
width: 90vw; | ||
margin-inline: auto; | ||
padding: 20px; | ||
background-color: var(--primary-900); | ||
border-radius: 30px; | ||
|
||
h4 { | ||
text-align: center; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
&__item { | ||
direction: rtl; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
margin-bottom: 2rem; | ||
|
||
h6 { | ||
color: var(--primary-200); | ||
} | ||
} | ||
&__btn { | ||
margin-inline: auto; | ||
display: block; | ||
} | ||
} | ||
} |
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