From fd54ae2ca2fbce35334ab3ef2cccc82b55570373 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Fri, 18 Dec 2020 19:00:46 +0000 Subject: [PATCH] added icons class to handle svg elements --- websrc/components/Icons.tsx | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 websrc/components/Icons.tsx diff --git a/websrc/components/Icons.tsx b/websrc/components/Icons.tsx new file mode 100644 index 0000000..eaeba3c --- /dev/null +++ b/websrc/components/Icons.tsx @@ -0,0 +1,50 @@ +import React, {Component} from "react"; + +type IconProps = { + width: number, + height: number, +} + +class Icon extends Component { + private readonly width: string; + private readonly height: string; + + constructor(props) { + super(props); + + this.width = "w-" + this.props.width.toString(); + this.height = "h-" + this.props.width.toString(); + } + + dimensionsClassName() { + return (this.height + " " + this.width) + } +} + + +export class DollarIcon extends Icon { + render() { + return ( + + + + ) + } +} + +export class ClockIcon extends Icon { + render() { + return ( + + + + ) + } +} +