mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-10-08 19:56:59 +02:00
Normalize Code Style
This commit is contained in:
parent
f62930067b
commit
75c52c744d
36 changed files with 508 additions and 526 deletions
src/templates
|
@ -1,6 +1,6 @@
|
|||
import React from "react"
|
||||
import {graphql} from "gatsby"
|
||||
import {Trans, useTranslation} from 'gatsby-plugin-react-i18next';
|
||||
import { graphql } from "gatsby"
|
||||
import { Trans, useTranslation } from 'gatsby-plugin-react-i18next';
|
||||
import Layout from "../layouts/default";
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
|
@ -27,53 +27,53 @@ query GetProject($urlname: String!, $lang: String!) {
|
|||
}
|
||||
`
|
||||
|
||||
const ProjectTemplate = ({data}) => {
|
||||
const {t} = useTranslation();
|
||||
const ProjectTemplate = ({ data }) => {
|
||||
const { t } = useTranslation();
|
||||
let project = data.allProjectsJson.nodes[0];
|
||||
let projectName = project.name;
|
||||
|
||||
return (
|
||||
<Layout description={project.shortDescription} title={t("project")+": "+projectName} transparentTopbar={true}>
|
||||
<section className={styles.projectHeader}>
|
||||
<div style={{paddingTop: 0}}>
|
||||
<div className={styles.headerBackground} style={{backgroundImage: "url("+project.image.publicURL+")"}}></div>
|
||||
<header>
|
||||
<div className={styles.headerInner}>
|
||||
<h1><Trans>project</Trans>: {projectName}</h1>
|
||||
<span className={styles.postMeta}>{project.shortDescription}</span>
|
||||
</div>
|
||||
</header>
|
||||
<div className={styles.headerPlaceholder}></div>
|
||||
return (
|
||||
<Layout description={project.shortDescription} title={t("project") + ": " + projectName} transparentTopbar={true}>
|
||||
<section className={styles.projectHeader}>
|
||||
<div style={{ paddingTop: 0 }}>
|
||||
<div className={styles.headerBackground} style={{ backgroundImage: "url(" + project.image.publicURL + ")" }}></div>
|
||||
<header>
|
||||
<div className={styles.headerInner}>
|
||||
<h1><Trans>project</Trans>: {projectName}</h1>
|
||||
<span className={styles.postMeta}>{project.shortDescription}</span>
|
||||
</div>
|
||||
</section>
|
||||
{project.longDescription != null ?
|
||||
<section className={styles.projectAbout}>
|
||||
<article>
|
||||
<h1><Trans projectName={projectName} i18nKey="projectAboutHeader">projectAboutHeader{{projectName}}</Trans></h1>
|
||||
<p>{project.longDescription}</p>
|
||||
</article>
|
||||
</section>
|
||||
: null}
|
||||
{project.links.github !== null || project.links.website !== null ?
|
||||
<section className={styles.projectLinks}>
|
||||
<div>
|
||||
<h1>Links</h1>
|
||||
<div className={styles.linkList}>
|
||||
{project.links.github !== null ? <a href={project.links.github} target="_blank" rel="noreferrer"><i className="fab fa-github" aria-hidden="true"></i> <Trans>projectViewGitHub</Trans></a> : null}
|
||||
{project.links.website !== null ? <a href={project.links.website} target="_blank" rel="noreferrer"><i className="fas fa-external-link-alt" aria-hidden="true"></i> <Trans>projectViewWebsite</Trans></a> : null}
|
||||
</header>
|
||||
<div className={styles.headerPlaceholder}></div>
|
||||
</div>
|
||||
</section>
|
||||
{project.longDescription != null ?
|
||||
<section className={styles.projectAbout}>
|
||||
<article>
|
||||
<h1><Trans projectName={projectName} i18nKey="projectAboutHeader">projectAboutHeader{{ projectName }}</Trans></h1>
|
||||
<p>{project.longDescription}</p>
|
||||
</article>
|
||||
</section>
|
||||
: null}
|
||||
{project.links.github !== null || project.links.website !== null ?
|
||||
<section className={styles.projectLinks}>
|
||||
<div>
|
||||
<h1>Links</h1>
|
||||
<div className={styles.linkList}>
|
||||
{project.links.github !== null ? <a href={project.links.github} target="_blank" rel="noreferrer"><i className="fab fa-github" aria-hidden="true"></i> <Trans>projectViewGitHub</Trans></a> : null}
|
||||
{project.links.website !== null ? <a href={project.links.website} target="_blank" rel="noreferrer"><i className="fas fa-external-link-alt" aria-hidden="true"></i> <Trans>projectViewWebsite</Trans></a> : null}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
: null}
|
||||
{/*<section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
: null}
|
||||
{/*<section>
|
||||
<div>
|
||||
|
||||
<pre>{JSON.stringify(data, null, 2)}</pre>
|
||||
</div>
|
||||
</section>*/}
|
||||
</Layout>
|
||||
);
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
ProjectTemplate.propTypes = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue