1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-30 05:31:44 +02:00

project meta refactor

This commit is contained in:
Matthias Kretschmann 2018-10-17 20:26:08 +02:00
parent 8e0cdd1647
commit 2352347998
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 28 additions and 51 deletions

View File

@ -21,14 +21,5 @@
} }
.title { .title {
font-size: $font-size-h3; composes: metaTitle from '../../templates/Project.module.scss';
margin-bottom: $spacer * 1.5;
span {
display: block;
margin-top: $spacer / 3;
font-size: $font-size-base;
font-family: $font-family-base;
color: $brand-grey-light;
}
} }

View File

@ -2,7 +2,6 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { Link, graphql, StaticQuery } from 'gatsby' import { Link, graphql, StaticQuery } from 'gatsby'
import Img from 'gatsby-image' import Img from 'gatsby-image'
import FullWidth from '../atoms/FullWidth'
import styles from './ProjectNav.module.scss' import styles from './ProjectNav.module.scss'
const query = graphql` const query = graphql`
@ -73,26 +72,24 @@ export default class ProjectNav extends Component {
const projects = data.allProjectsYaml.edges const projects = data.allProjectsYaml.edges
return ( return (
<FullWidth> <nav
<nav className={styles.projectNav}
className={styles.projectNav} ref={node => (this.scrollContainer = node)}
ref={node => (this.scrollContainer = node)} >
> {projects.map(({ node }) => {
{projects.map(({ node }) => { const current = node.slug === slug
const current = node.slug === slug
return ( return (
<div <div
className={styles.item} className={styles.item}
key={node.slug} key={node.slug}
ref={node => current && (this.currentItem = node)} ref={node => current && (this.currentItem = node)}
> >
<ProjectLink node={node} /> <ProjectLink node={node} />
</div> </div>
) )
})} })}
</nav> </nav>
</FullWidth>
) )
}} }}
/> />

View File

@ -1,7 +1,6 @@
@import 'variables'; @import 'variables';
.projectNav { .projectNav {
// composes: fullWidth from '../atoms/FullWidth.module.scss';
white-space: nowrap; white-space: nowrap;
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;

View File

@ -28,14 +28,5 @@
} }
.title { .title {
font-size: $font-size-h3; composes: metaTitle from '../../templates/Project.module.scss';
margin-bottom: $spacer * 1.5;
span {
display: block;
margin-top: $spacer / 3;
font-size: $font-size-base;
font-family: $font-family-base;
color: $brand-grey-light;
}
} }

View File

@ -9,11 +9,10 @@ import ProjectTechstack from '../components/molecules/ProjectTechstack'
import ProjectLinks from '../components/molecules/ProjectLinks' import ProjectLinks from '../components/molecules/ProjectLinks'
import ProjectNav from '../components/molecules/ProjectNav' import ProjectNav from '../components/molecules/ProjectNav'
import SEO from '../components/atoms/SEO' import SEO from '../components/atoms/SEO'
import styles from './Project.module.scss' import styles from './Project.module.scss'
const ProjectMeta = ({ links, techstack }) => ( const ProjectMeta = ({ links, techstack }) => (
<footer className={styles.project__meta}> <footer className={styles.meta}>
{!!links && <ProjectLinks links={links} />} {!!links && <ProjectLinks links={links} />}
{!!techstack && <ProjectTechstack techstack={techstack} />} {!!techstack && <ProjectTechstack techstack={techstack} />}
</footer> </footer>
@ -22,7 +21,7 @@ const ProjectMeta = ({ links, techstack }) => (
const ProjectImages = ({ projectImages, title }) => ( const ProjectImages = ({ projectImages, title }) => (
<FullWidth> <FullWidth>
{projectImages.map(({ node }) => ( {projectImages.map(({ node }) => (
<div className={styles.spacer} key={node.id}> <div className={styles.imageWrap} key={node.id}>
<ProjectImage fluid={node.fluid} alt={title} /> <ProjectImage fluid={node.fluid} alt={title} />
</div> </div>
))} ))}
@ -44,11 +43,11 @@ const Project = ({ data }) => {
<article> <article>
<header> <header>
<h1 className={styles.project__title}>{title}</h1> <h1 className={styles.title}>{title}</h1>
</header> </header>
<ReactMarkdown <ReactMarkdown
source={descriptionWithLineBreaks} source={descriptionWithLineBreaks}
className={styles.project__description} className={styles.description}
/> />
<ProjectImages projectImages={projectImages} title={title} /> <ProjectImages projectImages={projectImages} title={title} />
<ProjectMeta links={links} techstack={techstack} /> <ProjectMeta links={links} techstack={techstack} />

View File

@ -1,7 +1,7 @@
@import 'variables'; @import 'variables';
@import '../components/molecules/ProjectImage.module'; @import '../components/molecules/ProjectImage.module';
.spacer { .imageWrap {
margin-bottom: $spacer * 3; margin-bottom: $spacer * 3;
@media (min-width: $screen-xs) { @media (min-width: $screen-xs) {
@ -9,7 +9,7 @@
} }
} }
.project__title { .title {
font-size: $font-size-h2; font-size: $font-size-h2;
@media (min-width: $screen-xs) { @media (min-width: $screen-xs) {
@ -17,12 +17,12 @@
} }
} }
.project__description { .description {
font-size: $font-size-base; font-size: $font-size-base;
margin-bottom: $spacer * 2; margin-bottom: $spacer * 2;
} }
.project__meta { .meta {
margin-top: -($spacer); margin-top: -($spacer);
margin-bottom: $spacer * 5; margin-bottom: $spacer * 5;
display: grid; display: grid;
@ -35,7 +35,7 @@
} }
} }
.project__meta__title { .metaTitle {
font-size: $font-size-h3; font-size: $font-size-h3;
margin-bottom: $spacer * 1.5; margin-bottom: $spacer * 1.5;