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

feat: UI Update #16

Merged
merged 1 commit into from
Oct 22, 2024
Merged
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
53 changes: 27 additions & 26 deletions client/src/pages/UserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,19 @@ function UserProfile() {
onClick={unfollowhandler}
>
Unfollow
<span>
<FaUserMinus aria-hidden="true" />
</span>
</button>
) : (
<button
className="btn profile-edit-btn"
onClick={followHandler}
>
Follow
<span>
<FaUserPlus aria-hidden="true" />
</span>
</button>
))}
<FaUserPlus aria-hidden="true" />
Expand Down Expand Up @@ -178,45 +182,42 @@ function UserProfile() {
)}
</div>

<div className="profile-stats">
<ul>
<li>
<span className="profile-stat-count">
{user?.blogs?.length}
</span>{" "}
posts
</li>

<li>
<span className="profile-stat-count">
{user?.followers.length}
</span>{" "}
followers
</li>
<li>
<span className="profile-stat-count">
{user?.following?.length}
</span>{" "}
following
</li>
</ul>
</div>
<div className="profile-bio">
<p>
<span className="profile-real-name uppercase">
<span className="profile-real-name">
{user.firstName} {user.lastName}
</span>
{/* <li> */}
<span className="profile-stat-count flex flex-row gap-2">
<span className="contributions profile-stat-count flex flex-row gap-2">
<FaCoins />
{user?.contributions} contributions
</span>{" "}
{/* </li> */}
<span className="profile-stat-count flex flex-row gap-2">
<span className="discription profile-stat-count flex flex-row gap-2">
{user?.additionalDetails?.about}
</span>
</p>
</div>
<div className="profile-stats">
<ul>
<li>
<span className="profile-stat-count profile-sub-stat-count">
{user?.blogs?.length} posts
</span>
</li>

<li>
<span className="profile-stat-count profile-sub-stat-count">
{user?.followers.length} followers
</span>
</li>
<li>
<span className="profile-stat-count profile-sub-stat-count">
{user?.following?.length} following
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
Expand Down
86 changes: 67 additions & 19 deletions client/src/utils/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ body {
}

.btn {
display: inline-block;
font: inherit;
background: none;
display: flex;
font: 1.75rem;
align-items: center;
gap: .5rem;
background-color: rgba(59, 131, 246, 0.75);
border: none;
color: inherit;
color: white;
padding: 0;
cursor: pointer;
}
Expand All @@ -72,14 +74,18 @@ body {

.profile {
padding: 2rem 0;
padding-right: 2rem;
border-bottom: 3px solid #888;
box-shadow: 0px 3px 10px 3px rgba(0, 0, 0, 0.05);
background-color: #f8f8f8;
}

.profile::after {
content: "";
display: block;
clear: both;
}
profile-image {
.profile-image {
float: left;
width: calc(20% - 1rem);
display: flex;
Expand All @@ -89,10 +95,11 @@ profile-image {
}

.profile-image img {
border-radius: 50%;
width: 40%;
border-radius: 1.25rem;
width: 60%;
height: auto;
margin: -90px auto 0;
box-shadow: 0px 3px 10px 3px rgba(0, 0, 0, 0.15);

}


Expand All @@ -105,21 +112,26 @@ profile-image {

.profile-user-settings {
margin-top: 1.1rem;
display: flex;
}

.profile-user-name {
display: inline-block;
font-size: 3.2rem;
font-weight: 300;
font-weight: 700;
font-family: Arial,sans-serif;
padding-top: 1rem;
text-decoration: underline;

}

.profile-edit-btn {
font-size: 1.4rem;
line-height: 1.8;
border: 0.1rem solid #dbdbdb;
border-radius: 0.3rem;
padding: 0 2.4rem;
margin-left: 2rem;
padding: .25rem 1.75rem;
margin-left: 3.5rem;
}

.profile-settings-btn {
Expand Down Expand Up @@ -149,32 +161,62 @@ profile-image {
font-weight: 400;
line-height: 1.5;
margin-top: 2.3rem;
padding-bottom: .5rem;
border-bottom:3px solid rgba(190, 189, 189, 0.692);
}

.profile-real-name,
.profile-real-name{
font-weight: 500;
padding-left: .75rem;

}
.profile-stat-count,
.profile-edit-btn {
font-weight: 600;
}

.profile-sub-stat-count{
font-size: 1.125rem;
padding: .65rem 1.25rem;
border-radius: .25rem;
background-color: #cbd5e1;
font-weight: 500;
box-shadow: 0px 3px 7px 0px rgba(0, 0, 0, 0.15);
}


.contributions{
font-size: 1.15rem;
font-weight: 400;
padding-left: .6rem;
margin-top: .4rem;

}

.discription{
font-weight: 500;
font-size: 1.075rem;
padding-left: 2.25rem;
}

/* Gallery Section */

.gallery {
display: flex;
flex-wrap: wrap;
margin: -1rem -1rem;
padding-bottom: 3rem;
padding-left: 3rem;
padding-right: 3rem;
}

.gallery-item {
padding:3rem;
box-shadow: 0px 3px 15px 5px rgba(0, 0, 0, 0.03);
}

.gallery-item {
column-gap: 2rem;
position: relative;
flex: 1 0 22rem;
margin: 1rem;
color: #fff;
cursor: pointer;
height: 27.5rem;
}

.gallery-item:hover .gallery-item-info,
Expand All @@ -187,10 +229,12 @@ profile-image {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.3);

}

.gallery-item-info {
display: none;

}

.gallery-item-info li {
Expand Down Expand Up @@ -220,6 +264,10 @@ profile-image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: .75rem;
border: 3px solid rgba(190, 189, 189, 0.692);


}

/* Loader */
Expand Down Expand Up @@ -337,7 +385,7 @@ Remove or comment-out the code block below to see how the browser will fall-back
display: grid;
grid-template-columns: 1fr 2fr;
grid-template-rows: repeat(3, auto);
grid-column-gap: 3rem;
grid-column-gap: .5rem;
align-items: center;
}

Expand Down