From 4090f67d2efc4e4fbef86fd229f1528c46049c55 Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Tue, 27 Jun 2023 20:16:25 -0300 Subject: [PATCH] remove unused old components --- src/components/DismissibleCard.tsx | 64 --------------------------- src/components/SelectableCard.tsx | 69 ------------------------------ 2 files changed, 133 deletions(-) delete mode 100644 src/components/DismissibleCard.tsx delete mode 100644 src/components/SelectableCard.tsx diff --git a/src/components/DismissibleCard.tsx b/src/components/DismissibleCard.tsx deleted file mode 100644 index 013c0669a5c..00000000000 --- a/src/components/DismissibleCard.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React, { useState, useEffect } from "react" -import styled from "@emotion/styled" - -import Icon from "./Icon" - -const Card = styled.div<{ - shouldShow: boolean -}>` - display: ${(props) => (props.shouldShow ? `block` : `none`)}; - position: relative; - background: ${(props) => props.theme.colors.warning}; - padding: 1.5rem; - border-radius: 4px; - color: ${(props) => props.theme.colors.black300}; - @media (max-width: ${(props) => props.theme.breakpoints.l}) { - margin-bottom: 2rem; - } -` - -const CloseIconContainer = styled.span` - position: absolute; - cursor: pointer; - top: 1.5rem; - right: 1.5rem; - - & > svg { - fill: ${(props) => props.theme.colors.black300}; - } -` - -export interface IProps { - children?: React.ReactNode - storageKey: string -} - -const DismissibleCard: React.FC = ({ children, storageKey }) => { - const [shouldShow, setshouldShow] = useState(false) - - useEffect(() => { - if (localStorage && localStorage.getItem(storageKey) !== null) { - setshouldShow(false) - } else { - setshouldShow(true) - } - }, [storageKey]) - - const handleClose = () => { - if (localStorage) { - localStorage.setItem(storageKey, "true") - } - setshouldShow(false) - } - - return ( - - - - - {children} - - ) -} - -export default DismissibleCard diff --git a/src/components/SelectableCard.tsx b/src/components/SelectableCard.tsx deleted file mode 100644 index be9eeec949d..00000000000 --- a/src/components/SelectableCard.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import React from "react" -import styled from "@emotion/styled" -import { Checkbox } from "@chakra-ui/react" -import Emoji from "./OldEmoji" - -const StyledCard = styled.div` - display: flex; - flex-direction: column; - justify-content: space-between; - background: ${(props) => props.theme.colors.searchBackground}; - border-radius: 4px; - border: 1px solid ${(props) => props.theme.colors.lightBorder}; - padding: 1.5rem; - cursor: pointer; -` - -const Description = styled.p` - opacity: 0.8; -` - -const TopContent = styled.div` - position: relative; -` -export interface IProps { - children?: React.ReactNode - emoji: string - title: string - description: string - className?: string - onSelect: (val: string) => void - value: string - isSelected?: boolean -} - -const Card: React.FC = ({ - emoji, - title, - description, - children, - className, - onSelect, - value, - isSelected = false, -}) => { - const handleSelect = () => { - onSelect(value) - } - - return ( - - - - -

{title}

- {description} -
- {children} -
- ) -} - -export default Card