Skip to content

Commit 6e21ae0

Browse files
rumaanhaxzie
authored andcommitted
FIX: Member details card (#171)
* Base for member details * FIX: varied team member card width on mobile * Removed unwanted pages
1 parent 3ca9db4 commit 6e21ae0

File tree

10 files changed

+208
-134
lines changed

10 files changed

+208
-134
lines changed

config.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
module.exports ={
2-
feedback_days:7,
3-
4-
5-
}
6-
1+
module.exports = {
2+
feedback_days: 7,
3+
}

gatsby-config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ module.exports = {
1414
title: 'SOSC - Blog',
1515
siteUrl: 'https://sosc.org.in/blog',
1616
},
17+
memberDetails: {
18+
title: 'SOSC - Member Details',
19+
siteUrl: 'https://sosc.org.in/member-details',
20+
},
1721
},
1822
plugins: [
1923
'gatsby-plugin-react-helmet',

gatsby-node.js

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
1-
const path = require('path');
2-
3-
exports.createPages = ({actions, graphql}) => {
4-
const {createPage} = actions;
5-
6-
const blogTemplate = path.resolve('src/templates/blog.js');
7-
const eventTemplate = path.resolve('src/templates/event.js');
8-
9-
return graphql(
10-
`{
11-
allMarkdownRemark {
12-
edges {
13-
node {
14-
id
15-
frontmatter {
16-
slug
17-
}
18-
19-
}
20-
}
1+
const path = require('path')
2+
3+
exports.createPages = ({ actions, graphql }) => {
4+
const { createPage } = actions
5+
6+
const blogTemplate = path.resolve('src/templates/blog.js')
7+
const eventTemplate = path.resolve('src/templates/event.js')
8+
9+
return graphql(
10+
`
11+
{
12+
allMarkdownRemark {
13+
edges {
14+
node {
15+
id
16+
frontmatter {
17+
slug
18+
}
2119
}
22-
}`
23-
).then(res => {
24-
if (res.errors) {
25-
return Promise.reject(errors);
20+
}
2621
}
27-
28-
29-
res.data.allMarkdownRemark.edges.map(element => {
30-
31-
let slug = element.node.frontmatter.slug;
32-
33-
if (slug) {
34-
//create page for blog using template
35-
if (slug.includes(`/blog/`)) {
36-
createPage({
37-
path: slug,
38-
component: blogTemplate
39-
})
40-
} else if (slug.includes(`/events/`)) {
41-
createPage({
42-
path: slug,
43-
component: eventTemplate
44-
})
45-
}
46-
}
47-
48-
});
22+
}
23+
`
24+
).then(res => {
25+
if (res.errors) {
26+
return Promise.reject(errors)
27+
}
28+
29+
res.data.allMarkdownRemark.edges.map(element => {
30+
let slug = element.node.frontmatter.slug
31+
32+
if (slug) {
33+
//create page for blog using template
34+
if (slug.includes(`/blog/`)) {
35+
createPage({
36+
path: slug,
37+
component: blogTemplate,
38+
})
39+
} else if (slug.includes(`/events/`)) {
40+
createPage({
41+
path: slug,
42+
component: eventTemplate,
43+
})
44+
}
45+
}
4946
})
50-
}
47+
})
48+
}

src/components/header.js

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1-
import React from 'react';
2-
import Link from 'gatsby-link';
3-
import favicon from '../images/favicon.ico';
4-
import Helmet from 'react-helmet';
1+
import React from 'react'
2+
import Link from 'gatsby-link'
3+
import favicon from '../images/favicon.ico'
4+
import Helmet from 'react-helmet'
55
import GatsbyConfig from '../../gatsby-config'
66

7-
87
const Header = ({ siteTitle }) => (
98
<div className="nav-bar">
109
<Helmet
1110
title={GatsbyConfig.siteMetadata.title}
1211
meta={[
1312
{ name: 'description', content: 'Sahyadri Open-Source Community' },
14-
{ name: 'keywords', content: 'Community, OpenSource, SOSC, sahyadri, student' },
15-
]}
16-
link={[
17-
{ rel: 'shortcut icon', type: 'image/ico', href: `${favicon}` }
13+
{
14+
name: 'keywords',
15+
content: 'Community, OpenSource, SOSC, sahyadri, student',
16+
},
1817
]}
18+
link={[{ rel: 'shortcut icon', type: 'image/ico', href: `${favicon}` }]}
1919
/>
2020

2121
<div className="container">
2222
<div className="nav-items">
23-
<span className="brand">
24-
{siteTitle}
25-
</span>
23+
<span className="brand">{siteTitle}</span>
2624
<ul>
27-
<li><Link to="/" exact={true} activeClassName="active">Home</Link></li>
28-
<li><Link to="/events" exact={true} activeClassName="active">Events</Link></li>
29-
<li><Link to="/blog" exact={true} activeClassName="active">Blogs</Link></li>
30-
<li><Link to="/team" exact={true} activeClassName="active">Team</Link></li>
25+
<li>
26+
<Link to="/" exact={true} activeClassName="active">
27+
Home
28+
</Link>
29+
</li>
30+
<li>
31+
<Link to="/events" exact={true} activeClassName="active">
32+
Events
33+
</Link>
34+
</li>
35+
<li>
36+
<Link to="/blog" exact={true} activeClassName="active">
37+
Blogs
38+
</Link>
39+
</li>
40+
<li>
41+
<Link to="/team" exact={true} activeClassName="active">
42+
Team
43+
</Link>
44+
</li>
3145
</ul>
3246
</div>
3347
</div>
3448
</div>
3549
)
3650

3751
export default Header
38-
39-

src/pages/blog.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import Layout from '../components/indexLayout'
44
import { graphql } from 'gatsby'
55

66
function getBlogs(data) {
7-
let blogs = [];
8-
let blogList = data.allMarkdownRemark.edges;
7+
let blogs = []
8+
let blogList = data.allMarkdownRemark.edges
99

1010
blogList.forEach(element => {
11-
blogs.push(<BlogCard data={element.node.frontmatter} />);
12-
});
13-
14-
return blogs;
11+
blogs.push(<BlogCard data={element.node.frontmatter} />)
12+
})
13+
14+
return blogs
1515
}
1616

1717
const BlogsPage = ({ data }) => (
@@ -20,14 +20,14 @@ const BlogsPage = ({ data }) => (
2020
<div className="container">
2121
<section className="blog-section">
2222
<div className="blog-posts">{getBlogs(data)}</div>
23-
{ /*
23+
{/*
24+
2425
<div className="blog-newsletter">
2526
<div className="news-card">
2627
<img alt="" src="" />
2728
</div>
2829
</div>
29-
*/
30-
}
30+
*/}
3131
</section>
3232
</div>
3333
</div>

src/sass/index.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@import 'components/components';
22
@import 'partials/base';
33

4+
$font : 'Varela Round';
5+
46
:focus {outline:none;}
57
::-moz-focus-inner {border:0;}
68

@@ -17,7 +19,7 @@ body {
1719
position: relative;
1820
margin: 0;
1921
min-height: 100%;
20-
font-family: 'Varela Round', sans-serif;
22+
font-family: $font, sans-serif;
2123
font-display: optional;
2224
color: #373738;
2325
background-color: #f3f3f3;

src/sass/partials/_layout.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import 'layouts/events';
33
@import 'layouts/blogs';
44
@import 'layouts/team';
5+
@import 'layouts/member';
56

67
#flexContainer {
78
display: flex;

src/sass/partials/layouts/_events.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
height: 100%;
4141
width: 100%;
4242
z-index: 1;
43-
43+
4444
.card-header-text {
4545
width: 100%;
4646
text-align: center;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.profile-container {
2+
background: red;
3+
width: 100%;
4+
height: calc(100vh - 10px);
5+
display: flex;
6+
flex-direction: row;
7+
justify-content: flex-start;
8+
align-items: stretch;
9+
// grid-template-columns: 0.4fr 1fr;
10+
11+
.profile-details {
12+
background-color: black;
13+
flex: 1 1 auto;
14+
display: flex;
15+
flex-direction: column;
16+
align-items: stretch;
17+
.avatar {
18+
flex: 1 1 auto;
19+
background-color: aqua;
20+
}
21+
.links {
22+
flex: 1 1 auto;
23+
background-color: blue;
24+
}
25+
.random-info {
26+
flex: 1 1 auto;
27+
background-color: green;
28+
}
29+
.quote {
30+
flex: 1 1 auto;
31+
background-color: red;
32+
}
33+
}
34+
35+
.profile-content {
36+
background-color: yellow;
37+
flex: 3 1 auto;
38+
.section {
39+
display: flex;
40+
flex-direction: column;
41+
.skills {
42+
flex: 1 1 auto;
43+
}
44+
.about {
45+
flex: 1 1 auto;
46+
}
47+
.blogs {
48+
flex: 1 1 auto;
49+
}
50+
}
51+
}
52+
53+
@media #{$media-mobile} {
54+
flex-direction: column;
55+
width: 100%;
56+
}
57+
@media #{$media-small} {
58+
flex-direction: column;
59+
width: 100%;
60+
}
61+
}

0 commit comments

Comments
 (0)