refactor: make modals like widgets

This commit is contained in:
David Ralph
2021-03-20 12:55:20 +00:00
parent 0c71f0ebef
commit ab7681f3d0
44 changed files with 362 additions and 117 deletions

View File

@@ -2,8 +2,6 @@ import React from 'react';
import PhotoInformation from './PhotoInformation';
import * as Constants from '../../../modules/constants';
import './scss/index.scss';
export default class Background extends React.PureComponent {
@@ -158,11 +156,11 @@ export default class Background extends React.PureComponent {
let requestURL, data;
switch (backgroundAPI) {
case 'unsplash':
requestURL = `${Constants.UNSPLASH_URL}/getImage`;
requestURL = `${window.constants.UNSPLASH_URL}/getImage`;
break;
// Defaults to Mue
default:
requestURL = `${Constants.API_URL}/getImage?category=Outdoors`;
requestURL = `${window.constants.API_URL}/getImage?category=Outdoors`;
break;
}

View File

@@ -6,8 +6,6 @@ import NotesIcon from '@material-ui/icons/AssignmentRounded';
import Tooltip from '@material-ui/core/Tooltip';
import Report from '@material-ui/icons/SmsFailed';
import * as Constants from '../../../modules/constants';
import './scss/index.scss';
// the user probably won't use the notes feature every time so we lazy load
@@ -28,7 +26,7 @@ export default function Navbar(props) {
</div>
:null}
{(Constants.BETA_VERSION === true) ?
{(window.constants.BETA_VERSION === true) ?
<Tooltip title='Feedback' placement='top'>
<Report className='topicons' onClick={() => props.openModal('feedbackModal')}/>
</Tooltip>

View File

@@ -7,8 +7,6 @@ import StarIcon2 from '@material-ui/icons/StarBorder';
import { toast } from 'react-toastify';
import * as Constants from '../../../modules/constants';
import './quote.scss';
@@ -94,7 +92,7 @@ export default class Quote extends React.PureComponent {
// First we try and get a quote from the API...
try {
const data = await (await fetch(Constants.API_URL + '/getQuote?language=' + localStorage.getItem('quotelanguage'))).json();
const data = await (await fetch(window.constants.API_URL + '/getQuote?language=' + localStorage.getItem('quotelanguage'))).json();
// If we hit the ratelimit, we fallback to local quotes
if (data.statusCode === 429) {

View File

@@ -17,6 +17,7 @@
-webkit-transition: width 0.5s ease-in-out;
transition: width 0.5s ease-in-out;
color: white;
padding: 0.5rem 1rem;
&:focus {
width: 400px;