huge changes
diff --git a/Components/Card.js b/Components/Card.js
index 0673883..00a2df4 100644
--- a/Components/Card.js
+++ b/Components/Card.js
@@ -1,27 +1,25 @@
import { Component } from "react";
import Styles from '../styles/Components/card.module.css';
import react from 'react'
+import { withRouter } from "next/router";
class Card extends Component {
constructor(props) {
super(props);
- this.state = {
- clicked: false,
- }
}
render() {
return (
- <div className={Styles.card + " " + (this.state.clicked ? Styles.clicked : "")} style={{
+ <div className={Styles.card} style={{
margin: "0"
- }} onClick={() => { this.setState({clicked: !this.state.clicked}) }}>
- <div className={Styles.backgroundGradient + " " + (this.state.clicked ? Styles.clicked : "")} style={{
+ }} onClick={this.props.url ? () => { this.props.router.push(this.props.url)} : null}>
+ <div className={Styles.backgroundGradient} style={{
backgroundImage: `linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`
}} />
- <img alt="" className={Styles.backgroundImage} src={`https://assets.clicksminuteper.net/web/waves/card/${this.props.wave}.svg`} draggable={false} />
- <div className={Styles.panel}>
+ <img alt="" className={Styles.backgroundImage} src={`https://assets.clicks.codes/web/waves/card/${this.props.wave}.svg`} draggable={false} />
+ <div className={Styles.panel} onClick={() => { this.props.url ? () => { this.props.router.push(this.props.url)} : null}}>
<div className={Styles.titleContainer}>
- <img alt="Project icon" className={Styles.image + " " + (this.state.clicked ? Styles.clicked : "")} src={"https://assets.clicksminuteper.net/" + (this.props.icon ? this.props.icon : this.props.wave) + ".svg"} />
+ <img alt="Project icon" className={Styles.image} src={"https://assets.clicks.codes/" + (this.props.icon ? this.props.icon : this.props.wave) + ".svg"} />
<h1 className={Styles.title}>{this.props.title}</h1>
</div>
<p className={Styles.subtext}>{this.props.subtext}</p>
@@ -41,8 +39,8 @@
</div>
</div>
</div>
- )
- }
+ );
+ }
}
class CardRow extends Component {
@@ -50,7 +48,6 @@
super(props);
}
-
render() {
return (
<div className={Styles.container}>
@@ -64,4 +61,6 @@
}
}
-export { Card, CardRow };
\ No newline at end of file
+Card = withRouter(Card);
+
+export { Card, CardRow };