From 6c8e95e6abcb1d2f0275f62cde4fc5719b89e528 Mon Sep 17 00:00:00 2001 From: Camerin Date: Wed, 12 Jan 2022 14:45:30 -0500 Subject: [PATCH] Changed Card link to Link --- src/components/subcomponents/Card.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/subcomponents/Card.js b/src/components/subcomponents/Card.js index eb5c078..0e22fa9 100644 --- a/src/components/subcomponents/Card.js +++ b/src/components/subcomponents/Card.js @@ -1,4 +1,5 @@ import React from 'react'; +import { Link } from 'react-router-dom'; import '../css/Card.css'; const Card = (props) => { @@ -12,11 +13,16 @@ const Card = (props) => { * children - jsx that will be displayed in the content of the card * */ + + let scrollToTop = () => { + window.scrollTo(0,0); + }; + return (
{props.link ? - {props.title} + scrollToTop()}>{props.title} :
{props.title}
}