feat: new welcome modal, refactor many things, various bug fixes, use material-ui v5 etc

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-07-02 21:29:33 +01:00
parent c6b65f943a
commit cf36ced2a7
61 changed files with 782 additions and 324 deletions

View File

@@ -8,8 +8,8 @@ export default function Addons() {
return (
<Tabs>
<div label={addons.added}><Added/></div>
<div label={addons.sideload}><Sideload/></div>
<div label={addons.added} name='added'><Added/></div>
<div label={addons.sideload} name='sideload'><Sideload/></div>
</Tabs>
);
}

View File

@@ -7,9 +7,9 @@ export default function Marketplace() {
return (
<Tabs>
<div label={marketplace.photo_packs}><MarketplaceTab type='photo_packs'/></div>
<div label={marketplace.quote_packs}><MarketplaceTab type='quote_packs'/></div>
<div label={marketplace.preset_settings}><MarketplaceTab type='preset_settings'/></div>
<div label={marketplace.photo_packs} name='photo_packs'><MarketplaceTab type='photo_packs'/></div>
<div label={marketplace.quote_packs} name='quote_packs'><MarketplaceTab type='quote_packs'/></div>
<div label={marketplace.preset_settings} name='preset_settings'><MarketplaceTab type='preset_settings'/></div>
</Tabs>
);
}

View File

@@ -26,20 +26,20 @@ export default function Settings() {
return (
<>
<Tabs>
<div label={sections.time.title}><Time/></div>
<div label={sections.quote.title}><Quote/></div>
<div label={sections.greeting.title}><Greeting/></div>
<div label={sections.background.title}><Background/></div>
<div label={sections.search.title}><Search/></div>
<div label={sections.quicklinks.title}><QuickLinks/></div>
<div label={sections.weather.title}><Weather/></div>
<div label={sections.appearance.title}><Appearance/></div>
<div label={sections.order.title}><Order/></div>
<div label={sections.language.title}><Language/></div>
<div label={sections.advanced.title}><Advanced/></div>
<div label={sections.experimental.title}><Experimental/></div>
<div label={sections.changelog}><Changelog/></div>
<div label={sections.about.title}><About/></div>
<div label={sections.time.title} name='time'><Time/></div>
<div label={sections.quote.title} name='quote'><Quote/></div>
<div label={sections.greeting.title} name='greeting'><Greeting/></div>
<div label={sections.background.title} name='background'><Background/></div>
<div label={sections.search.title} name='search'><Search/></div>
<div label={sections.quicklinks.title} name='quicklinks'><QuickLinks/></div>
<div label={sections.weather.title} name='weather'><Weather/></div>
<div label={sections.appearance.title} name='appearance'><Appearance/></div>
<div label={sections.order.title} name='order'><Order/></div>
<div label={sections.language.title} name='language'><Language/></div>
<div label={sections.advanced.title} name='advanced'><Advanced/></div>
<div label={sections.experimental.title} name='experimental'><Experimental/></div>
<div label={sections.changelog} name='changelog'><Changelog/></div>
<div label={sections.about.title} name='about'><About/></div>
</Tabs>
<div className='reminder-info' style={{ display: display }}>
<h1>{reminder.title}</h1>

View File

@@ -8,17 +8,19 @@ export default class Tabs extends React.PureComponent {
super(props);
this.state = {
currentTab: this.props.children[0].props.label
currentTab: this.props.children[0].props.label,
currentName: this.props.children[0].props.name
};
}
onClick = (tab) => {
if (tab !== this.state.currentTab) {
window.stats.postEvent('tab', `Changed ${this.state.currentTab} to ${tab}`);
onClick = (tab, name) => {
if (name !== this.state.currentName) {
window.stats.postEvent('tab', `Changed ${this.state.currentName} to ${name}`);
}
this.setState({
currentTab: tab
currentTab: tab,
currentName: name
});
};
@@ -42,7 +44,7 @@ export default class Tabs extends React.PureComponent {
currentTab={this.state.currentTab}
key={tab.props.label || index}
label={tab.props.label}
onClick={this.onClick}
onClick={(nextTab) => this.onClick(nextTab, tab.props.name)}
navbar={this.props.navbar || false}
/>
))}