Skip to content

Commit 22e71c7

Browse files
committed
Mobile and Tab Responsive Profile Page
1 parent c6f3610 commit 22e71c7

File tree

5 files changed

+123
-42
lines changed

5 files changed

+123
-42
lines changed

src/user/profile/profile-feed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class ProfileFeed extends Component {
143143
<div className="feed-posts">
144144
<div className="categories">
145145
<div className="tab__container">
146-
<span className="nav__tab container">
146+
<div className="nav__tab container">
147147
<ul className="nav__list__container">
148148
<li
149149
className={
@@ -190,7 +190,7 @@ class ProfileFeed extends Component {
190190
Read Me
191191
</li>
192192
</ul>
193-
</span>
193+
</div>
194194
</div>
195195
</div>
196196
</div>

src/user/profile/profile-feed.scss

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@
124124
margin-top: 5px;
125125
line-height: 21px;
126126
color: #000000;
127+
p {
128+
img {
129+
max-width: 100%;
130+
}
131+
}
127132
}
128133

129134
.cardTag {
@@ -138,3 +143,42 @@
138143
}
139144
}
140145
}
146+
147+
@media (min-width: 320px) and (max-width: 1024px){
148+
.postsContainer {
149+
width: 100%;
150+
margin: 0;
151+
.gridContainer {
152+
grid-template-columns: repeat(1, 1fr);
153+
margin: 0.5vh 2.5vw;
154+
.postItem {
155+
margin: 0;
156+
}
157+
}
158+
}
159+
.feed-posts {
160+
width: 100%;
161+
.categories {
162+
overflow: hidden;
163+
max-width: 100vw;
164+
margin: 0 1vw;
165+
.tab__container {
166+
.nav__tab {
167+
.nav__list__container {
168+
border: none;
169+
overflow-x: scroll;
170+
.nav__single__tab {
171+
font-size: small;
172+
width: 100%;
173+
margin: 0;
174+
padding: 0;
175+
}
176+
}
177+
.nav__list__container::-webkit-scrollbar {
178+
display: none;
179+
}
180+
}
181+
}
182+
}
183+
}
184+
}

src/user/profile/profile.js

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import { getAllPinnedPosts } from "../../actions/postAction";
1414
import { getOrgProfile } from "../../actions/orgAction";
1515
import ProfileFeed from "./profile-feed";
16+
import { Desktop } from '../../utils/breakpoints';
1617

1718
class Profile extends Component {
1819
constructor(props) {
@@ -82,40 +83,37 @@ class Profile extends Component {
8283
pinnedPosts,
8384
} = this.state;
8485
return (
85-
<div className="profile">
86-
<div
87-
className="navigation"
88-
style={{
89-
background: "#f5f5f5",
90-
}}
91-
>
92-
<Navigation profile={this.state.profile}></Navigation>
93-
</div>
94-
<div className="news">
95-
<div className="notify-user">
96-
<UserInfo userProfile={userProfile} />
97-
<Portfolio />
98-
</div>
99-
<div className="two">
100-
<div className="posts-profile">
101-
{/* <PinPosts
102-
all={all}
103-
userProjects={userProjects}
104-
userEvents={userEvents}
105-
userPosts={userPosts}
106-
pinnedPosts={pinnedPosts}
107-
/> */}
108-
<ProfileFeed
109-
all={all}
110-
userProjects={userProjects}
111-
userEvents={userEvents}
112-
userPosts={userPosts}
113-
pinnedPosts={pinnedPosts}
114-
/>
86+
<>
87+
<Navigation profile={this.state.profile}></Navigation>
88+
<div className="profile">
89+
<div className="news">
90+
<div className="notify-user">
91+
<UserInfo userProfile={userProfile} />
92+
<Desktop>
93+
<Portfolio />
94+
</Desktop>
95+
</div>
96+
<div className="two">
97+
<div className="posts-profile">
98+
{/* <PinPosts
99+
all={all}
100+
userProjects={userProjects}
101+
userEvents={userEvents}
102+
userPosts={userPosts}
103+
pinnedPosts={pinnedPosts}
104+
/> */}
105+
<ProfileFeed
106+
all={all}
107+
userProjects={userProjects}
108+
userEvents={userEvents}
109+
userPosts={userPosts}
110+
pinnedPosts={pinnedPosts}
111+
/>
112+
</div>
115113
</div>
116114
</div>
117115
</div>
118-
</div>
116+
</>
119117
);
120118
}
121119
}

src/user/profile/profile.scss

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
min-height: 100vh;
44
height: auto;
55
font-family: Muli, sans-serif;
6-
.navigation {
7-
flex: 0.5;
8-
border-right: solid 1px #dfe9f1;
9-
position: fixed;
10-
top: 0px;
11-
bottom: 0px;
12-
left: 0px;
13-
overflow-y: scroll;
14-
}
156
h2 {
167
font-size: 22px;
178
font-weight: 650;
@@ -60,3 +51,28 @@
6051
.navigation::-webkit-scrollbar {
6152
display: none;
6253
}
54+
55+
@media (min-width: 320px) and (max-width: 1024px){
56+
.profile {
57+
margin: 0;
58+
.news {
59+
margin-left: 0;
60+
width: 100vw;
61+
.notify-user {
62+
display: flex;
63+
justify-content: center;
64+
padding: 0;
65+
padding-top: 2.5vh;
66+
margin: 2.5vh 2.5vw;
67+
.user-detail {
68+
width: 100%;
69+
}
70+
}
71+
}
72+
}
73+
.two {
74+
.posts-profile {
75+
max-width: 100vw;
76+
}
77+
}
78+
}

src/user/profile/user-info/user-info.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,26 @@
125125
}
126126
}
127127

128+
129+
@media (min-width: 320px) and (max-width: 1024px){
130+
.user-detail {
131+
padding: 5px;
132+
.user-image {
133+
text-align: center;
134+
margin: 0;
135+
.edit-option {
136+
.useredit {
137+
border-radius: 100px;
138+
font-size: 14px;
139+
}
140+
}
141+
.user-pic {
142+
display: inline-block;
143+
.userpic {
144+
width: 120px;
145+
height: 120px;
146+
}
147+
}
148+
}
149+
}
150+
}

0 commit comments

Comments
 (0)