From a8c676527b880420a9ced5582cbc3cef4b91c172 Mon Sep 17 00:00:00 2001 From: Tobias de Bruijn Date: Mon, 8 Apr 2024 17:52:11 +0200 Subject: [PATCH] Dev to master (#379) * New workflow for adding newly opened issues to the CommITCrowd project Perhaps the title says it all. This is a really simple workflow, and it's open for any changes or adjustments * feat: Hide phone number if not filled in in Contentful * Add introduction information to the website (#376) --------- Co-authored-by: Silas Peters Co-authored-by: Sem van Nieuwenhuizen --- .github/workflows/projects.yml | 25 +++++++++ .gitignore | 3 ++ src/components/IntroInformation.jsx | 65 ++++++++++++++++++++++++ src/components/layout/GridDryQueries.jsx | 6 +++ src/static-pages/index.jsx | 4 ++ src/templates/JobTemplate.jsx | 18 ++++--- 6 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/projects.yml create mode 100644 src/components/IntroInformation.jsx diff --git a/.github/workflows/projects.yml b/.github/workflows/projects.yml new file mode 100644 index 00000000..a47fbc75 --- /dev/null +++ b/.github/workflows/projects.yml @@ -0,0 +1,25 @@ +name: projects + +on: + issues: + types: + - opened + pull_requests: + types: + - opened + +jobs: + add-to-project: + name: Add opened issue or PR to CommITCrowd project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.5.0 + with: + # URL of the project to add issues to + project-url: https://github.com/orgs/svsticky/projects/7 + # A GitHub personal access token with write access to the project + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + # A comma-separated list of labels to use as a filter for issue to be added + # labeled: # optional + # The behavior of the labels filter, AND to match all labels, OR to match any label, NOT to exclude any listed label (default is OR) + # label-operator: # optional diff --git a/.gitignore b/.gitignore index 9de8acb8..e539b647 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 00000000..8499f044 --- /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 c8cb801d..eb756b7e 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 f0b88523..fc4d8c70 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 }) => {
+
+ +
diff --git a/src/templates/JobTemplate.jsx b/src/templates/JobTemplate.jsx index 25c8b7af..66122898 100755 --- a/src/templates/JobTemplate.jsx +++ b/src/templates/JobTemplate.jsx @@ -31,14 +31,16 @@ const JobView = ({ data }) => { - + {job.contactPerson.phone && ( + + )} )}