Update styles and dependencies

Co-authored-by: David Ralph <me@davidcralph.co.uk>
This commit is contained in:
alexsparkes
2024-01-05 00:01:47 +00:00
parent 80dd8bcd8e
commit 6915c0ef9e
18 changed files with 132 additions and 115 deletions

View File

@@ -63,47 +63,34 @@ class Header extends PureComponent {
</div>
)}
<span className="mainTitle">{this.props.title}</span>
{this.props.switch && (
<button className="sideload" onClick={() => this.changeSetting()}>
{this.state[this.props.setting] ? (
<>
Hide
<MdOutlineVisibilityOff />
</>
) : (
<>
Show
<MdOutlineVisibility />
</>
)}
<div className="headerActions">
<button
className="sideload"
onClick={() =>
window.open(
variables.constants.BUG_REPORT + this.props.title.split(' ').join('+'),
'_blank',
)
}
>
{variables.getMessage('modals.main.settings.sections.header.report_issue')} <MdFlag />
</button>
)}
</div>
<div className="headerExtras">
{/*<span
className="link"
onClick={() =>
window.open(
variables.constants.KNOWLEDGEBASE +
'/settings/' +
this.props.setting.toLowerCase().replace('enabled', ''),
'_blank',
)
}
>
<MdHelpOutline /> {variables.getMessage('modals.main.settings.sections.header.more_info')}
</span>*/}
<span
className="link"
onClick={() =>
window.open(
variables.constants.BUG_REPORT + this.props.title.split(' ').join('+'),
'_blank',
)
}
>
<MdFlag /> {variables.getMessage('modals.main.settings.sections.header.report_issue')}
</span>
{this.props.switch && (
<button className="sideload" onClick={() => this.changeSetting()}>
{this.state[this.props.setting] ? (
<>
Hide
<MdOutlineVisibilityOff />
</>
) : (
<>
Show
<MdOutlineVisibility />
</>
)}
</button>
)}
</div>
</div>
{this.props.zoomSetting && (
<SettingsItem

View File

@@ -125,24 +125,11 @@ export default class BackgroundSettings extends PureComponent {
</Dropdown>
</>
) : (
<>
{/*<Dropdown
label={variables.getMessage('modals.main.settings.sections.background.category')}
name="apiCategories"
>
{this.state.backgroundCategories.map((category) => (
<MenuItem value={category.name} key={category.name}>
{category.name.charAt(0).toUpperCase() + category.name.slice(1)} (
{category.count})
</MenuItem>
))}
</Dropdown>*/}
<ChipSelect
label={variables.getMessage('modals.main.settings.sections.background.categories')}
options={this.state.backgroundCategories}
name="apiCategories"
></ChipSelect>
</>
<ChipSelect
label={variables.getMessage('modals.main.settings.sections.background.categories')}
options={this.state.backgroundCategories}
name="apiCategories"
/>
)}
<Dropdown
label={variables.getMessage(
@@ -388,7 +375,7 @@ export default class BackgroundSettings extends PureComponent {
/>
</SettingsItem>
) : null}
{this.state.backgroundSettingsSection ? (
{this.state.backgroundSettingsSection && (
<>
<SettingsItem
title={variables.getMessage('modals.main.settings.sections.background.source.title')}
@@ -444,7 +431,7 @@ export default class BackgroundSettings extends PureComponent {
: null}*/}
{backgroundSettings}
</>
) : null}
)}
{(this.state.backgroundType === 'api' ||
this.state.backgroundType === 'custom' ||
this.state.marketplaceEnabled) &&

View File

@@ -76,17 +76,8 @@ export default class CustomSettings extends PureComponent {
localStorage.setItem('showReminder', true);
}
videoCheck(url) {
return (
url.startsWith('data:video/') ||
url.endsWith('.mp4') ||
url.endsWith('.webm') ||
url.endsWith('.ogg')
);
}
videoCustomSettings = () => {
const hasVideo = this.state.customBackground.filter((bg) => this.videoCheck(bg));
const hasVideo = this.state.customBackground.filter((bg) => videoCheck(bg));
if (hasVideo.length > 0) {
return (
@@ -225,9 +216,9 @@ export default class CustomSettings extends PureComponent {
<div key={index}>
<img
alt={'Custom background ' + (index || 0)}
src={`${!this.videoCheck(url) ? this.state.customBackground[index] : ''}`}
src={`${!videoCheck(url) ? this.state.customBackground[index] : ''}`}
/>
{this.videoCheck(url) && <MdPersonalVideo className="customvideoicon" />}
{videoCheck(url) && <MdPersonalVideo className="customvideoicon" />}
{this.state.customBackground.length > 0 && (
<Tooltip
title={variables.getMessage(