Skip to content

Commit ff511af

Browse files
committed
Responsive Profile Section
1 parent 76cb5f3 commit ff511af

File tree

11 files changed

+324
-23364
lines changed

11 files changed

+324
-23364
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,24 @@ Your application setup is successfully completed!
109109
<a id="update-repo"></a>
110110

111111
### 6. Update Fork Repo From Original Repo (Optional)
112+
112113
0. Follow these steps if you are done with <b>Setup Remote</b> ✅.
113114
1. Update your local Master to be in synch with the original repo.
115+
114116
```console
115117

116118
$ git pull upstream <name_of_branch>
117119

118120
```
121+
119122
2. Update the forked repo master by pushing the local repo up.
123+
120124
```console
121125

122126
$ git push origin <name_of_branch>
123127

124128
```
129+
125130
<a id="run-app"></a>
126131

127132
### Running the app

package-lock.json

Lines changed: 65 additions & 23145 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Profile.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function Profile() {
2727
.then(doc => {
2828
if (doc.exists) {
2929
let data = doc.data();
30-
setMyProfile(data)
30+
setMyProfile(data);
3131
} else {
3232
console.log('No such document!');
3333
}
@@ -41,21 +41,30 @@ export default function Profile() {
4141
return (
4242
<DrawerLayout>
4343
<Grid>
44-
{ myProfile !== null ? <ProfileInfo myProfile={myProfile} /> : <>No Data</>}
44+
{myProfile !== null ? (
45+
<ProfileInfo myProfile={myProfile} />
46+
) : (
47+
<>No Data</>
48+
)}
4549
</Grid>
4650
<Grid container style={{ marginBottom: '21px' }}>
47-
<Grid item sm={4} style={{ marginRight: '21px' }}>
51+
<Grid
52+
item
53+
xs={12}
54+
sm={5}
55+
style={{ marginRight: '21px', marginBottom: '21px' }}
56+
>
4857
<CommitChart />
4958
</Grid>
50-
<Grid item sm>
59+
<Grid item xs={12} sm>
5160
<Badge />
5261
</Grid>
5362
</Grid>
5463
<Grid container>
55-
<Grid sm>
64+
<Grid xs={12} sm>
5665
<ProfileEvents />
5766
</Grid>
58-
<Grid sm>
67+
<Grid xs={12} sm>
5968
<ProfilePublications />
6069
</Grid>
6170
</Grid>

src/components/ProfileInfo.js

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
Chip
1212
} from '@material-ui/core';
1313

14-
1514
const useStyles = makeStyles(theme => ({
1615
root: {
1716
fontFamily: 'Montserrat',
@@ -37,11 +36,36 @@ const useStyles = makeStyles(theme => ({
3736
marginLeft: '75px',
3837
position: 'absolute',
3938
width: theme.spacing(20),
40-
height: theme.spacing(20)
39+
height: theme.spacing(20),
40+
[theme.breakpoints.down('xs')]: {
41+
width: theme.spacing(18),
42+
height: theme.spacing(18),
43+
fontSize: '24px',
44+
marginLeft: '35px'
45+
}
4146
},
4247
tiny: {
4348
width: theme.spacing(3),
4449
height: theme.spacing(3)
50+
},
51+
profiledesc: {
52+
maxWidth: '250px',
53+
wordBreak: 'break-all',
54+
whiteSpace: 'no-warp',
55+
overflow: 'hidden',
56+
textOverflow: 'ellipsis',
57+
display: '-webkit-box',
58+
WebkitBoxOrient: 'vertical',
59+
WebkitLineClamp: '5',
60+
lineHeight: '1',
61+
maxHeight: '1.5'
62+
},
63+
publictext: {
64+
fontWeight: '650',
65+
paddingRight: '10px',
66+
[theme.breakpoints.down('xs')]: {
67+
fontSize: '25px'
68+
}
4569
}
4670
}));
4771

@@ -97,10 +121,7 @@ function ProfileInfo({ myProfile }) {
97121
justifyContent="flex-end"
98122
style={{ position: 'absolute', right: '60px', paddingTop: '50px' }}
99123
>
100-
<Typography
101-
variant="h2"
102-
style={{ fontWeight: '650', paddingRight: '10px' }}
103-
>
124+
<Typography variant="h2" className={classes.publictext}>
104125
Public View
105126
</Typography>
106127

@@ -154,10 +175,7 @@ function ProfileInfo({ myProfile }) {
154175
<Typography variant="body2" style={{ fontWeight: '650' }}>
155176
{myProfile.role}
156177
</Typography>
157-
<Typography
158-
variant="body2"
159-
style={{ maxWidth: '250px', marginTop: '16px' }}
160-
>
178+
<Typography variant="body2" className={classes.profiledesc}>
161179
{myProfile.description}
162180
</Typography>
163181
</Box>
@@ -170,11 +188,11 @@ function ProfileInfo({ myProfile }) {
170188
<Typography variant="h2" style={{ fontWeight: '650' }}>
171189
Interested in:
172190
</Typography>
173-
{interestedInArr.filter(e => String(e).trim()).map((tagName) => {
174-
return (
175-
<Chip className={classes.tags} label={tagName} />
176-
)
177-
})}
191+
{interestedInArr
192+
.filter(e => String(e).trim())
193+
.map(tagName => {
194+
return <Chip className={classes.tags} label={tagName} />;
195+
})}
178196
</Box>
179197
</Box>
180198
</Card>

src/components/ProfilePublications.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ import React, { useEffect } from 'react';
22
import { makeStyles } from '@material-ui/styles';
33
import { Box, Button, Card, Grid, Typography } from '@material-ui/core';
44

5-
const useStyles = makeStyles(() => ({
5+
const useStyles = makeStyles(theme => ({
66
root: {
77
background: '#CCD2E3',
88
borderRadius: '20px',
99
padding: '19px',
1010
color: '#291757',
1111
fontFamily: 'Montserrat',
1212
marginBottom: '21px',
13-
marginLeft: '21px'
13+
marginLeft: '21px',
14+
[theme.breakpoints.down('xs')]: {
15+
marginLeft: '0px'
16+
}
1417
},
1518
topContainer: {
1619
display: 'flex',

src/components/UserEventStats.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import { Box } from '@material-ui/core'
2+
import { Box } from '@material-ui/core';
33

4-
const UserEventStats = (props) => {
4+
const UserEventStats = props => {
55
const box = {
66
display: 'flex',
77
height: '80px',
@@ -32,7 +32,14 @@ const UserEventStats = (props) => {
3232
};
3333

3434
return (
35-
<Box style={{ display: 'flex', flexDirection: 'column', gap: '20px', padding: '21px' }}>
35+
<Box
36+
style={{
37+
display: 'flex',
38+
flexDirection: 'column',
39+
gap: '20px',
40+
padding: '21px'
41+
}}
42+
>
3643
<Box style={box}>
3744
<p>
3845
events

src/services/authService.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import firebase from 'firebase';
66
class AuthService {
77
// Configure Firebase.
88
config = {
9-
apiKey: "AIzaSyBogaqI7q74Wml7AD90VVm_89o1cgFFQCo",
10-
authDomain: "code-for-cause-leaders.firebaseapp.com",
11-
projectId: "code-for-cause-leaders",
12-
storageBucket: "code-for-cause-leaders.appspot.com",
13-
messagingSenderId: "58409560329",
14-
appId: "1:58409560329:web:60ffc3c128d3b155a18bd8",
15-
measurementId: "G-49RJ8QM95E"
9+
apiKey: 'AIzaSyBogaqI7q74Wml7AD90VVm_89o1cgFFQCo',
10+
authDomain: 'code-for-cause-leaders.firebaseapp.com',
11+
projectId: 'code-for-cause-leaders',
12+
storageBucket: 'code-for-cause-leaders.appspot.com',
13+
messagingSenderId: '58409560329',
14+
appId: '1:58409560329:web:60ffc3c128d3b155a18bd8',
15+
measurementId: 'G-49RJ8QM95E'
1616
// ...
1717
};
1818
// Configure FirebaseUI.
@@ -118,4 +118,4 @@ class AuthService {
118118
const authService = new AuthService();
119119

120120
export default authService;
121-
export { firebase }
121+
export { firebase };

src/views/pages/HomeView/Hero.js

Lines changed: 39 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,21 @@ import {
1414

1515
const useStyles = makeStyles(theme => ({
1616
root: {
17-
1817
backgroundColor: '#291755',
1918
paddingTop: 80,
2019
paddingBottom: 60,
2120
color: '#FFFFFF',
22-
paddingLeft:60,
23-
paddingRight:60,
24-
25-
height:'90.3vh',
21+
paddingLeft: 60,
22+
paddingRight: 60,
23+
24+
height: '90.3vh',
2625
[theme.breakpoints.down('md')]: {
2726
paddingTop: 15,
28-
paddingBottom: 15,
29-
30-
31-
27+
paddingBottom: 15
3228
},
33-
[theme.breakpoints.down('sm')]:{
34-
height:'auto',
35-
},
36-
29+
[theme.breakpoints.down('sm')]: {
30+
height: 'auto'
31+
}
3732
},
3833
extraPadding: {
3934
padding: '0 70px 0px 0px',
@@ -88,25 +83,24 @@ function Hero({ className, ...rest }) {
8883
}}
8984
/> */}
9085
<Hidden mdDown>
91-
<Grid item xs={12} md={6}>
92-
<Box>
93-
<div className={classes.image}>
94-
<img
95-
src="/static/home/blob.svg"
96-
alt="blob"
97-
style={{
98-
position: 'absolute',
99-
top: '-9rem',
100-
left: '-20%'
101-
}}
102-
/>
103-
</div>
104-
</Box>
105-
</Grid>
106-
</Hidden>
86+
<Grid item xs={12} md={6}>
87+
<Box>
88+
<div className={classes.image}>
89+
<img
90+
src="/static/home/blob.svg"
91+
alt="blob"
92+
style={{
93+
position: 'absolute',
94+
top: '-9rem',
95+
left: '-20%'
96+
}}
97+
/>
98+
</div>
99+
</Box>
100+
</Grid>
101+
</Hidden>
107102
<Grid container spacing={3}>
108103
<Grid item xs={12} md={6} style={{ zIndex: '20' }}>
109-
110104
<Box
111105
display="flex"
112106
flexDirection="column"
@@ -132,20 +126,19 @@ function Hero({ className, ...rest }) {
132126
alt="codeforcauseimg"
133127
src="/static/home/illus-1.svg"
134128
style={{
135-
width: '75%',
136-
129+
width: '75%'
137130
}}
138131
/>
139132
</div>
140133
</Box>
141134
</Hidden>
142135
<Box mt={5}>
143-
<Typography variant="body1">
144-
An initiative to contribute to the Open Source community by
145-
providing training, guidance, and awareness about the
146-
possibilities in the field of software to students &
147-
professionals.
148-
</Typography>
136+
<Typography variant="body1">
137+
An initiative to contribute to the Open Source community by
138+
providing training, guidance, and awareness about the
139+
possibilities in the field of software to students &
140+
professionals.
141+
</Typography>
149142
</Box>
150143
<Box mt={2} mb={3}>
151144
<Grid container>
@@ -177,17 +170,17 @@ function Hero({ className, ...rest }) {
177170
<Grid item xs={12} md={6}>
178171
<Box>
179172
<div className={classes.image}>
180-
<img
181-
alt="codeforcauseimg"
182-
src="/static/home/illus-1.svg"
183-
style={{
184-
width: '100%'
185-
}}
186-
/>
173+
<img
174+
alt="codeforcauseimg"
175+
src="/static/home/illus-1.svg"
176+
style={{
177+
width: '100%'
178+
}}
179+
/>
187180
</div>
188181
</Box>
189182
</Grid>
190-
</Hidden>
183+
</Hidden>
191184
</Grid>
192185
</Container>
193186
</div>

0 commit comments

Comments
 (0)