From 9f06fb014bd3acd729325e681573d04089346561 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 6 Sep 2021 01:31:10 -0700 Subject: cleanup docs changes --- docs/src/components/Examples/CardLink.tsx | 66 ------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 docs/src/components/Examples/CardLink.tsx (limited to 'docs/src/components/Examples/CardLink.tsx') diff --git a/docs/src/components/Examples/CardLink.tsx b/docs/src/components/Examples/CardLink.tsx deleted file mode 100644 index 4c04be8a6..000000000 --- a/docs/src/components/Examples/CardLink.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { JSX } from '@babel/types'; -import type { Component } from 'preact'; -import { h, Fragment } from 'preact'; -import { useRef } from 'preact/hooks'; - -export type CardLinkProps = { - href: string; - name: string; - children: JSX | JSX[]; -}; - -const CardLink: Component = ({ - href, - name, - children, -}: CardLinkProps): JSX.Element => { - const Card = useRef(null); - /** - * Set Title Attribute when Hovering over Card - * @param e - Mouse Enter Event - */ - function handleOnMouseEnter(e) { - const cardBody = Card.current.querySelector('.card-body'); - const cardThumb = Card.current.querySelector('.icon-image'); - const cardImg = Card.current.querySelector('.heroImg'); - - if ( - e.target === cardBody || - e.target === cardThumb || - e.target === cardImg - ) { - e.target.setAttribute( - 'title', - `Click to find out more about our ${name} template` - ); - } - } - /** - * Click Link Card to Page - * @param e - Click Event - * @returns new window location - */ - function handleOnClick(e) { - const card = e.target; - const mainLink = card.querySelector('.main-link'); - const clickableArea = ['.card-body', '.icon-image', '.heroImg']; - for (let area of clickableArea) { - if (e.currentTarget.classList.contains(area)) { - return mainLink.click(); - } - } - } - return ( -
- {children} -
- ); -}; - -export default CardLink; -- cgit v1.2.3