Skip to content

Commit

Permalink
fix(setting_page): improved more on setting page
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-ojha committed Jun 6, 2022
1 parent 5f6256f commit 0416f1f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 27 deletions.
5 changes: 4 additions & 1 deletion client/src/components/SettingPage/ChangeDisplayName.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ const ChangeDisplayName = () => {
return (
<>
<div className="Setting_Container_With_Input_Field">
<h1>Change display name</h1>
<label htmlFor="setting-page-change-display-name">
Change display name
</label>
<form>
<input
id="setting-page-change-display-name"
type="text"
placeholder="Display Name"
name="name"
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/SettingPage/ChangePassword.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const ChangePassword = () => {
return (
<>
<div className="Setting_Container_With_Input_Field">
<h1>Change Password</h1>
<label htmlFor="setting-page-change-password">Change Password</label>
<input
type="password"
placeholder="Old password"
Expand All @@ -74,6 +74,7 @@ const ChangePassword = () => {
/>
<form>
<input
id="setting-page-change-password"
type="password"
placeholder="Conform password"
name="cNewPassword"
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/SettingPage/ChangeProfilePicture.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ const ChangeProfilePicture = () => {
return (
<>
<div className="Setting_Page_Change_Profile_Picture_Container">
<h1>Change Profile Picture</h1>
<label htmlFor="setting-page-change-profile-picture">
Change Profile Picture
</label>
<div className="Setting_Page_Change_Profile_Picture_Container_Top_Part">
<label htmlFor="user-profile-input">
<img
Expand Down Expand Up @@ -130,6 +132,7 @@ const ChangeProfilePicture = () => {
/>
<div className="Setting_Page_Change_Profile_Input_and_Button_Container">
<input
id="setting-page-change-profile-picture"
type="text"
placeholder="image url"
className="Setting_Page_Change_Profile_Url_Image_Input_Field"
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/SettingPage/ChangeUserID.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ const ChangeUserID = () => {
return (
<>
<div className="Setting_Container_With_Input_Field">
<h1>Change UserID</h1>
<label htmlFor="setting-page-change-userID">Change UserID</label>
<form>
<input
id="setting-page-change-userID"
type="text"
placeholder="UserID"
name="userID"
Expand Down
22 changes: 22 additions & 0 deletions client/src/components/SettingPage/DeleteProfile.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { toastInfo } from "../../services/toast";

const DeleteProfile = () => {
const deleteUser = (e) => {
e.preventDefault();
toastInfo("Sorry!! this feature is not available right now");
};
return (
<>
<div className="Setting_Page_Delete_User_Profile_Container">
<h1>Delete User Profile</h1>
<p>
NOTE : You can be able to recover after you delete your user profile
</p>
<button onClick={deleteUser}>Delete Profile</button>
</div>
</>
);
};

export default DeleteProfile;
24 changes: 3 additions & 21 deletions client/src/pages/Setting.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
import React, { useState } from "react";
import React from "react";
import { Helmet } from "react-helmet";
import "../styles/pages/settingPage.css";
import { useDispatch } from "react-redux";
import { startProgressBar, stopProgressBar } from "../services/redux-actions";
import LoadingSpinner from "../components/LoadingSpinner";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import Api from "../services/api/pages/settingPageApi";
import { toastError, toastInfo, toastSuccess } from "../services/toast";
import OpenRightPartDrawerButton from "../components/OpenRightPartDrawerButton";
import OpenSideBarDrawerButton from "../components/OpenSideBarDrawerButton";
import ChangeProfilePicture from "../components/SettingPage/ChangeProfilePicture";
import ChangeUserID from "../components/SettingPage/ChangeUserID";
import ChangeDisplayName from "../components/SettingPage/ChangeDisplayName";
import ChangePassword from "../components/SettingPage/ChangePassword";
import DeleteProfile from "../components/SettingPage/DeleteProfile";

const Setting = () => {
const dispatch = useDispatch();

const deleteUser = (e) => {
e.preventDefault();
toastInfo("Sorry!! this feature is not available right now");
};

return (
<>
<LoadingSpinner />
<main className="SettingPage_Container">
<ToastContainer />
<Helmet>
<title>Setting</title>
</Helmet>
Expand All @@ -37,13 +25,7 @@ const Setting = () => {
<ChangeUserID />
<ChangeDisplayName />
<ChangePassword />
<div className="Setting_Page_Delete_User_Profile_Container">
<h1>Delete User Profile</h1>
<p>
NOTE : You can be able to recover after you delete your user profile
</p>
<button onClick={deleteUser}>Delete Profile</button>
</div>
<DeleteProfile />
</main>
</>
);
Expand Down
4 changes: 2 additions & 2 deletions client/src/styles/pages/settingPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
margin-top: 10px;
border-radius: 10px;
}
.Setting_Page_Change_Profile_Picture_Container h1 {
.Setting_Page_Change_Profile_Picture_Container label {
font-size: 0.9rem;
font-family: var(--primary-font-family);
margin: 10px 0px 0px 10px;
Expand Down Expand Up @@ -118,7 +118,7 @@
align-items: flex-start;
/* box-shadow: 0px 0px 10px rgb(204, 204, 204); */
}
.Setting_Container_With_Input_Field h1,
.Setting_Container_With_Input_Field label,
.Setting_Page_Delete_User_Profile_Container h1,
.Setting_Page_Change_Profile_Picture_Container_Top_Part label h1 {
font-family: var(--primary-font-family);
Expand Down

0 comments on commit 0416f1f

Please sign in to comment.