diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 31020bb..7e10e14 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1 @@ -* @alicerunsonfedora -* @Nomad1556 -* @Bio-ico \ No newline at end of file +* @alicerunsonfedora @Nomad1556 @Bio-ico diff --git a/.gitignore b/.gitignore index 7032696..cf51ca7 100644 --- a/.gitignore +++ b/.gitignore @@ -63,9 +63,9 @@ typings/ # VSCode dirs .vscode/ -# Signing certificates -desktop/*.provisionprofile -desktop/*.plist +# Production dirs +build/ -# Prod dirs -build/ \ No newline at end of file +# Electron app files +desktop/*.plist +desktop/*.provisionprofile diff --git a/package-lock.json b/package-lock.json index c307060..c938d21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11875,6 +11875,11 @@ "safe-buffer": "^5.1.2" } }, + "mdi-material-ui": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/mdi-material-ui/-/mdi-material-ui-5.11.0.tgz", + "integrity": "sha512-9fIvdiKCKAfBoW11LqZsgaxZtu9WCQEd8FL9/8ceLHvStSf+fZM6sC7exwXaXZmzfwtJMfN1KiMGsPBPSTQFQg==" + }, "mdn-data": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", diff --git a/package.json b/package.json index 123c68e..d5180cd 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "emoji-mart": "^2.8.2", "file-dialog": "^0.0.7", "material-ui-pickers": "^2.2.4", + "mdi-material-ui": "^5.11.0", "megalodon": "^0.6.3", "moment": "^2.24.0", "notistack": "^0.5.1", diff --git a/public/config.json b/public/config.json index f8c1e32..2ac9055 100644 --- a/public/config.json +++ b/public/config.json @@ -1,5 +1,5 @@ { - "version": "1.0.0beta2u3", + "version": "1.0.0beta4", "location": "https://hyperspaceapp-next.herokuapp.com", "branding": { "name": "Hyperspace", diff --git a/src/App.tsx b/src/App.tsx index 039d081..1457e20 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,6 +19,7 @@ import WelcomePage from './pages/Welcome'; import MessagesPage from './pages/Messages'; import RecommendationsPage from './pages/Recommendations'; import Missingno from './pages/Missingno'; +import You from './pages/You'; import {withSnackbar} from 'notistack'; import {PrivateRoute} from './interfaces/overrides'; import { userLoggedIn } from './utilities/accounts'; @@ -60,6 +61,7 @@ class App extends Component { + diff --git a/src/components/AppLayout/AppLayout.styles.tsx b/src/components/AppLayout/AppLayout.styles.tsx index b9674c8..5cf0c0f 100644 --- a/src/components/AppLayout/AppLayout.styles.tsx +++ b/src/components/AppLayout/AppLayout.styles.tsx @@ -22,7 +22,9 @@ export const styles = (theme: Theme) => createStyles({ backgroundColor: theme.palette.primary.dark, textAlign: 'center', zIndex: 1000, - verticalAlign: 'middle' + verticalAlign: 'middle', + WebkitUserSelect: 'none', + WebkitAppRegion: "drag" }, titleBarText: { color: theme.palette.common.white, @@ -148,5 +150,5 @@ export const styles = (theme: Theme) => createStyles({ bottom: theme.spacing.unit * 2, right: theme.spacing.unit * 2, zIndex: 50 - } + }, }); \ No newline at end of file diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index 53c3c6a..02492e4 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -10,7 +10,7 @@ import PublicIcon from '@material-ui/icons/Public'; import GroupIcon from '@material-ui/icons/Group'; import SettingsIcon from '@material-ui/icons/Settings'; import InfoIcon from '@material-ui/icons/Info'; -import EditIcon from '@material-ui/icons/Edit'; +import CreateIcon from '@material-ui/icons/Create'; //import SupervisedUserCircleIcon from '@material-ui/icons/SupervisedUserCircle'; import ExitToAppIcon from '@material-ui/icons/ExitToApp'; import {styles} from './AppLayout.styles'; @@ -395,7 +395,7 @@ export class AppLayout extends Component { - + diff --git a/src/pages/About.tsx b/src/pages/About.tsx index 5a0dddd..6980f7d 100644 --- a/src/pages/About.tsx +++ b/src/pages/About.tsx @@ -12,18 +12,23 @@ import { withStyles, Typography, Link, - Tooltip + Tooltip, + Button } from '@material-ui/core'; + import OpenInNewIcon from '@material-ui/icons/OpenInNew'; -import DomainIcon from '@material-ui/icons/Domain'; import ChatIcon from '@material-ui/icons/Chat'; import PersonIcon from '@material-ui/icons/Person'; +import AssignmentIcon from '@material-ui/icons/Assignment'; import AssignmentIndIcon from '@material-ui/icons/AssignmentInd'; import NetworkCheckIcon from '@material-ui/icons/NetworkCheck'; import UpdateIcon from '@material-ui/icons/Update'; import InfoIcon from '@material-ui/icons/Info'; import NotesIcon from '@material-ui/icons/Notes'; import CodeIcon from '@material-ui/icons/Code'; +import TicketAccountIcon from 'mdi-material-ui/TicketAccount'; +import MastodonIcon from 'mdi-material-ui/Mastodon'; + import {styles} from './PageLayout.styles'; import {Instance} from '../types/Instance'; import {LinkableIconButton, LinkableAvatar} from '../interfaces/overrides'; @@ -33,13 +38,14 @@ import { getConfig } from '../utilities/settings'; import { License } from '../types/Config'; interface IAboutPageState { - instance?: Instance | any; + instance?: Instance; federated?: boolean; developer?: boolean; hyperspaceAdmin?: UAccount; hyperspaceAdminName?: string; versionNumber?: string; brandName?: string; + brandBg?: string; license: License; repository?: string; } @@ -64,14 +70,13 @@ class AboutPage extends Component { componentWillMount() { this.client.get('/instance').then((resp: any) => { this.setState({ - instance: resp.data + instance: resp.data as Instance }) }) getConfig().then((config: any) => { this.client.get('/accounts/' + (config.admin? config.admin.account: "0")).then((resp: any) => { let account = resp.data; - console.log(config); this.setState({ hyperspaceAdmin: account, hyperspaceAdminName: config.admin.name, @@ -79,6 +84,7 @@ class AboutPage extends Component { developer: config.developer? config.developer === "true": false, versionNumber: config.version, brandName: config.branding? config.branding.name: "Hyperspace", + brandBg: config.branding.background, license: { name: config.license.name, url: config.license.url @@ -95,24 +101,19 @@ class AboutPage extends Component { const { classes } = this.props; return (
- About your instance - - - - - - - - - - - - - - - - - + +
+ + + + {this.state.instance ? this.state.instance.uri: "Loading..."} +
+ @@ -134,64 +135,80 @@ class AboutPage extends Component { - -
-
- About this app - - - + - - - - - - - - - + - - + + - { - this.state.repository? - - - - - - - - {this.state.repository.slice(0, 25) + "..."} - {this.state.repository} - : - "No repository in config"}/> - - - - - - - - : null - } + + + + + + + + + + + + + + + + + + + + + +
- Advanced app info - - + + +
+
+ { + this.state.repository? + + + + + : null + } +
+ + {this.state.brandName? this.state.brandName: "Hyperspace"} + +
+ @@ -215,10 +232,17 @@ class AboutPage extends Component { - + - + + + + + + + + @@ -234,6 +258,28 @@ class AboutPage extends Component { "Loading..." }/> + + + + + + + + + +
+
+ Federation status + + + + + + + + + +
diff --git a/src/pages/PageLayout.styles.tsx b/src/pages/PageLayout.styles.tsx index 155005d..82deddd 100644 --- a/src/pages/PageLayout.styles.tsx +++ b/src/pages/PageLayout.styles.tsx @@ -86,8 +86,14 @@ export const styles = (theme: Theme) => createStyles({ paddingLeft: '25%', paddingRight: '25%', }, + position: "relative", zIndex: 1 }, + pageHeroToolbar: { + position: "absolute", + right: theme.spacing.unit * 2, + marginTop: -16, + }, pageListConstraints: { paddingLeft: theme.spacing.unit, paddingRight: theme.spacing.unit, @@ -179,4 +185,50 @@ export const styles = (theme: Theme) => createStyles({ color: theme.palette.primary.light } }, + youHeadingAvatar: { + height: 88, + width: 88 + }, + youPaper: { + padding: theme.spacing.unit * 2, + }, + youGrid: { + textAlign: "center", + '& *': { + marginLeft: "auto", + marginRight: "auto", + } + }, + youGridAvatar: { + height: 128, + width: 128 + }, + youGridImage: { + width: 'auto', + height: 128 + }, + instanceHeaderPaper: { + height: 200, + backgroundPosition: "center", + backgroundRepeat: "no-repeat", + backgroundSize: "cover", + position: "relative", + backgroundColor: theme.palette.primary.dark, + borderTopLeftRadius: theme.shape.borderRadius, + borderTopRightRadius: theme.shape.borderRadius + }, + instanceHeaderText: { + position: "absolute", + bottom: theme.spacing.unit, + left: theme.spacing.unit * 2, + color: theme.palette.common.white, + textShadow: `0 0 4px ${theme.palette.grey[700]}`, + fontWeight: 600 + }, + instanceToolbar: { + position: "absolute", + top: theme.spacing.unit, + right: theme.spacing.unit, + color: theme.palette.common.white + } }); \ No newline at end of file diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 11c1272..ed25744 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -7,9 +7,11 @@ import { Status } from '../types/Status'; import { Relationship } from '../types/Relationship'; import Post from '../components/Post'; import {withSnackbar} from 'notistack'; -import { LinkableButton } from '../interfaces/overrides'; +import { LinkableButton, LinkableIconButton } from '../interfaces/overrides'; import { emojifyString } from '../utilities/emojis'; +import AccountEditIcon from 'mdi-material-ui/AccountEdit'; + interface IProfilePageState { account?: Account; relationship?: Relationship; @@ -89,6 +91,14 @@ class ProfilePage extends Component { this.getAccountData(params.profileId); } + isItMe(): boolean { + if (this.state.account) { + return this.state.account.id === JSON.parse(localStorage.getItem('account') as string).id; + } else { + return false; + } + } + getRelationships() { this.client.get("/accounts/relationships", {id: this.props.match.params.profileId }).then((resp: any) => { let relationship: Relationship = resp.data[0]; @@ -216,6 +226,14 @@ class ProfilePage extends Component {
+ { + this.isItMe()? + + + + + : null + } {this.state.account ? '@' + this.state.account.acct: ""} diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 80bd020..cd4a981 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -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'; @@ -30,6 +30,19 @@ import {themes, defaultTheme} from '../types/HyperspaceTheme'; import ThemePreview from '../components/ThemePreview'; 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; @@ -302,6 +315,9 @@ class SettingsPage extends Component { + + + { + + + { + + + + +
+
+
+
+
+ + Display Name +
+ this.updateDisplayname(event.target.value)}> + +
+ +
+
+
+ + About you +
+ this.updateBio(event.target.value)}> + +
+ +
+
+
+
+ ); + } +} + +export default withStyles(styles)(withSnackbar(You)); \ No newline at end of file