From f5b984d7d564b02a048b730502608b1540255a65 Mon Sep 17 00:00:00 2001 From: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:39:04 -0300 Subject: [PATCH] fix: Remove unused components (#457) --- src/components/App.tsx | 3 +- src/components/desktop/DownloadProgress.tsx | 26 -------- .../download/DownloadDesktopToast.css | 26 -------- .../download/DownloadDesktopToast.tsx | 34 ---------- src/components/download/DownloadModal.css | 65 ------------------- src/components/download/DownloadModal.tsx | 65 ------------------- 6 files changed, 1 insertion(+), 218 deletions(-) delete mode 100644 src/components/desktop/DownloadProgress.tsx delete mode 100644 src/components/download/DownloadDesktopToast.css delete mode 100644 src/components/download/DownloadDesktopToast.tsx delete mode 100644 src/components/download/DownloadModal.css delete mode 100644 src/components/download/DownloadModal.tsx diff --git a/src/components/App.tsx b/src/components/App.tsx index dba80d5d..783865f6 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -11,8 +11,7 @@ import { isLoginComplete, ABTestingVariant, getFeatureVariantName, - getFeatureVariantValue, - isFeatureEnabled + getFeatureVariantValue } from '../state/selectors' import { isMobile } from '../integration/browser' import { LoadingRender } from './common/Loading/LoadingRender' diff --git a/src/components/desktop/DownloadProgress.tsx b/src/components/desktop/DownloadProgress.tsx deleted file mode 100644 index 64d3636e..00000000 --- a/src/components/desktop/DownloadProgress.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react' -import { connect } from 'react-redux' -import { DownloadCurrentState, StoreType } from '../../state/redux' - -function mapStateToProps(state: StoreType): DownloaderProps { - return { - progress: state.download.progress, - currentState: state.download.currentState - } -} - -export interface DownloaderProps { - currentState: DownloadCurrentState - progress: number -} - -const DownloadProgress: React.FC = (props) => { - return ( -
- {props.currentState === DownloadCurrentState.DOWNLOADING &&

{Math.round(props.progress)}%

} - {props.currentState === DownloadCurrentState.READY &&

Ready!

} -
- ) -} - -export default connect(mapStateToProps)(DownloadProgress) \ No newline at end of file diff --git a/src/components/download/DownloadDesktopToast.css b/src/components/download/DownloadDesktopToast.css deleted file mode 100644 index d709ad3c..00000000 --- a/src/components/download/DownloadDesktopToast.css +++ /dev/null @@ -1,26 +0,0 @@ -.ShowDownloadDesktopToast { - visibility: visible -} - -.HideDownloadDesktopToast { - visibility: hidden -} - -.DownloadDesktopApp { - display: block; - background: rgba(0, 0, 0, 0.48); - border-radius: 24px; - color: white; - font-weight: 300; - font-size: 15px; - line-height: 24px; - padding: 12px 24px 12px 46px; - background-image: url('../../images/warning.svg'); - background-repeat: no-repeat; - background-position: 14px 14px; - cursor: pointer; -} - -.DownloadDesktopApp span { - text-decoration: underline; -} \ No newline at end of file diff --git a/src/components/download/DownloadDesktopToast.tsx b/src/components/download/DownloadDesktopToast.tsx deleted file mode 100644 index 7b85779c..00000000 --- a/src/components/download/DownloadDesktopToast.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React, { useMemo } from 'react' -import { isElectron } from '../../integration/desktop' -import { isWindows, isMacOS } from '../../integration/browser' -import './DownloadDesktopToast.css' - -export const DownloadDesktopToast = React.memo(() => { - const platform = useMemo(() => { - if (isWindows()) { - return 'windows' - } else if (isMacOS()) { - return 'mac' - } else { - return null - } - }, []) - - const wrapperClassName = useMemo( - () => !isElectron() && !!platform ? 'ShowDownloadDesktopToast' : 'HideDownloadDesktopToast', - [platform] - ) - - return ( -
- - Want to play on {platform}? Download the desktop client - -
- ) -}) diff --git a/src/components/download/DownloadModal.css b/src/components/download/DownloadModal.css deleted file mode 100644 index 7a26cf9e..00000000 --- a/src/components/download/DownloadModal.css +++ /dev/null @@ -1,65 +0,0 @@ -.ui.modal.visible.active.DownloadModal { - width: 800px!important; - border: none; - border-radius: 20px; - overflow: hidden; -} - -.ui.modal.visible.active.DownloadModal .dcl.close > .close-icon { - background-image: url(../../images/close-icon.svg) -} - -.ui.modal.visible.active.DownloadModal > .content { - margin: 0; - display: flex; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__ImageContainer { - width: 400px; - height: 450px; - background-size: cover; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__TextContainer { - width: 400px; - height: 450px; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__TextContainer > .dcl.hero { - padding: 70px; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__TextContainer > .dcl.hero > .ui.container > .ui.header.hero-subtitle { - font-weight: 700; - font-size: 14px; - line-height: 17px; - text-transform: uppercase; - color: #716B7C; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__TextContainer > .dcl.hero >.ui.container > .ui.header.hero-title { - font-weight: 700; - font-size: 30px; - line-height: 120%; - color: var(--text); - margin-top: 10px; - margin-bottom: 24px; -} - -.ui.modal.visible.active.DownloadModal>.content>.DownloadModal__TextContainer>.dcl.hero>.ui.container>.ui.header.hero-title span { - text-transform: capitalize; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__TextContainer > .dcl.hero > .hero-content { - position: inherit; - font-weight: 400; - font-size: 15px; - line-height: 24px; - letter-spacing: -0.2px; - color: #000000; -} - -.ui.modal.visible.active.DownloadModal > .content > .DownloadModal__TextContainer > .dcl.hero >.ui.container.hero-actions > .button { - width: 75%; - border-radius: 15px; -} diff --git a/src/components/download/DownloadModal.tsx b/src/components/download/DownloadModal.tsx deleted file mode 100644 index 03a644d8..00000000 --- a/src/components/download/DownloadModal.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react' -import { Button } from 'decentraland-ui/dist/components/Button/Button' -import { Close } from 'decentraland-ui/dist/components/Close/Close' -import { Hero } from 'decentraland-ui/dist/components/Hero/Hero' -import { Modal } from 'decentraland-ui/dist/components/Modal/Modal' -import { launchDesktopApp } from '../../integration/desktop' -import { - isWindows, - isMacOS, - setDownloadModalShown, - hasDownloadModalShown -} from '../../integration/browser' -import ModalImage from '../../images/dcl-modal-image.jpeg' -import './DownloadModal.css' - -export const DownloadModal = React.memo(() => { - const platform = useMemo(() => { - if (isWindows()) { - return 'windows' - } else if (isMacOS()) { - return 'mac' - } else { - return null - } - }, []) - - const [open, setOpen] = useState(false) - - useEffect(() => { - if (platform && !hasDownloadModalShown()) { - launchDesktopApp().then((launched) => { - setOpen(!launched) - }) - } - }, [platform]) - - const handleClose = useCallback(() => { - setDownloadModalShown() - setOpen(false) - }, []) - - return ( - } onClose={handleClose}> - -
-
- - - Decentraland for {platform} - - - With the Desktop Client, your visit to Decentraland will be faster and{' '} - more stable with better performance and graphics. - - - - - -
-
-
- ) -})