mirror of https://github.com/mue/mue.git
refactor: minor cleanup
This commit is contained in:
parent
f5d9ad11a5
commit
cfd096ecc3
|
@ -1,4 +1,4 @@
|
|||
@import '../../../scss/variables';
|
||||
@import 'scss/variables';
|
||||
|
||||
.smallModal {
|
||||
@extend %tabText;
|
||||
|
|
|
@ -7,7 +7,7 @@ import { MdClose } from 'react-icons/md';
|
|||
import Tabs from './tabs/backend/Tabs';
|
||||
|
||||
import './scss/index.scss';
|
||||
import Tooltip from '../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
// Lazy load all the tabs instead of the modal itself
|
||||
const Settings = lazy(() => import('./tabs/Settings'));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import variables from 'modules/variables';
|
||||
import { PureComponent, Fragment } from 'react';
|
||||
import Tooltip from '../../../helpers/tooltip/Tooltip';
|
||||
import ImageCarousel from '../../../helpers/carousel/Carousel';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
import ImageCarousel from 'components/helpers/carousel/Carousel';
|
||||
import { toast } from 'react-toastify';
|
||||
import {
|
||||
MdIosShare,
|
||||
|
@ -20,7 +20,7 @@ import Modal from 'react-modal';
|
|||
|
||||
import { install, uninstall } from 'modules/helpers/marketplace';
|
||||
|
||||
import ShareModal from '../../../helpers/sharemodal/ShareModal';
|
||||
import ShareModal from 'components/helpers/sharemodal/ShareModal';
|
||||
|
||||
export default class Item extends PureComponent {
|
||||
constructor(props) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { memo } from 'react';
|
||||
import variables from 'modules/variables';
|
||||
import { MdClose } from 'react-icons/md';
|
||||
import Tooltip from '../../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
function SideloadFailedModal({ modalClose, reason }) {
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@import '../.../../../../../././../scss/variables';
|
||||
@import 'scss/variables';
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@import '../.../../../../../././../scss/variables';
|
||||
@import 'scss/variables';
|
||||
|
||||
.sidebar {
|
||||
@include themed {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@import '../../../../../scss/variables';
|
||||
@import 'scss/variables';
|
||||
|
||||
.tab-content {
|
||||
button {
|
||||
|
|
|
@ -249,6 +249,8 @@ h4 {
|
|||
}
|
||||
}
|
||||
|
||||
.customcss {
|
||||
color: orange !important;
|
||||
.customcss textarea {
|
||||
font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter',
|
||||
'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco,
|
||||
'Courier New', Courier, monospace !important;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* these are overrides for the material ui default styles */
|
||||
|
||||
@import '../../../../../../scss/variables';
|
||||
@import 'scss/variables';
|
||||
|
||||
.MuiCheckbox-colorPrimary.Mui-checked,
|
||||
.MuiSwitch-colorPrimary.Mui-checked,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@import '../../../../../../../scss/variables';
|
||||
@import 'scss/variables';
|
||||
|
||||
.sortableItem {
|
||||
@include themed {
|
||||
|
@ -111,9 +111,6 @@
|
|||
box-shadow: t($boxShadow);
|
||||
}
|
||||
|
||||
.previewContainer {
|
||||
}
|
||||
|
||||
.previewItem {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
|
@ -153,6 +150,7 @@
|
|||
.content {
|
||||
margin: 20px 20px 0;
|
||||
}
|
||||
|
||||
@include themed {
|
||||
background: t($modal-secondaryColour);
|
||||
border-radius: t($borderRadius);
|
||||
|
|
|
@ -9,7 +9,9 @@ import Chip from '@mui/material/Chip';
|
|||
|
||||
function ChipSelect({ label, options, name }) {
|
||||
let start = (localStorage.getItem('apiCategories') || '').split(',');
|
||||
if (start[0] === '') start = [];
|
||||
if (start[0] === '') {
|
||||
start = [];
|
||||
}
|
||||
|
||||
const [optionsSelected, setoptionsSelected] = useState(start);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import Switch from './Switch';
|
|||
import SettingsItem from './SettingsItem';
|
||||
|
||||
import { values } from 'modules/helpers/settings/modals';
|
||||
import Tooltip from '../../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
export default class Header extends PureComponent {
|
||||
render() {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { memo } from 'react';
|
|||
import variables from 'modules/variables';
|
||||
import { MdClose, MdRestartAlt } from 'react-icons/md';
|
||||
import { setDefaultSettings } from 'modules/helpers/settings';
|
||||
import Tooltip from '../../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
function ResetModal({ modalClose }) {
|
||||
const reset = () => {
|
||||
|
|
|
@ -54,6 +54,7 @@ export default class Text extends PureComponent {
|
|||
value={this.state.value}
|
||||
onChange={this.handleChange}
|
||||
varient="outlined"
|
||||
className={this.props.customcss ? 'customcss' : ''}
|
||||
multiline
|
||||
spellCheck={false}
|
||||
minRows={4}
|
||||
|
|
|
@ -34,7 +34,7 @@ function ExperimentalSettings() {
|
|||
marks={values('experimental')}
|
||||
element=".other"
|
||||
/>
|
||||
<p>Send Event</p>
|
||||
<p style={{ textAlign: 'left' }}>Send Event</p>
|
||||
<TextField
|
||||
label={'Type'}
|
||||
value={eventType}
|
||||
|
@ -51,14 +51,14 @@ function ExperimentalSettings() {
|
|||
varient="outlined"
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<SettingsItem
|
||||
title={variables.getMessage('modals.main.settings.sections.experimental.developer')}
|
||||
final={true}
|
||||
>
|
||||
<button className="uploadbg" onClick={() => EventBus.dispatch(eventType, eventName)}>
|
||||
<button className="uploadbg" onClick={() => EventBus.dispatch(eventType, eventName)}>
|
||||
Send
|
||||
</button>
|
||||
</SettingsItem>
|
||||
<SettingsItem
|
||||
title='Data'
|
||||
final={true}
|
||||
>
|
||||
<button
|
||||
className="reset"
|
||||
style={{ marginLeft: '0px' }}
|
||||
|
|
|
@ -78,7 +78,7 @@ export default class Message extends PureComponent {
|
|||
</SettingsItem>
|
||||
<div className="messagesContainer">
|
||||
{this.state.messages.map((_url, index) => (
|
||||
<div className="messageMap">
|
||||
<div className="messageMap" key={index}>
|
||||
<div className="flexGrow">
|
||||
<div className="icon">
|
||||
<MdOutlineTextsms />
|
||||
|
|
|
@ -130,7 +130,7 @@ export default class AdvancedSettings extends PureComponent {
|
|||
'modals.main.settings.sections.advanced.custom_css_subtitle',
|
||||
)}
|
||||
>
|
||||
<Text name="customcss" textarea={true} category="other" />
|
||||
<Text name="customcss" textarea={true} category="other" customcss={true} />
|
||||
</SettingsItem>
|
||||
<SettingsItem
|
||||
title={variables.getMessage('modals.main.settings.sections.experimental.title')}
|
||||
|
|
|
@ -15,7 +15,7 @@ import { videoCheck } from 'modules/helpers/background/widget';
|
|||
|
||||
import Checkbox from '../../Checkbox';
|
||||
import FileUpload from '../../FileUpload';
|
||||
import Tooltip from '../../../../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
import Modal from 'react-modal';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import variables from 'modules/variables';
|
||||
import { useState, memo } from 'react';
|
||||
import { MdAdd, MdClose } from 'react-icons/md';
|
||||
import Tooltip from '../../../../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
function CustomURLModal({ modalClose, modalCloseOnly }) {
|
||||
const [url, setURL] = useState();
|
||||
|
|
|
@ -14,9 +14,9 @@ import {
|
|||
MdCategory as Category,
|
||||
MdVisibilityOff as VisibilityOff,
|
||||
} from 'react-icons/md';
|
||||
import Tooltip from '../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
import Modal from 'react-modal';
|
||||
import ShareModal from '../../helpers/sharemodal/ShareModal';
|
||||
import ShareModal from 'components/helpers/sharemodal/ShareModal';
|
||||
import ExcludeModal from './ExcludeModal';
|
||||
|
||||
const toDataURL = async (url) => {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { MdContentCopy, MdAssignment, MdPushPin, MdDownload } from 'react-icons/
|
|||
import { useFloating, shift } from '@floating-ui/react-dom';
|
||||
import TextareaAutosize from '@mui/material/TextareaAutosize';
|
||||
import { toast } from 'react-toastify';
|
||||
import Tooltip from '../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
import { saveFile } from 'modules/helpers/settings/modals';
|
||||
import EventBus from 'modules/helpers/eventbus';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
MdPlaylistRemove,
|
||||
} from 'react-icons/md';
|
||||
import TextareaAutosize from '@mui/material/TextareaAutosize';
|
||||
import Tooltip from '../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
import Checkbox from '@mui/material/Checkbox';
|
||||
import { shift, useFloating } from '@floating-ui/react-dom';
|
||||
import { sortableContainer, sortableElement, sortableHandle } from 'react-sortable-hoc';
|
||||
|
|
|
@ -11,9 +11,9 @@ import {
|
|||
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
import Tooltip from '../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
import Modal from 'react-modal';
|
||||
import ShareModal from '../../helpers/sharemodal/ShareModal';
|
||||
import ShareModal from 'components/helpers/sharemodal/ShareModal';
|
||||
|
||||
import offline_quotes from './offline_quotes.json';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { MdDisabledVisible } from 'react-icons/md';
|
|||
import WeatherIcon from './WeatherIcon';
|
||||
import WindDirectionIcon from './WindDirectionIcon';
|
||||
|
||||
import Tooltip from '../../helpers/tooltip/Tooltip';
|
||||
import Tooltip from 'components/helpers/tooltip/Tooltip';
|
||||
|
||||
function Expanded({ state, weatherType, variables }) {
|
||||
const enabled = (setting) => {
|
||||
|
|
|
@ -15,38 +15,43 @@ import {
|
|||
function WindDirectionIcon({ degrees }) {
|
||||
// convert the number OpenWeatherMap gives us to the closest direction or something
|
||||
const directions = [
|
||||
'North',
|
||||
'North-West',
|
||||
'West',
|
||||
'South-West',
|
||||
'South',
|
||||
'South-East',
|
||||
'East',
|
||||
'North-East',
|
||||
{
|
||||
name: 'North',
|
||||
icon: <WiDirectionUp />,
|
||||
},
|
||||
{
|
||||
name: 'North-West',
|
||||
icon: <WiDirectionUpLeft />,
|
||||
},
|
||||
{
|
||||
name: 'West',
|
||||
icon: <WiDirectionLeft />,
|
||||
},
|
||||
{
|
||||
name: 'South-West',
|
||||
icon: <WiDirectionDownLeft />,
|
||||
},
|
||||
{
|
||||
name: 'South',
|
||||
icon: <WiDirectionDown />,
|
||||
},
|
||||
{
|
||||
name: 'South-East',
|
||||
icon: <WiDirectionDownRight />,
|
||||
},
|
||||
{
|
||||
name: 'East',
|
||||
icon: <WiDirectionRight />,
|
||||
},
|
||||
{
|
||||
name: 'North-East',
|
||||
icon: <WiDirectionUpRight />,
|
||||
},
|
||||
];
|
||||
const direction =
|
||||
directions[Math.round(((degrees %= 360) < 0 ? degrees + 360 : degrees) / 45) % 8];
|
||||
|
||||
switch (direction) {
|
||||
case 'North':
|
||||
return <WiDirectionUp />;
|
||||
case 'North-West':
|
||||
return <WiDirectionUpLeft />;
|
||||
case 'West':
|
||||
return <WiDirectionLeft />;
|
||||
case 'South-West':
|
||||
return <WiDirectionDownLeft />;
|
||||
case 'South':
|
||||
return <WiDirectionDown />;
|
||||
case 'South-East':
|
||||
return <WiDirectionDownRight />;
|
||||
case 'East':
|
||||
return <WiDirectionRight />;
|
||||
case 'North-East':
|
||||
return <WiDirectionUpRight />;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return direction ? direction.icon : null;
|
||||
}
|
||||
|
||||
export default memo(WindDirectionIcon);
|
||||
|
|
Loading…
Reference in New Issue