mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-05-14 17:36:59 +02:00
Lint and cleanup code
This commit is contained in:
parent
b16262025a
commit
a17f9b2b61
17 changed files with 755 additions and 185 deletions
|
@ -5,8 +5,8 @@ export default function LanguageSwitcher() {
|
|||
const {languages, originalPath} = useI18next();
|
||||
|
||||
return (
|
||||
<div class="languageModalInner">
|
||||
<h2>Languages (<a href="#top" class="modalCloseLink">×</a>)</h2>
|
||||
<div className="languageModalInner">
|
||||
<h2>Languages (<a href="#top" className="modalCloseLink">×</a>)</h2>
|
||||
<ul>
|
||||
{languages.map((lng) => (
|
||||
<li key={lng}>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import { Trans, Link } from "gatsby-plugin-react-i18next"
|
||||
import { graphql, StaticQuery } from 'gatsby'
|
||||
|
||||
export default function Navigation({isHome, module}) {
|
||||
const Navigation = ({isHome, module}) => {
|
||||
return (
|
||||
<div className={"topBar" + (isHome ? " homeBar" : "")}>
|
||||
<nav className="topBarInner">
|
||||
|
@ -23,4 +24,11 @@ export default function Navigation({isHome, module}) {
|
|||
</nav>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Navigation.propTypes = {
|
||||
isHome: PropTypes.boolean.isRequired,
|
||||
module: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
export default Navigation;
|
|
@ -65,7 +65,7 @@ function SEO({ description, meta, title }) {
|
|||
}
|
||||
].concat(meta)}
|
||||
>
|
||||
<script src="https://kit.fontawesome.com/1377f925e0.js" crossorigin="anonymous"></script>
|
||||
<script src="https://kit.fontawesome.com/1377f925e0.js" crossOrigin="anonymous"></script>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com"/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:wght@400;700&family=Roboto&display=swap" rel="stylesheet"/>
|
||||
</Helmet>
|
||||
|
|
|
@ -17,7 +17,7 @@ class Layout extends React.Component {
|
|||
{this.props.children}
|
||||
</div>
|
||||
<footer role="contentinfo">CC-BY 4.0 Kevin Kandlbinder, <Link to="/legal/about" class="spf-link"><Trans i18nKey="imprint">Imprint</Trans></Link> | <Link to="/legal/datasec" class="spf-link"><Trans i18nKey="datasec">Data Protection</Trans></Link> | <Link to="/legal/disclaimer" class="spf-link"><Trans i18nKey="disclaimer">Disclaimer</Trans></Link> | <a href="#languageChooser">Language</a></footer>
|
||||
<div class="languageModal" id="languageChooser">
|
||||
<div className="languageModal" id="languageChooser">
|
||||
<LanguageSwitcher />
|
||||
</div>
|
||||
</>
|
||||
|
@ -38,7 +38,8 @@ Layout.propTypes = {
|
|||
meta: PropTypes.arrayOf(PropTypes.object),
|
||||
title: PropTypes.string.isRequired,
|
||||
module: PropTypes.string.isRequired,
|
||||
transparentTopbar: PropTypes.bool
|
||||
transparentTopbar: PropTypes.bool,
|
||||
children: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
export default Layout;
|
|
@ -10,7 +10,7 @@ const NotFoundPage = () => {
|
|||
<article>
|
||||
<h1>Page not found</h1>
|
||||
<p>
|
||||
Whoops... That page doesn't exist, so you may as well <Link to="/">go home</Link>.
|
||||
Whoops... That page doesn't exist, so you may as well <Link to="/">go home</Link>.
|
||||
</p>
|
||||
</article>
|
||||
</section>
|
||||
|
|
|
@ -40,12 +40,12 @@ export default function DonatePage() {
|
|||
<p><Trans>donateDescription</Trans></p>
|
||||
|
||||
<div className={styles.priceAmount}>
|
||||
<label for="priceInput" className={styles.sronly}>Amount</label>
|
||||
<label htmlFor="priceInput" className={styles.sronly}>Amount</label>
|
||||
<input type="number" min="1" placeholder="10.00" step="1" value={amount} onChange={(ev) => {setAmount(ev.target.value)}} name="priceInput" id="priceInput" />
|
||||
<div>€</div>
|
||||
</div>
|
||||
|
||||
<a className={styles.donateButton} rel="noopener" id="payPalBtn" href={"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business="+encodeURIComponent(site.siteMetadata.payPalMail)+"&item_name="+encodeURIComponent(site.siteMetadata.title)+"¤cy_code=EUR&image_url="+(encodeURIComponent(site.siteMetadata.siteUrl+file.childImageSharp.resize.src))+"&return="+(encodeURIComponent(site.siteMetadata.siteUrl+"/"+path+"thank-you/"))+"&rm=0&cancel_return="+(encodeURIComponent(site.siteMetadata.siteUrl+"/"+path))+"&amount="+amount}><span>Donate using PayPal</span><i class="fas fa-fw fa-chevron-right" aria-hidden="true"></i></a>
|
||||
<a className={styles.donateButton} rel="noopener" id="payPalBtn" href={"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business="+encodeURIComponent(site.siteMetadata.payPalMail)+"&item_name="+encodeURIComponent(site.siteMetadata.title)+"¤cy_code=EUR&image_url="+(encodeURIComponent(site.siteMetadata.siteUrl+file.childImageSharp.resize.src))+"&return="+(encodeURIComponent(site.siteMetadata.siteUrl+"/"+path+"thank-you/"))+"&rm=0&cancel_return="+(encodeURIComponent(site.siteMetadata.siteUrl+"/"+path))+"&amount="+amount}><span>Donate using PayPal</span><i className="fas fa-fw fa-chevron-right" aria-hidden="true"></i></a>
|
||||
</article>
|
||||
</section>
|
||||
</Layout>
|
||||
|
|
|
@ -2,6 +2,7 @@ import React from "react"
|
|||
import Layout from "../layouts/default";
|
||||
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
|
||||
import { graphql } from 'gatsby'
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
import styles from "./friends.module.scss";
|
||||
|
||||
|
@ -19,7 +20,7 @@ query AllFriendsQuery {
|
|||
|
||||
`
|
||||
|
||||
export default function SocialPage({data}) {
|
||||
const FriendsPage = ({data}) => {
|
||||
|
||||
const {t} = useI18next();
|
||||
|
||||
|
@ -43,7 +44,7 @@ export default function SocialPage({data}) {
|
|||
{
|
||||
shuffle(data.allFriendsJson.nodes).map((friend) => {
|
||||
return (
|
||||
<div className={styles.friendProfile}>
|
||||
<div className={styles.friendProfile} key={friend.url+"#"+friend.name}>
|
||||
<div className={styles.friendImage} style={{backgroundImage: "url("+friend.imageURL+")"}}>
|
||||
<span className={styles.friendName}>{friend.name}</span>
|
||||
<span className={styles.friendTitle}>{friend.profession}</span>
|
||||
|
@ -51,7 +52,7 @@ export default function SocialPage({data}) {
|
|||
|
||||
{/*<span class="friendBio"></span>*/}
|
||||
<div className={styles.contactLinks}>
|
||||
<a className={styles.contactLink} href={friend.url} target="_blank" rel="noreferrer"><i class="fas fa-globe-europe" aria-hidden="true"></i> {friend.url}</a>
|
||||
<a className={styles.contactLink} href={friend.url} target="_blank" rel="noreferrer"><i className="fas fa-globe-europe" aria-hidden="true"></i> {friend.url}</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -64,4 +65,10 @@ export default function SocialPage({data}) {
|
|||
</section>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
FriendsPage.propTypes = {
|
||||
data: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
export default FriendsPage;
|
|
@ -1,5 +1,6 @@
|
|||
import * as React from "react"
|
||||
import Layout from "../layouts/default"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
import styles from "./index.module.scss"
|
||||
import projectStyles from "./projects.module.scss"
|
||||
|
@ -81,7 +82,7 @@ class IndexPage extends React.Component {
|
|||
<div className={projectStyles.projectList}>
|
||||
{this.props.data.allProjectsJson.nodes.map((project) => {
|
||||
return (
|
||||
<div className={projectStyles.projectCard}>
|
||||
<div className={projectStyles.projectCard} key={project.lang+"/"+project.urlname}>
|
||||
{/*<div className="projectCardActivityIndicator activityIndicatorBlue">Live</div>*/}
|
||||
<div className={projectStyles.projectCardImage} style={{ backgroundImage: "url("+project.image.childImageSharp.resize.src+")" }}>
|
||||
<div className={projectStyles.projectCardMeta}>
|
||||
|
@ -111,4 +112,8 @@ class IndexPage extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
IndexPage.propTypes = {
|
||||
data: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
export default IndexPage
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,7 @@ import React from "react"
|
|||
import Layout from "../layouts/default";
|
||||
import { Trans, Link, useI18next } from "gatsby-plugin-react-i18next"
|
||||
import { graphql } from 'gatsby'
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
import styles from "./projects.module.scss";
|
||||
|
||||
|
@ -25,7 +26,7 @@ query GetProjects($language: String) {
|
|||
}
|
||||
`
|
||||
|
||||
export default function ProjectsPage({data}) {
|
||||
const ProjectsPage = ({data}) => {
|
||||
|
||||
const {t} = useI18next();
|
||||
return (
|
||||
|
@ -39,7 +40,7 @@ export default function ProjectsPage({data}) {
|
|||
<div className={styles.projectList}>
|
||||
{data.allProjectsJson.nodes.map((project) => {
|
||||
return (
|
||||
<div className={styles.projectCard}>
|
||||
<div className={styles.projectCard} key={project.lang+project.urlname}>
|
||||
{/*<div className="projectCardActivityIndicator activityIndicatorBlue">Live</div>*/}
|
||||
<div className={styles.projectCardImage} style={{ backgroundImage: "url("+project.image.childImageSharp.resize.src+")" }}>
|
||||
<div className={styles.projectCardMeta}>
|
||||
|
@ -61,4 +62,10 @@ export default function ProjectsPage({data}) {
|
|||
</section>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ProjectsPage.propTypes = {
|
||||
data: PropTypes.object
|
||||
}
|
||||
|
||||
export default ProjectsPage;
|
|
@ -2,6 +2,7 @@ import React from "react"
|
|||
import Layout from "../layouts/default";
|
||||
import { Trans, Link, useI18next } from "gatsby-plugin-react-i18next"
|
||||
import { graphql } from 'gatsby'
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
import styles from "./social.module.scss";
|
||||
|
||||
|
@ -18,7 +19,7 @@ query AllSocialsQuery {
|
|||
}
|
||||
`
|
||||
|
||||
export default function SocialPage({data}) {
|
||||
const SocialPage = ({data}) => {
|
||||
|
||||
const {t} = useI18next();
|
||||
return (
|
||||
|
@ -33,7 +34,7 @@ export default function SocialPage({data}) {
|
|||
{
|
||||
data.allSocialsJson.nodes.map((social) => {
|
||||
return (
|
||||
<a className={styles.socialCard} href={social.url} target="_blank" rel="noreferrer">
|
||||
<a className={styles.socialCard} href={social.url} target="_blank" rel="noreferrer" key={social.url}>
|
||||
<div className={styles.socialImage} style={{backgroundImage: "url("+social.image+")"}}>
|
||||
<span className={styles.socialName}>{social.platformName}</span>
|
||||
<span className={styles.socialUsername}>{social.platformHandle}</span>
|
||||
|
@ -49,4 +50,10 @@ export default function SocialPage({data}) {
|
|||
</section>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SocialPage.propTypes = {
|
||||
data: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
export default SocialPage;
|
|
@ -2,6 +2,7 @@ import React from "react"
|
|||
import {graphql} from "gatsby"
|
||||
import {Trans, useTranslation} from 'gatsby-plugin-react-i18next';
|
||||
import Layout from "../layouts/default";
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
import styles from "./project.module.scss";
|
||||
|
||||
|
@ -26,7 +27,7 @@ query GetProject($urlname: String!, $lang: String!) {
|
|||
}
|
||||
`
|
||||
|
||||
export default function ProjectTemplate({data}) {
|
||||
const ProjectTemplate = ({data}) => {
|
||||
const {t} = useTranslation();
|
||||
let project = data.allProjectsJson.nodes[0];
|
||||
let projectName = project.name;
|
||||
|
@ -73,4 +74,10 @@ export default function ProjectTemplate({data}) {
|
|||
</section>*/}
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ProjectTemplate.propTypes = {
|
||||
data: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
export default ProjectTemplate;
|
Loading…
Add table
Add a link
Reference in a new issue