mirror of https://github.com/mue/mue.git
fix: welcome import, widget zoom
This commit is contained in:
parent
a21528f998
commit
8f9735044a
10
package.json
10
package.json
|
@ -15,8 +15,8 @@
|
||||||
"@emotion/react": "^11.11.4",
|
"@emotion/react": "^11.11.4",
|
||||||
"@emotion/styled": "^11.11.5",
|
"@emotion/styled": "^11.11.5",
|
||||||
"@floating-ui/react-dom": "2.0.8",
|
"@floating-ui/react-dom": "2.0.8",
|
||||||
"@fontsource/lexend-deca": "5.0.8",
|
"@fontsource/lexend-deca": "5.0.12",
|
||||||
"@fontsource/montserrat": "5.0.16",
|
"@fontsource/montserrat": "5.0.17",
|
||||||
"@muetab/react-color-gradient-picker": "0.1.2",
|
"@muetab/react-color-gradient-picker": "0.1.2",
|
||||||
"@muetab/react-sortable-hoc": "^2.0.1",
|
"@muetab/react-sortable-hoc": "^2.0.1",
|
||||||
"@mui/material": "5.15.15",
|
"@mui/material": "5.15.15",
|
||||||
|
@ -33,12 +33,12 @@
|
||||||
"react-toastify": "10.0.5"
|
"react-toastify": "10.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.2.1",
|
"@commitlint/cli": "^19.2.2",
|
||||||
"@commitlint/config-conventional": "^19.1.0",
|
"@commitlint/config-conventional": "^19.2.2",
|
||||||
"@eartharoid/deep-merge": "^0.0.2",
|
"@eartharoid/deep-merge": "^0.0.2",
|
||||||
"@vitejs/plugin-react-swc": "^3.6.0",
|
"@vitejs/plugin-react-swc": "^3.6.0",
|
||||||
"adm-zip": "^0.5.12",
|
"adm-zip": "^0.5.12",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.0.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-config-react-app": "^7.0.1",
|
"eslint-config-react-app": "^7.0.1",
|
||||||
"husky": "^9.0.11",
|
"husky": "^9.0.11",
|
||||||
|
|
2534
pnpm-lock.yaml
2534
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -65,26 +65,24 @@ function Header(props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="modalHeader">
|
||||||
<div className="modalHeader">
|
<span className="mainTitle">
|
||||||
<span className="mainTitle">
|
{props.secondaryTitle && (
|
||||||
{props.secondaryTitle && (
|
<>
|
||||||
<>
|
<span className="backTitle" onClick={props.goBack}>
|
||||||
<span className="backTitle" onClick={props.goBack}>
|
{props.title}
|
||||||
{props.title}
|
</span>
|
||||||
</span>
|
<MdOutlineKeyboardArrowRight />
|
||||||
<MdOutlineKeyboardArrowRight />
|
</>
|
||||||
</>
|
)}
|
||||||
)}
|
{props.secondaryTitle || props.title}
|
||||||
{props.secondaryTitle || props.title}
|
</span>
|
||||||
</span>
|
<div className="headerActions">
|
||||||
<div className="headerActions">
|
{props.visibilityToggle && <VisibilityToggle />}
|
||||||
{props.visibilityToggle && <VisibilityToggle />}
|
{props.report !== false && <ReportButton />}
|
||||||
{props.report !== false && <ReportButton />}
|
{props.children}
|
||||||
{props.children}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ const GreetingOptions = () => {
|
||||||
{CustomEventsSection()}
|
{CustomEventsSection()}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<PreferencesWrapper setting="greeting" zoomSetting="zoomGreeting" visibilityToggle={true}>
|
<PreferencesWrapper setting="greeting" zoomSetting="zoomGreeting" category="greeting" visibilityToggle={true}>
|
||||||
<AdditionalOptions />
|
<AdditionalOptions />
|
||||||
<Section
|
<Section
|
||||||
title="Events"
|
title="Events"
|
||||||
|
|
|
@ -69,7 +69,12 @@ class MessageOptions extends PureComponent {
|
||||||
zoomSetting="zoomMessage"
|
zoomSetting="zoomMessage"
|
||||||
visibilityToggle={true}
|
visibilityToggle={true}
|
||||||
/>
|
/>
|
||||||
<PreferencesWrapper setting="message" visibilityToggle={true} zoomSetting="zoomMessage">
|
<PreferencesWrapper
|
||||||
|
setting="message"
|
||||||
|
visibilityToggle={true}
|
||||||
|
category="message"
|
||||||
|
zoomSetting="zoomMessage"
|
||||||
|
>
|
||||||
<Row final={true}>
|
<Row final={true}>
|
||||||
<Content title={variables.getMessage(`${MESSAGE_SECTION}.messages`)} />
|
<Content title={variables.getMessage(`${MESSAGE_SECTION}.messages`)} />
|
||||||
<Action>
|
<Action>
|
||||||
|
|
|
@ -37,7 +37,7 @@ function ExperimentalOptions() {
|
||||||
marks={values.experimental}
|
marks={values.experimental}
|
||||||
element=".other"
|
element=".other"
|
||||||
/>
|
/>
|
||||||
<p style={{ textAlign: 'left' }}>Send Event</p>
|
<p style={{ textAlign: 'left', width: '100%' }}>Send Event</p>
|
||||||
<TextField
|
<TextField
|
||||||
label={'Type'}
|
label={'Type'}
|
||||||
value={eventType}
|
value={eventType}
|
||||||
|
@ -57,7 +57,7 @@ function ExperimentalOptions() {
|
||||||
<Button
|
<Button
|
||||||
type="settings"
|
type="settings"
|
||||||
onClick={() => EventBus.emit(eventType, eventName)}
|
onClick={() => EventBus.emit(eventType, eventName)}
|
||||||
label="send"
|
label="Send"
|
||||||
/>
|
/>
|
||||||
</Action>
|
</Action>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
@ -15,16 +15,16 @@ function ClockSkeleton() {
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
} else if (localStorage.getItem('timeType') === 'percentageComplete') {
|
} else if (localStorage.getItem('timeType') === 'percentageComplete') {
|
||||||
return <span className="new-clock clock-container clockSkeleton">68%</span>;
|
return <span className="vertical-clock clock-container clockSkeleton">68%</span>;
|
||||||
} else if (localStorage.getItem('timeType') === 'verticalClock') {
|
} else if (localStorage.getItem('timeType') === 'verticalClock') {
|
||||||
return (
|
return (
|
||||||
<span className="new-clock clock-container" style={{ fontSize: '30px' }}>
|
<span className="vertical-clock clock-container" style={{ fontSize: '30px' }}>
|
||||||
<div className="hour">10</div>
|
<div className="hour">10</div>
|
||||||
<div className="minute">23</div>
|
<div className="minute">23</div>
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return <span className="new-clock clock-container clockSkeleton">10:24</span>;
|
return <span className="vertical-clock clock-container clockSkeleton">10:24</span>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,7 @@ class QuickLinksOptions extends PureComponent {
|
||||||
/>
|
/>
|
||||||
<PreferencesWrapper
|
<PreferencesWrapper
|
||||||
setting="quicklinksenabled"
|
setting="quicklinksenabled"
|
||||||
|
category="quicklinks"
|
||||||
visibilityToggle={true}
|
visibilityToggle={true}
|
||||||
zoomSetting="zoomQuicklinks"
|
zoomSetting="zoomQuicklinks"
|
||||||
>
|
>
|
||||||
|
|
|
@ -277,7 +277,12 @@ class QuoteOptions extends PureComponent {
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
{!this.state.sourceSection && (
|
{!this.state.sourceSection && (
|
||||||
<PreferencesWrapper setting="quote" zoomSetting="zoomQuote" visibilityToggle={true}>
|
<PreferencesWrapper
|
||||||
|
setting="quote"
|
||||||
|
zoomSetting="zoomQuote"
|
||||||
|
category="quote"
|
||||||
|
visibilityToggle={true}
|
||||||
|
>
|
||||||
<Section
|
<Section
|
||||||
icon={<MdSource />}
|
icon={<MdSource />}
|
||||||
title={variables.getMessage('modals.main.settings.sections.background.source.title')}
|
title={variables.getMessage('modals.main.settings.sections.background.source.title')}
|
||||||
|
|
|
@ -73,16 +73,17 @@ class Stats extends PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const achievementElement = (key, id, achieved, timestamp) => {
|
const achievementElement = (key, id, achieved, timestamp) => {
|
||||||
const { name, description } = getLocalisedAchievementData(id);
|
const { name, description } = getLocalisedAchievementData(id);
|
||||||
console.log(timestamp);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="achievement" key={key}>
|
<div className="achievement" key={key}>
|
||||||
{achieved ? <FaTrophy className="trophy" /> : <MdLock className="trophyLocked" />}
|
{achieved ? <FaTrophy className="trophy" /> : <MdLock className="trophyLocked" />}
|
||||||
<div className={'achievementContent' + (achieved ? ' achieved' : '')}>
|
<div className={'achievementContent' + (achieved ? ' achieved' : '')}>
|
||||||
{achieved ? (
|
{achieved ? (
|
||||||
<span className="timestamp">
|
timestamp !== undefined ? (
|
||||||
<MdAccessTime /> {new Date(timestamp).toLocaleDateString()}
|
<span className="timestamp">
|
||||||
</span>
|
<MdAccessTime /> {new Date(timestamp).toLocaleDateString()}
|
||||||
|
</span>
|
||||||
|
) : null
|
||||||
) : null}
|
) : null}
|
||||||
<span className="achievementTitle">{name}</span>
|
<span className="achievementTitle">{name}</span>
|
||||||
<span className="subtitle">{achieved ? description : '?????'}</span>
|
<span className="subtitle">{achieved ? description : '?????'}</span>
|
||||||
|
@ -165,7 +166,7 @@ class Stats extends PureComponent {
|
||||||
)}
|
)}
|
||||||
{statsElement(
|
{statsElement(
|
||||||
variables.getMessage(`${STATS_SECTION}.sections.addons_installed`),
|
variables.getMessage(`${STATS_SECTION}.sections.addons_installed`),
|
||||||
this.state.stats.marketplace ? this.state.stats.marketplace['install'] : 0,
|
this.state.stats.marketplace['install'] ? this.state.stats.marketplace['install'].length : 0,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -49,8 +49,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.new-clock {
|
.vertical-clock {
|
||||||
line-height: 100%;
|
line-height: 100%;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
.seconds {
|
.seconds {
|
||||||
font-size: 0.2em;
|
font-size: 0.2em;
|
||||||
|
|
|
@ -3,7 +3,7 @@ function VerticalClock({ finalHour, finalMinute, finalSeconds }) {
|
||||||
const minuteColour = localStorage.getItem('minuteColour') || '#ƒff';
|
const minuteColour = localStorage.getItem('minuteColour') || '#ƒff';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="new-clock clock-container">
|
<span className="vertical-clock clock-container">
|
||||||
<div className="hour" style={{ color: hourColour }}>
|
<div className="hour" style={{ color: hourColour }}>
|
||||||
{finalHour}
|
{finalHour}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -88,7 +88,7 @@ function DateOptions() {
|
||||||
zoomSetting="zoomDate"
|
zoomSetting="zoomDate"
|
||||||
visibilityToggle={true}
|
visibilityToggle={true}
|
||||||
/>
|
/>
|
||||||
<PreferencesWrapper setting="date" visibilityToggle={true} zoomSetting="zoomDate">
|
<PreferencesWrapper setting="date" visibilityToggle={true} category="date" zoomSetting="zoomDate">
|
||||||
<Row>
|
<Row>
|
||||||
<Content
|
<Content
|
||||||
title={variables.getMessage('modals.main.settings.sections.time.type')}
|
title={variables.getMessage('modals.main.settings.sections.time.type')}
|
||||||
|
|
|
@ -210,7 +210,12 @@ const TimeOptions = () => {
|
||||||
zoomSetting="zoomClock"
|
zoomSetting="zoomClock"
|
||||||
visibilityToggle={true}
|
visibilityToggle={true}
|
||||||
/>
|
/>
|
||||||
<PreferencesWrapper setting="time" zoomSetting="zoomClock" visibilityToggle={true}>
|
<PreferencesWrapper
|
||||||
|
setting="time"
|
||||||
|
zoomSetting="zoomClock"
|
||||||
|
category="clock"
|
||||||
|
visibilityToggle={true}
|
||||||
|
>
|
||||||
<WidgetType />
|
<WidgetType />
|
||||||
{getTimeSettings()}
|
{getTimeSettings()}
|
||||||
</PreferencesWrapper>
|
</PreferencesWrapper>
|
||||||
|
|
|
@ -21,15 +21,20 @@ class WeatherWidget extends PureComponent {
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
EventBus.on('refresh', async (data) => {
|
EventBus.on('refresh', async (data) => {
|
||||||
// Convert the callback function to an async function
|
|
||||||
if (data === 'weather') {
|
if (data === 'weather') {
|
||||||
const weatherData = await getWeather(this.state.location, this.state.done);
|
const weatherData = await getWeather(this.state.location, this.state.done);
|
||||||
this.setState(weatherData);
|
this.setState(weatherData);
|
||||||
|
|
||||||
|
const zoomWeather = `${Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
|
||||||
|
document.querySelector('.weather').style.fontSize = zoomWeather;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const weatherData = await getWeather(this.state.location, this.state.done);
|
const weatherData = await getWeather(this.state.location, this.state.done);
|
||||||
this.setState(weatherData);
|
this.setState(weatherData);
|
||||||
|
|
||||||
|
const zoomWeather = `${Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
|
||||||
|
document.querySelector('.weather').style.fontSize = zoomWeather;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
|
@ -14,9 +14,6 @@ export const getWeather = async (location, done) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const zoomWeather = `${Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
|
|
||||||
document.querySelector('.weather').style.fontSize = zoomWeather;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
variables.constants.API_URL + `/weather?city=${location}&language=${variables.languagecode}`,
|
variables.constants.API_URL + `/weather?city=${location}&language=${variables.languagecode}`,
|
||||||
|
@ -65,6 +62,4 @@ export const getWeather = async (location, done) => {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Fetch Error: ', error);
|
console.error('Fetch Error: ', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelector('.top-weather svg').style.fontSize = zoomWeather;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,7 +35,6 @@ class WeatherOptions extends PureComponent {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const weatherType = localStorage.getItem('weatherType');
|
const weatherType = localStorage.getItem('weatherType');
|
||||||
|
|
||||||
const WEATHER_SECTION = 'modals.main.settings.sections.weather';
|
const WEATHER_SECTION = 'modals.main.settings.sections.weather';
|
||||||
|
|
||||||
const WidgetType = () => {
|
const WidgetType = () => {
|
||||||
|
|
|
@ -29,11 +29,10 @@ function Final(props) {
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{props.importedSettings.length !== 0 && (
|
{props.importedSettings.length !== 0 && (
|
||||||
<div className="toggle" onClick={() => props.switchTab(3)}>
|
<div className="toggle" onClick={() => props.switchTab(2)}>
|
||||||
{variables.getMessage('modals.welcome.sections.final.imported', {
|
{variables.getMessage('modals.welcome.sections.final.imported', {
|
||||||
amount: props.importedSettings.length,
|
amount: props.importedSettings.length,
|
||||||
})}{' '}
|
})}{' '}
|
||||||
{props.importedSettings.length}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import default_settings from 'utils/data/default_settings.json';
|
||||||
|
|
||||||
function ImportSettings(props) {
|
function ImportSettings(props) {
|
||||||
const importSettings = (e) => {
|
const importSettings = (e) => {
|
||||||
importSettingsFunction(e);
|
importSettingsFunction(e, true);
|
||||||
|
|
||||||
const settings = [];
|
const settings = [];
|
||||||
const data = JSON.parse(e);
|
const data = JSON.parse(e);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import variables from 'config/variables';
|
||||||
* file.
|
* file.
|
||||||
* @param e - The JSON settings string to import
|
* @param e - The JSON settings string to import
|
||||||
*/
|
*/
|
||||||
export function importSettings(e) {
|
export function importSettings(e, initial = false) {
|
||||||
const content = JSON.parse(e);
|
const content = JSON.parse(e);
|
||||||
|
|
||||||
Object.keys(content).forEach((key) => {
|
Object.keys(content).forEach((key) => {
|
||||||
|
@ -14,5 +14,8 @@ export function importSettings(e) {
|
||||||
});
|
});
|
||||||
|
|
||||||
toast(variables.getMessage('toasts.imported'));
|
toast(variables.getMessage('toasts.imported'));
|
||||||
variables.stats.postEvent('tab', 'Settings imported');
|
// don't show achievements on welcome
|
||||||
|
if (!initial) {
|
||||||
|
variables.stats.postEvent('tab', 'Settings imported');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue