mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-05-01 03:07:16 +02:00
Unify page function style
This commit is contained in:
parent
ec4002ccf7
commit
ee74c99773
3 changed files with 165 additions and 158 deletions
|
@ -36,7 +36,7 @@ export const query = graphql`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function DonatePage(props) {
|
const DonatePage = (props) => {
|
||||||
const [amount, setAmount] = useState(5);
|
const [amount, setAmount] = useState(5);
|
||||||
const { t } = useI18next();
|
const { t } = useI18next();
|
||||||
const { path } = React.useContext(I18nextContext);
|
const { path } = React.useContext(I18nextContext);
|
||||||
|
@ -126,7 +126,7 @@ function DonatePage(props) {
|
||||||
</section>
|
</section>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
DonatePage.propTypes = {
|
DonatePage.propTypes = {
|
||||||
data: PropTypes.object.isRequired,
|
data: PropTypes.object.isRequired,
|
||||||
|
|
|
@ -23,7 +23,7 @@ export const query = graphql`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function ThankYouPage(props) {
|
const ThankYouPage = (props) => {
|
||||||
const { site } = props.data;
|
const { site } = props.data;
|
||||||
|
|
||||||
let contactEmail = site.siteMetadata.contactEmail;
|
let contactEmail = site.siteMetadata.contactEmail;
|
||||||
|
@ -46,7 +46,7 @@ function ThankYouPage(props) {
|
||||||
</section>
|
</section>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
ThankYouPage.propTypes = {
|
ThankYouPage.propTypes = {
|
||||||
data: PropTypes.object.isRequired,
|
data: PropTypes.object.isRequired,
|
||||||
|
|
|
@ -54,8 +54,10 @@ export const query = graphql`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
class IndexPage extends React.Component {
|
const IndexPage = (props) => {
|
||||||
componentDidMount() {
|
React.useEffect(() => {
|
||||||
|
if (typeof window === "undefined") return;
|
||||||
|
|
||||||
anime({
|
anime({
|
||||||
targets: [
|
targets: [
|
||||||
"." + styles.profileCard + " > span",
|
"." + styles.profileCard + " > span",
|
||||||
|
@ -81,10 +83,9 @@ class IndexPage extends React.Component {
|
||||||
duration: 250,
|
duration: 250,
|
||||||
easing: "easeInOutCirc",
|
easing: "easeInOutCirc",
|
||||||
});
|
});
|
||||||
}
|
}, []);
|
||||||
|
|
||||||
render() {
|
let meta = props.data.site.siteMetadata;
|
||||||
let meta = this.props.data.site.siteMetadata;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout title="Kevin Kandlbinder" transparentTopbar={true}>
|
<Layout title="Kevin Kandlbinder" transparentTopbar={true}>
|
||||||
|
@ -192,7 +193,7 @@ class IndexPage extends React.Component {
|
||||||
<Trans>featuredProjects</Trans>
|
<Trans>featuredProjects</Trans>
|
||||||
</h1>
|
</h1>
|
||||||
<div className={projectStyles.projectList}>
|
<div className={projectStyles.projectList}>
|
||||||
{this.props.data.allProjectsJson.nodes.map((project) => {
|
{props.data.allProjectsJson.nodes.map((project) => {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
className={projectStyles.projectCard}
|
className={projectStyles.projectCard}
|
||||||
|
@ -203,9 +204,7 @@ class IndexPage extends React.Component {
|
||||||
className={projectStyles.projectCardImage}
|
className={projectStyles.projectCardImage}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage:
|
backgroundImage:
|
||||||
"url(" +
|
"url(" + project.image.childImageSharp.resize.src + ")",
|
||||||
project.image.childImageSharp.resize.src +
|
|
||||||
")",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className={projectStyles.projectCardMeta}>
|
<div className={projectStyles.projectCardMeta}>
|
||||||
|
@ -235,8 +234,16 @@ class IndexPage extends React.Component {
|
||||||
</Link>
|
</Link>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/*class IndexPage extends React.Component {
|
||||||
|
componentDidMount() {
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
IndexPage.propTypes = {
|
IndexPage.propTypes = {
|
||||||
data: PropTypes.object.isRequired,
|
data: PropTypes.object.isRequired,
|
||||||
|
|
Loading…
Add table
Reference in a new issue