diff --git a/.gitignore b/.gitignore index 9de8acb..e539b64 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,6 @@ pnpm-lock.yaml .yarn-integrity # semantic dist src/semantic/dist + +# IDEA +.idea/ diff --git a/src/components/IntroInformation.jsx b/src/components/IntroInformation.jsx new file mode 100644 index 0000000..8499f04 --- /dev/null +++ b/src/components/IntroInformation.jsx @@ -0,0 +1,65 @@ +import React from 'react'; +import { Button, Card } from 'semantic-ui-react'; +import { graphql, StaticQuery } from 'gatsby'; +import { getLanguage, getTranslation, metadata } from '../data/i18n'; + +class IntroInformation extends React.Component { + render() { + const language = + typeof window !== 'undefined' + ? getLanguage(window) + : metadata.defaultLocale; + let intro_information = this.props.data.allContentfulIntroInformation.nodes.filter( + d => d.node_locale === language + )[0]; //get only the first element + + let color = this.props.data.contentfulBoard.color; + console.log(color); + + return ( + <> +
+

{intro_information.title}

+ +
{intro_information.description.description}
+ +
+
+ + ); + } +} + +const introInformationQuery = graphql` + query introInformationQuery { + allContentfulIntroInformation { + nodes { + node_locale + title + linkToWebsiteButtonText + description { + description + } + introWebsiteUrl + } + } + contentfulBoard(current: { eq: true }) { + color + } + } +`; + +export default props => ( + } + /> +); diff --git a/src/components/layout/GridDryQueries.jsx b/src/components/layout/GridDryQueries.jsx index c8cb801..eb756b7 100644 --- a/src/components/layout/GridDryQueries.jsx +++ b/src/components/layout/GridDryQueries.jsx @@ -23,6 +23,9 @@ const IndexWrapper = styled.div` .mainPartner { grid-area: mainPartner; } + .introInformation { + grid-area: introInformation; + } .banner { display: grid; @@ -38,6 +41,7 @@ const IndexWrapper = styled.div` grid-template-areas: 'logo' 'banner' + 'introInformation' 'news' 'news' 'drinks' @@ -64,6 +68,7 @@ const IndexWrapper = styled.div` grid-template-columns: 1fr 1fr; grid-template-areas: 'banner banner' + 'introInformation introInformation' 'news news' 'drinks mainPartner' 'jobs activity'; @@ -80,6 +85,7 @@ const IndexWrapper = styled.div` grid-template-columns: 3fr 1fr; grid-template-areas: 'banner banner' + 'news introInformation' 'news drinks' 'news mainPartner' 'news jobs' diff --git a/src/static-pages/index.jsx b/src/static-pages/index.jsx index f0b8852..fc4d8c7 100644 --- a/src/static-pages/index.jsx +++ b/src/static-pages/index.jsx @@ -11,6 +11,7 @@ import MainPartnerBanner from '$/components/mainpartner/Banner'; import IndexWrapper from '$/components/layout/GridDryQueries'; import FeaturedJobWidget from '$/components/jobs/FeaturedJobWidget'; import ActivityWidget from '$/components/activities/ActivityWidget'; +import IntroInformation from '$/components/IntroInformation'; import logo from '$/images/sticky-logo-text.svg'; @@ -34,6 +35,9 @@ const Index = ({ data }) => {
+
+ +