mirror of
https://github.com/hyperspacedev/hyperspace
synced 2025-02-04 03:08:10 +01:00
Merge pull request #42 from hyperspacedev/settings-icons
Add icons to Settings page
This commit is contained in:
commit
90e88536c7
@ -1,7 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import {
|
||||
List,
|
||||
ListItem,
|
||||
ListItem,
|
||||
ListItemAvatar,
|
||||
ListItemText,
|
||||
ListSubheader,
|
||||
ListItemSecondaryAction,
|
||||
@ -22,7 +23,6 @@ import {
|
||||
Theme,
|
||||
Typography
|
||||
} from '@material-ui/core';
|
||||
import OpenInNewIcon from '@material-ui/icons/OpenInNew';
|
||||
import {styles} from './PageLayout.styles';
|
||||
import {setUserDefaultBool, getUserDefaultBool, getUserDefaultTheme, setUserDefaultTheme, getUserDefaultVisibility, setUserDefaultVisibility, getConfig} from '../utilities/settings';
|
||||
import {canSendNotifications, browserSupportsNotificationRequests} from '../utilities/notifications';
|
||||
@ -32,6 +32,18 @@ import {setHyperspaceTheme, getHyperspaceTheme} from '../utilities/themes';
|
||||
import { Visibility } from '../types/Visibility';
|
||||
import {LinkableButton} from '../interfaces/overrides';
|
||||
|
||||
import OpenInNewIcon from '@material-ui/icons/OpenInNew';
|
||||
import DevicesIcon from '@material-ui/icons/Devices';
|
||||
import Brightness3Icon from '@material-ui/icons/Brightness3';
|
||||
import PaletteIcon from '@material-ui/icons/Palette';
|
||||
import AccountEditIcon from 'mdi-material-ui/AccountEdit';
|
||||
import MastodonIcon from 'mdi-material-ui/Mastodon';
|
||||
import VisibilityIcon from '@material-ui/icons/Visibility';
|
||||
import NotificationsIcon from '@material-ui/icons/Notifications';
|
||||
import BellAlertIcon from 'mdi-material-ui/BellAlert';
|
||||
import RefreshIcon from '@material-ui/icons/Refresh';
|
||||
import UndoIcon from '@material-ui/icons/Undo';
|
||||
|
||||
interface ISettingsState {
|
||||
darkModeEnabled: boolean;
|
||||
systemDecidesDarkMode: boolean;
|
||||
@ -303,6 +315,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
<Paper className={classes.pageListConstraints}>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<DevicesIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Match system appearance" secondary="Obey light/dark theme from your system"/>
|
||||
<ListItemSecondaryAction>
|
||||
<Switch
|
||||
@ -312,6 +327,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<Brightness3Icon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Dark mode" secondary="Toggles light or dark theme"/>
|
||||
<ListItemSecondaryAction>
|
||||
<Switch
|
||||
@ -322,6 +340,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<PaletteIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Interface theme" secondary="The color palette used for the interface"/>
|
||||
<ListItemSecondaryAction>
|
||||
<Button onClick={this.toggleThemeDialog}>
|
||||
@ -336,12 +357,18 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
<Paper className={classes.pageListConstraints}>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<AccountEditIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Edit your profile" secondary="Change your bio, display name, and images"/>
|
||||
<ListItemSecondaryAction>
|
||||
<LinkableButton to="/you">Edit</LinkableButton>
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<MastodonIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Configure on Mastodon"/>
|
||||
<ListItemSecondaryAction>
|
||||
<IconButton href={(localStorage.getItem("baseurl") as string) + "/settings/preferences"} target="_blank" rel="noreferrer">
|
||||
@ -356,6 +383,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
<Paper className={classes.pageListConstraints}>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<VisibilityIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Default visibility" secondary="New posts in composer will use this visiblity"/>
|
||||
<ListItemSecondaryAction>
|
||||
<Button onClick={this.toggleVisibilityDialog}>
|
||||
@ -370,6 +400,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
<Paper className={classes.pageListConstraints}>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<NotificationsIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary="Enable push notifications"
|
||||
secondary={
|
||||
@ -389,6 +422,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<BellAlertIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary="Notification badge counts all notifications"
|
||||
secondary={
|
||||
@ -409,6 +445,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
<Paper className={classes.pageListConstraints}>
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<RefreshIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Refresh settings" secondary="Reset the settings to defaults."/>
|
||||
<ListItemSecondaryAction>
|
||||
<Button onClick={() => this.toggleResetSettingsDialog()}>
|
||||
@ -417,6 +456,9 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<UndoIcon color="action"/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary={`Reset ${this.state.brandName}`} secondary="Deletes all data and resets the app"/>
|
||||
<ListItemSecondaryAction>
|
||||
<Button onClick={() => this.toggleResetDialog()}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user