Skip to content

Commit

Permalink
refactor: remove lots of unused/unfinished code, change vite to mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcralph committed Jan 5, 2024
1 parent 3a2cbb3 commit 96f1635
Show file tree
Hide file tree
Showing 57 changed files with 3 additions and 916 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"embla-carousel-react": "8.0.0-rc18",
"fast-blurhash": "^1.1.2",
"image-conversion": "^2.1.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-clock": "4.6.0",
"react-dom": "^18.2.0",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions src/components/helpers/autocomplete/Autocomplete.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PureComponent } from 'react';
import PropTypes from 'prop-types';

import EventBus from 'modules/helpers/eventbus';

Expand Down Expand Up @@ -93,11 +92,4 @@ class Autocomplete extends PureComponent {
}
}

Autocomplete.propTypes = {
suggestions: PropTypes.arrayOf(PropTypes.string).isRequired,
onChange: PropTypes.func.isRequired,
onClick: PropTypes.func.isRequired,
placeholder: PropTypes.string,
};

export default Autocomplete;
5 changes: 0 additions & 5 deletions src/components/helpers/carousel/Carousel.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState, useEffect, useCallback, useRef, memo } from 'react';
import PropTypes from 'prop-types';
import { MdOutlineArrowForwardIos, MdOutlineArrowBackIos } from 'react-icons/md';
import useEmblaCarousel from 'embla-carousel-react';
import Autoplay from 'embla-carousel-autoplay';
Expand Down Expand Up @@ -78,8 +77,4 @@ function EmblaCarousel({ data }) {
);
}

EmblaCarousel.propTypes = {
data: PropTypes.arrayOf(PropTypes.object).isRequired,
};

export default memo(EmblaCarousel);
5 changes: 0 additions & 5 deletions src/components/helpers/preview/Preview.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';
import PropTypes from 'prop-types';
import variables from 'modules/variables';
import './preview.scss';

Expand All @@ -15,8 +14,4 @@ function Preview(props) {
);
}

Preview.propTypes = {
setup: PropTypes.func.isRequired,
};

export default memo(Preview);
6 changes: 0 additions & 6 deletions src/components/helpers/sharemodal/ShareModal.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';
import PropTypes from 'prop-types';
import variables from 'modules/variables';
import { MdClose, MdEmail, MdContentCopy } from 'react-icons/md';
import { FaTwitter, FaFacebookF } from 'react-icons/fa';
Expand Down Expand Up @@ -124,9 +123,4 @@ function ShareModal({ modalClose, data }) {
);
}

ShareModal.propTypes = {
modalClose: PropTypes.func.isRequired,
data: PropTypes.string.isRequired,
};

export default memo(ShareModal);
9 changes: 0 additions & 9 deletions src/components/helpers/tooltip/Tooltip.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState, memo } from 'react';
import PropTypes from 'prop-types';
import { useFloating, flip, offset, shift } from '@floating-ui/react-dom';
import './tooltip.scss';

Expand Down Expand Up @@ -48,12 +47,4 @@ function Tooltip({ children, title, style, placement, subtitle }) {
);
}

Tooltip.propTypes = {
children: PropTypes.node.isRequired,
title: PropTypes.string.isRequired,
style: PropTypes.object,
placement: PropTypes.string,
subtitle: PropTypes.string.isRequired,
};

export default memo(Tooltip);
59 changes: 0 additions & 59 deletions src/components/helpers/tooltip/infoTooltip.jsx

This file was deleted.

49 changes: 0 additions & 49 deletions src/components/helpers/tooltip/tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,52 +96,3 @@
}
}
}

.infoTooltipTitle {
min-width: 200px;
position: absolute;
z-index: 1;
cursor: initial;
user-select: none;
opacity: 1;
text-align: left;
padding: 25px;
display: flex;
justify-content: center;
flex-flow: column;
gap: 10px;

@include themed {
background-color: t($modal-background);
border-radius: t($borderRadius);
box-shadow: 0 0 0 1px t($modal-sidebarActive);
}

.tooltipHeader {
display: flex;
flex-flow: row;
align-items: center;
gap: 25px;
}

.link {
display: flex;
gap: 10px;
align-items: center;
}

.close {
font-size: 20px;
padding: 15px;
place-items: center;
display: grid;
cursor: pointer;

&:hover {
@include themed {
background: t($modal-sidebar);
border-radius: t($borderRadius);
}
}
}
}
5 changes: 0 additions & 5 deletions src/components/modals/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import variables from 'modules/variables';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';

import { MdErrorOutline } from 'react-icons/md';
import { captureException } from '@sentry/react';
Expand Down Expand Up @@ -71,8 +70,4 @@ class ErrorBoundary extends PureComponent {
}
}

ErrorBoundary.propTypes = {
children: PropTypes.node.isRequired,
};

export default ErrorBoundary;
5 changes: 0 additions & 5 deletions src/components/modals/main/Main.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import variables from 'modules/variables';
import { Suspense, lazy, useState, memo } from 'react';
import PropTypes from 'prop-types';

import { MdClose } from 'react-icons/md';

Expand Down Expand Up @@ -69,8 +68,4 @@ function MainModal({ modalClose }) {
);
}

MainModal.propTypes = {
modalClose: PropTypes.func.isRequired,
};

export default memo(MainModal);
8 changes: 0 additions & 8 deletions src/components/modals/main/marketplace/Item.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import variables from 'modules/variables';
import { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import Tooltip from 'components/helpers/tooltip/Tooltip';
import ImageCarousel from 'components/helpers/carousel/Carousel';
import { toast } from 'react-toastify';
Expand Down Expand Up @@ -335,11 +334,4 @@ class Item extends PureComponent {
}
}

Item.propTypes = {
data: PropTypes.object,
addonInstalled: PropTypes.bool,
addonInstalledVersion: PropTypes.string,
toggleFunction: PropTypes.func,
};

export default Item;
11 changes: 0 additions & 11 deletions src/components/modals/main/marketplace/Items.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import variables from 'modules/variables';
import React, { memo } from 'react';
import PropTypes from 'prop-types';
import { MdAutoFixHigh, MdOutlineArrowForward, MdOutlineOpenInNew } from 'react-icons/md';

function Items({
Expand Down Expand Up @@ -113,14 +112,4 @@ function Items({
);
}

Items.propTypes = {
type: PropTypes.string.isRequired,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
collection: PropTypes.object,
toggleFunction: PropTypes.func.isRequired,
collectionFunction: PropTypes.func.isRequired,
onCollection: PropTypes.bool.isRequired,
filter: PropTypes.string,
};

export default memo(Items);
6 changes: 0 additions & 6 deletions src/components/modals/main/marketplace/Lightbox.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';
import PropTypes from 'prop-types';
import variables from 'modules/variables';

function Lightbox({ modalClose, img }) {
Expand All @@ -15,9 +14,4 @@ function Lightbox({ modalClose, img }) {
);
}

Lightbox.propTypes = {
modalClose: PropTypes.func.isRequired,
img: PropTypes.string.isRequired,
};

export default memo(Lightbox);
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';
import PropTypes from 'prop-types';
import variables from 'modules/variables';
import { MdClose } from 'react-icons/md';
import Tooltip from 'components/helpers/tooltip/Tooltip';
Expand All @@ -23,9 +22,4 @@ function SideloadFailedModal({ modalClose, reason }) {
);
}

SideloadFailedModal.propTypes = {
modalClose: PropTypes.func.isRequired,
reason: PropTypes.string.isRequired,
};

export default memo(SideloadFailedModal);
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import variables from 'modules/variables';
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { toast } from 'react-toastify';
import {
MdWifiOff,
Expand Down Expand Up @@ -451,8 +450,4 @@ class Marketplace extends PureComponent {
}
}

Marketplace.propTypes = {
type: PropTypes.string,
};

export default Marketplace;
Loading

0 comments on commit 96f1635

Please sign in to comment.