Skip to content

Commit 31d9281

Browse files
Main partner (#358)
* Changed class to className in Footer component * Added main partner to partners page * Added main partner to home page and nav * Main partner pages cleanup * removed navbar promo and banner styling --------- Co-authored-by: Job Vonk <sticcpistt@icloud.com>
1 parent 422e76b commit 31d9281

File tree

13 files changed

+317
-35
lines changed

13 files changed

+317
-35
lines changed

package-lock.json

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

src/components/Banner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const BannerWrapper = styled.div`
7272
justify-content: center;
7373
align-items: center;
7474
height: 10rem;
75-
width: 100%;
75+
width: 95%;
7676
}
7777
.card {
7878
flex-grow: 1;

src/components/layout/Footer.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Footer = () => (
1313
<div className="ui centered container inverted divided three column grid">
1414
<div className="aligned column grid">
1515
<a href="/">
16-
<div class="ui mini image">
16+
<div className="ui mini image">
1717
<img
1818
src="https://public.svsticky.nl/logos/hoofd_outline_wit.svg"
1919
alt="Home"
@@ -29,13 +29,13 @@ const Footer = () => (
2929
</div>
3030
<div className="aligned column">
3131
<a href="https://svsticky.nl/facebook">
32-
<i class="big facebook icon"></i>
32+
<i className="big facebook icon"></i>
3333
</a>
3434
<a href="https://www.linkedin.com/company/studievereniging-sticky">
35-
<i class="big linkedin icon"></i>
35+
<i className="big linkedin icon"></i>
3636
</a>
3737
<a href="https://github.com/svsticky/">
38-
<i class="big github icon"></i>
38+
<i className="big github icon"></i>
3939
</a>
4040
</div>
4141
<div className="aligned column grid">

src/components/layout/GridDryQueries.jsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ const IndexWrapper = styled.div`
2020
.activity {
2121
grid-area: activity;
2222
}
23+
.mainPartner {
24+
grid-area: mainPartner;
25+
}
26+
27+
.banner {
28+
display: grid;
29+
grid-template-columns: 20% 80%;
30+
grid-gap: 3em;
31+
}
2332
2433
@media ${device.mobileMax} {
2534
.container {
@@ -32,6 +41,7 @@ const IndexWrapper = styled.div`
3241
'news'
3342
'news'
3443
'drinks'
44+
'mainPartner'
3545
'jobs'
3646
'activity';
3747
grid-gap: 2em;
@@ -55,7 +65,7 @@ const IndexWrapper = styled.div`
5565
grid-template-areas:
5666
'banner banner'
5767
'news news'
58-
'drinks activity'
68+
'drinks mainPartner'
5969
'jobs activity';
6070
grid-gap: 3em;
6171
}
@@ -71,9 +81,9 @@ const IndexWrapper = styled.div`
7181
grid-template-areas:
7282
'banner banner'
7383
'news drinks'
84+
'news mainPartner'
7485
'news jobs'
75-
'news activity'
76-
'news ...';
86+
'news activity';
7787
grid-gap: 3em;
7888
}
7989
.logo {

src/components/layout/Layout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import NavBar from './Navbar';
55
import MobileNavbar from './MobileNavbar';
66
import Footer from './Footer';
77
import { Container } from 'semantic-ui-react';
8-
import { device } from '../../data/Devices';
8+
import { device } from '$/data/Devices';
99
import { Helmet } from 'react-helmet';
1010

1111
const layout = ({ children, title }) => (

src/components/layout/Navbar.jsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class NavBar extends React.Component {
2929
props.data.allContentfulPage.edges.sort(
3030
(a, b) => a.node.order - b.node.order // Sorting all the menu items
3131
);
32+
this.mainPartner = props.data.allContentfulPartner.edges.filter(
33+
edge => edge.node.isMainPartner
34+
)[0].node;
3235
}
3336

3437
changeLanguage = (lg, location) => {
@@ -149,6 +152,7 @@ class NavBar extends React.Component {
149152
>
150153
<img src={logo} alt="Sticky logo" />
151154
</Image>
155+
152156
<div style={{ flex: 1 }} />
153157
{this.renderMenuItems(this.props.data.allContentfulPage.edges)}
154158
<Dropdown item text="Links" direction="left" key="links">
@@ -212,6 +216,9 @@ const NavBarWrapper = styled.div`
212216
height: 100%;
213217
}
214218
}
219+
.hoofdsponsor-logo {
220+
margin-left: 2em;
221+
}
215222
.item {
216223
color: white !important;
217224
&:hover {
@@ -266,6 +273,20 @@ export default props => (
266273
}
267274
}
268275
}
276+
allContentfulPartner {
277+
edges {
278+
node {
279+
slug
280+
node_locale
281+
isMainPartner
282+
logo {
283+
file {
284+
url
285+
}
286+
}
287+
}
288+
}
289+
}
269290
contentfulBoard(current: { eq: true }) {
270291
color
271292
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Link } from 'gatsby';
2+
import React from 'react';
3+
import { Card } from 'semantic-ui-react';
4+
import styled from 'styled-components';
5+
6+
const Banner = ({ partner }) => (
7+
<BannerWrapper>
8+
<Card
9+
fluid
10+
className="mainPartnerBanner-card"
11+
as={Link}
12+
to={`/${partner.node_locale}/partners/${partner.slug}`}
13+
>
14+
<img src={partner.logo.file.url} />
15+
</Card>
16+
</BannerWrapper>
17+
);
18+
19+
const BannerWrapper = styled.div`
20+
img {
21+
width: 100%;
22+
position: relative;
23+
top: 50%;
24+
transform: translateY(-50%);
25+
}
26+
27+
.mainPartnerBanner-card {
28+
height: 100%;
29+
}
30+
`;
31+
32+
export default Banner;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import { Card } from 'semantic-ui-react';
3+
import { Link } from 'gatsby';
4+
import { getTranslation, getLanguage, metadata } from '$/data/i18n';
5+
import { ImageContainer } from '$/helpers/ImageContainer';
6+
7+
const MainPartnerCard = ({ partner }) => {
8+
const language =
9+
typeof window !== 'undefined'
10+
? getLanguage(window)
11+
: metadata.defaultLocale;
12+
return (
13+
<div>
14+
<h2>{getTranslation(language, 'partners.main')}</h2>
15+
<Card
16+
fluid
17+
as={Link}
18+
to={`/${partner.node_locale}/partners/${partner.slug}`}
19+
>
20+
<ImageContainer src={partner.logo.file.url} />
21+
</Card>
22+
</div>
23+
);
24+
};
25+
export default MainPartnerCard;

0 commit comments

Comments
 (0)