diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index 87cec2f..53c3c6a 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -177,10 +177,10 @@ export class AppLayout extends Component { Careful: you're running in developer mode. ); - } else if ((navigator.userAgent.includes("Hyperspace") || navigator.userAgent.includes("Electron")) && navigator.userAgent.includes("Macintosh")) { + } else if ((navigator.userAgent.includes(this.state.brandName || "Hyperspace") || navigator.userAgent.includes("Electron")) && navigator.userAgent.includes("Macintosh")) { return (
- Hyperspace + {this.state.brandName? this.state.brandName: "Hyperspace"}
); } @@ -376,10 +376,10 @@ export class AppLayout extends Component { open={this.state.logOutOpen} onClose={() => this.toggleLogOutDialog()} > - Log out of Hyperspace? + Log out of {this.state.brandName? this.state.brandName: "Hyperspace"} - You'll need to remove Hyperspace from your list of authorized apps and log in again if you want to use Hyperspace. + You'll need to remove {this.state.brandName? this.state.brandName: "Hyperspace"} from your list of authorized apps and log in again if you want to use {this.state.brandName? this.state.brandName: "Hyperspace"}. diff --git a/src/interfaces/Config.tsx b/src/interfaces/Config.tsx new file mode 100644 index 0000000..aa278db --- /dev/null +++ b/src/interfaces/Config.tsx @@ -0,0 +1,22 @@ +import {License} from '../types/Config'; + +export interface Config { + version: string; + location: string; + branding?: { + name?: string; + logo?: string; + background?: string; + }; + developer?: string; + federated?: string; + registration?: { + defaultInstance?: string; + }; + admin?: { + name?: string; + account?: string; + }; + license: License; + respository?: string; +} \ No newline at end of file diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 5fe8e5c..80bd020 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -43,6 +43,7 @@ interface ISettingsState { resetSettingsDialog: boolean; previewTheme: Theme; defaultVisibility: Visibility; + brandName: string; federated: boolean; } @@ -63,6 +64,7 @@ class SettingsPage extends Component { resetSettingsDialog: false, previewTheme: setHyperspaceTheme(getUserDefaultTheme()) || setHyperspaceTheme(defaultTheme), defaultVisibility: getUserDefaultVisibility() || "public", + brandName: "Hyperspace", federated: true } @@ -78,6 +80,13 @@ class SettingsPage extends Component { } componentDidMount() { + getConfig().then((config: any) => { + this.setState({ + brandName: config.branding.name + }) + }).catch((err: Error) => { + console.error(err.message); + }); this.getFederatedStatus(); } @@ -265,10 +274,10 @@ class SettingsPage extends Component { open={this.state.resetHyperspaceDialog} onClose={() => this.toggleResetDialog()} > - Reset Hyperspace? + Reset {this.state.brandName}? - Are you sure you want to reset Hyperspace? You'll need to sign in again and grant Hyperspace access to use it again. + Are you sure you want to reset {this.state.brandName}? You'll need to re-authorize {this.state.brandName} access again. @@ -401,7 +410,7 @@ class SettingsPage extends Component { - +