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

Edit Profile UI #1128

Merged
merged 29 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2254996
moved search to navbar and displayed in a modal
anamika7153 Jul 28, 2023
093c3bd
Merge branch 'master' into master
narayan954 Jul 28, 2023
7b648b5
Merge branch 'master' into master
narayan954 Jul 28, 2023
c9dd363
Merge branch 'master' of https://github.com/narayan954/dummygram
anamika7153 Jul 28, 2023
898130b
Merge branch 'master' of https://github.com/narayan954/dummygram
anamika7153 Jul 31, 2023
4f85ff9
Merge branch 'master' of https://github.com/narayan954/dummygram
anamika7153 Jul 31, 2023
675e127
Merge branch 'master' of https://github.com/narayan954/dummygram
anamika7153 Aug 2, 2023
6959c98
positioned story icons
anamika7153 Aug 2, 2023
3ef6b84
story ui
anamika7153 Aug 2, 2023
764ab33
Merge branch 'master' of https://github.com/anamika7153/dummygram
anamika7153 Aug 2, 2023
5e5e711
reduced css
anamika7153 Aug 2, 2023
ab44e26
Merge branch 'master' into master
narayan954 Aug 2, 2023
ca32506
style: format
narayan954 Aug 2, 2023
eef1079
Merge branch 'master' of https://github.com/narayan954/dummygram
anamika7153 Aug 3, 2023
530a4b9
Merge branch 'master' of https://github.com/anamika7153/dummygram
anamika7153 Aug 3, 2023
e31fb4b
Merge branch 'master' of https://github.com/narayan954/dummygram
anamika7153 Aug 4, 2023
7f170ae
ui change
anamika7153 Aug 4, 2023
7ad935c
responsive
anamika7153 Aug 4, 2023
f3f832b
edit icon
anamika7153 Aug 4, 2023
2ee7f06
Merge branch 'master' of https://github.com/narayan954/dummygram into…
anamika7153 Aug 4, 2023
c92db18
style: format
narayan954 Aug 4, 2023
e967656
responsive
anamika7153 Aug 5, 2023
c4d7698
merge
anamika7153 Aug 5, 2023
8d42ccb
minor fix
anamika7153 Aug 5, 2023
68ae13a
Merge branch 'edit-ui' of https://github.com/anamika7153/dummygram in…
anamika7153 Aug 5, 2023
4cb0cca
removed commentted code
anamika7153 Aug 5, 2023
3f91ada
fix
anamika7153 Aug 5, 2023
3fd9fb0
Merge branch 'master' into edit-ui
narayan954 Aug 5, 2023
9eb6edf
fix: styles
narayan954 Aug 5, 2023
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
79 changes: 69 additions & 10 deletions src/components/EditProfile/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
left: 50%;
width: 50%;
transform: translate(-50%, 0%);
padding: 60px;
padding: 30px;
background: var(--btn-color);
border-radius: 22px;
}

.edit-profile-sub-container {
Expand All @@ -15,6 +16,31 @@
justify-content: center;
flex-direction: column;
gap: 30px;
width: 98%;
margin: auto;
}

.edit-profile-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
margin: auto;
}

.edit-profile-image {
position: relative;
left: 50%;
transform: translateX(-50%);
height: 160px;
width: 160px;
display: flex;
}

.edit-profile-image img {
height: 100%;
width: 100%;
object-fit: cover;
}

.cancel-editing-icon {
Expand All @@ -25,14 +51,28 @@
cursor: pointer;
}

.edit-user-details {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
flex-direction: row;
}

.edit-profile-label {
font-weight: 600;
font-size: 17px;
color: var(--text-light-black);
padding: 22px 0 8px;
}

.edit-profile-input {
margin-top: 0;
width: 100% !important;
width: 95% !important;
background-color: transparent;
border: 0;
box-shadow: 15px 15px 21px 0px rgba(104,85,224,0.2);
border-bottom: 2px solid rgba(104, 85, 224, 0.5);
padding-bottom: 5px;
}

.edit-profile-img {
Expand All @@ -46,25 +86,23 @@
font-size: 16px;
height: 100px;
border: 1px solid rgba(104, 85, 224, 1);
border-top: 0;
border-radius: 4px;
box-shadow: 0 0 20px rgba(104, 85, 224, 0.2);
box-shadow: 17px 17px 21px 2px rgba(104,85,224,0.2);
}

.edit-profile-save-btn {
width: 100%;
padding: 10px;
border-radius: 8px;
font-size: 18px;
color: rgba(8, 17, 123, 0.69);
font-size: 20px;
font-weight: 600;
background-color: white;
border: none;
color: white;
background: linear-gradient(rgb(102, 102, 250), rgb(81, 81, 245));
cursor: pointer;
}

.edit-profile-save-btn:hover {
background: linear-gradient(rgb(64, 64, 198), rgb(81, 81, 245));
color: rgba(8, 17, 123, 0.9);

}

.edit-profile-save-btn:active {
Expand All @@ -74,3 +112,24 @@
.error-border {
border: 2px solid red;
}

@media only screen and (max-width: 900px) {
.edit-user-details {
flex-direction: column;
}
.edit-user-details label {
padding-bottom: 15px;
}
.edit-profile-container {
width: 60%;
left: 50%;
top: 100px;
}
}
@media only screen and (max-width: 600px) {
.edit-profile-container {
width: 75%;
left: 50%;
top: 100px;
}
}
106 changes: 56 additions & 50 deletions src/components/EditProfile/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { auth, db, storage } from "../../lib/firebase";
import { useRef, useState } from "react";

import CancelIcon from "@mui/icons-material/Cancel";
import BackIcon from "@mui/icons-material/ArrowBackIosNew";
import { ClickAwayListener } from "@mui/material";
import { useNavigate } from "react-router-dom";
import { useSnackbar } from "notistack";
Expand Down Expand Up @@ -193,11 +194,19 @@ const EditProfile = ({ userData, username, setIsEditing, setUserData }) => {
<ClickAwayListener onClickAway={() => setIsEditing(false)}>
<div className="edit-profile-container">
<div className="edit-profile-sub-container">
<CancelIcon
className="cancel-editing-icon"
onClick={() => setIsEditing(false)}
/>
<div>
<div className="edit-profile-header">
<BackIcon
onClick={() => setIsEditing(false)}
style={{ display: "flex", marginTop: "6px" }}
/>
<h2>Edit Profile</h2>
<div>
<span className="edit-profile-save-btn" onClick={handleImgSave}>
Save
</span>
</div>
</div>
<div className="edit-profile-image">
<input
type="file"
id="file"
Expand All @@ -209,36 +218,49 @@ const EditProfile = ({ userData, username, setIsEditing, setUserData }) => {
<img src={avatar} alt={name} className="edit-profile-img" />
</label>
</div>
<div className="edit-user-details">
{/* name */}
<label defaultValue={"Name"}>
<p className="edit-profile-label">Name</p>
<input
type="text"
value={name}
name="name"
className="edit-profile-input"
onChange={handleChange}
/>
</label>
{/* username */}
<label htmlFor="">
<p className="edit-profile-label">Username</p>
<input
type="text"
value={newUsername}
name="newUsername"
className={`edit-profile-input ${
usernameAvailable ? "" : "error-border"
}`}
ref={usernameRef}
onChange={(e) => {
usernameRef.current = e.target.value.trim();
handleChange(e);
checkUsername();
}}
/>
</label>
{/* country */}
<label htmlFor="">
<p className="edit-profile-label">Country</p>
<input
type="text"
name="country"
value={country}
className="edit-profile-input"
onChange={handleChange}
/>
</label>
</div>

{/* name */}
<label defaultValue={"Name"}>
<p className="edit-profile-label">Name</p>
<input
type="text"
value={name}
name="name"
className="edit-profile-input"
onChange={handleChange}
/>
</label>
{/* username */}
<label htmlFor="">
<p className="edit-profile-label">Username</p>
<input
type="text"
value={newUsername}
name="newUsername"
className={`edit-profile-input ${
usernameAvailable ? "" : "error-border"
}`}
ref={usernameRef}
onChange={(e) => {
usernameRef.current = e.target.value.trim();
handleChange(e);
checkUsername();
}}
/>
</label>
{/* bio */}
<label htmlFor="">
<p className="edit-profile-label">Bio</p>
Expand All @@ -253,22 +275,6 @@ const EditProfile = ({ userData, username, setIsEditing, setUserData }) => {
onChange={handleChange}
></textarea>
</label>
{/* country */}
<label htmlFor="">
<p className="edit-profile-label">Country</p>
<input
type="text"
name="country"
value={country}
className="edit-profile-input"
onChange={handleChange}
/>
</label>
<div>
<button className="edit-profile-save-btn" onClick={handleImgSave}>
Save
</button>
</div>
</div>
</div>
</ClickAwayListener>
Expand Down
2 changes: 2 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
--label-color: rgb(200, 246, 248);
--profile-color: #7d7575;
--text-light: rgba(0, 0, 0, 0.6);
--text-light-black: rgba(0, 0, 0, 0.6);
--text-dim: rgba(0, 0, 0, 0.8);
--post-error-boundary: rgba(0, 0, 0, 0.54);
--text-black-only: black;
Expand Down Expand Up @@ -56,6 +57,7 @@
--profile-color: #c8c6c6;
--text-black-only: black;
--text-light: rgba(255, 255, 255, 0.6);
--text-light-black: rgba(0, 0, 0, 0.6);
--text-dim: rgba(255, 255, 255, 0.8);
--post-error-boundary: rgba(255, 255, 255, 0.54);
--darkmode-white: white;
Expand Down
Loading