mirror of
https://github.com/mue/mue.git
synced 2026-07-18 06:24:17 +02:00
refactor: make modals like widgets
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user