mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 05:04:57 +08:00
Add sign in to top left menu for guests
This commit is contained in:
parent
422750082d
commit
22789ada94
@ -35,6 +35,10 @@ limitations under the License.
|
|||||||
mask-image: url('$(res)/img/feather-icons/settings.svg');
|
mask-image: url('$(res)/img/feather-icons/settings.svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
li.mx_TopLeftMenu_icon_signin::after {
|
||||||
|
mask-image: url('$(res)/img/feather-icons/sign-in.svg');
|
||||||
|
}
|
||||||
|
|
||||||
li.mx_TopLeftMenu_icon_signout::after {
|
li.mx_TopLeftMenu_icon_signout::after {
|
||||||
mask-image: url('$(res)/img/feather-icons/sign-out.svg');
|
mask-image: url('$(res)/img/feather-icons/sign-out.svg');
|
||||||
}
|
}
|
||||||
|
7
res/img/feather-icons/sign-in.svg
Normal file
7
res/img/feather-icons/sign-in.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g style="stroke:#454545;stroke-width:1.2;fill:none;fill-rule:evenodd;stroke-linecap:round;stroke-linejoin:round" transform="translate(1 1)">
|
||||||
|
<path d="m9.33333333 0h3.11111107c.8591097 0 1.5555556.69644595 1.5555556 1.55555556v10.88888884c0 .8591097-.6964459 1.5555556-1.5555556 1.5555556h-3.11111107"/>
|
||||||
|
<path d="m5.44444444 10.8888889 3.88888889-3.8888889-3.88888889-3.88888889"/>
|
||||||
|
<path d="m9.33333333 7h-9.33333333"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 548 B |
@ -20,11 +20,13 @@ import { _t } from '../../../languageHandler';
|
|||||||
import LogoutDialog from "../dialogs/LogoutDialog";
|
import LogoutDialog from "../dialogs/LogoutDialog";
|
||||||
import Modal from "../../../Modal";
|
import Modal from "../../../Modal";
|
||||||
import SdkConfig from '../../../SdkConfig';
|
import SdkConfig from '../../../SdkConfig';
|
||||||
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
|
|
||||||
export class TopLeftMenu extends React.Component {
|
export class TopLeftMenu extends React.Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.openSettings = this.openSettings.bind(this);
|
this.openSettings = this.openSettings.bind(this);
|
||||||
|
this.signIn = this.signIn.bind(this);
|
||||||
this.signOut = this.signOut.bind(this);
|
this.signOut = this.signOut.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +43,8 @@ export class TopLeftMenu extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const isGuest = MatrixClientPeg.get().isGuest();
|
||||||
|
|
||||||
let homePageSection = null;
|
let homePageSection = null;
|
||||||
if (this.hasHomePage()) {
|
if (this.hasHomePage()) {
|
||||||
homePageSection = <ul className="mx_TopLeftMenu_section">
|
homePageSection = <ul className="mx_TopLeftMenu_section">
|
||||||
@ -48,14 +52,23 @@ export class TopLeftMenu extends React.Component {
|
|||||||
</ul>;
|
</ul>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let signInOutSection;
|
||||||
|
if (isGuest) {
|
||||||
|
signInOutSection = <ul className="mx_TopLeftMenu_section">
|
||||||
|
<li className="mx_TopLeftMenu_icon_signin" onClick={this.signIn}>{_t("Sign in")}</li>
|
||||||
|
</ul>;
|
||||||
|
} else {
|
||||||
|
signInOutSection = <ul className="mx_TopLeftMenu_section">
|
||||||
|
<li className="mx_TopLeftMenu_icon_signout" onClick={this.signOut}>{_t("Sign out")}</li>
|
||||||
|
</ul>;
|
||||||
|
}
|
||||||
|
|
||||||
return <div className="mx_TopLeftMenu">
|
return <div className="mx_TopLeftMenu">
|
||||||
{homePageSection}
|
{homePageSection}
|
||||||
<ul className="mx_TopLeftMenu_section">
|
<ul className="mx_TopLeftMenu_section">
|
||||||
<li className="mx_TopLeftMenu_icon_settings" onClick={this.openSettings}>{_t("Settings")}</li>
|
<li className="mx_TopLeftMenu_icon_settings" onClick={this.openSettings}>{_t("Settings")}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="mx_TopLeftMenu_section">
|
{signInOutSection}
|
||||||
<li className="mx_TopLeftMenu_icon_signout" onClick={this.signOut}>{_t("Sign out")}</li>
|
|
||||||
</ul>
|
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +82,11 @@ export class TopLeftMenu extends React.Component {
|
|||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signIn() {
|
||||||
|
dis.dispatch({action: 'start_login'});
|
||||||
|
this.closeMenu();
|
||||||
|
}
|
||||||
|
|
||||||
signOut() {
|
signOut() {
|
||||||
Modal.createTrackedDialog('Logout E2E Export', '', LogoutDialog);
|
Modal.createTrackedDialog('Logout E2E Export', '', LogoutDialog);
|
||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
|
@ -1051,7 +1051,6 @@
|
|||||||
"Continue With Encryption Disabled": "Continue With Encryption Disabled",
|
"Continue With Encryption Disabled": "Continue With Encryption Disabled",
|
||||||
"Unknown error": "Unknown error",
|
"Unknown error": "Unknown error",
|
||||||
"Incorrect password": "Incorrect password",
|
"Incorrect password": "Incorrect password",
|
||||||
"Deactivate Account": "Deactivate Account",
|
|
||||||
"This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. <b>This action is irreversible.</b>": "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. <b>This action is irreversible.</b>",
|
"This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. <b>This action is irreversible.</b>": "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. <b>This action is irreversible.</b>",
|
||||||
"Deactivating your account <b>does not by default cause us to forget messages you have sent.</b> If you would like us to forget your messages, please tick the box below.": "Deactivating your account <b>does not by default cause us to forget messages you have sent.</b> If you would like us to forget your messages, please tick the box below.",
|
"Deactivating your account <b>does not by default cause us to forget messages you have sent.</b> If you would like us to forget your messages, please tick the box below.": "Deactivating your account <b>does not by default cause us to forget messages you have sent.</b> If you would like us to forget your messages, please tick the box below.",
|
||||||
"Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.": "Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.",
|
"Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.": "Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.",
|
||||||
@ -1203,6 +1202,7 @@
|
|||||||
"Quote": "Quote",
|
"Quote": "Quote",
|
||||||
"Source URL": "Source URL",
|
"Source URL": "Source URL",
|
||||||
"Collapse Reply Thread": "Collapse Reply Thread",
|
"Collapse Reply Thread": "Collapse Reply Thread",
|
||||||
|
"End-to-end encryption information": "End-to-end encryption information",
|
||||||
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
|
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
|
||||||
"unknown error code": "unknown error code",
|
"unknown error code": "unknown error code",
|
||||||
"Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s",
|
"Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s",
|
||||||
@ -1220,6 +1220,7 @@
|
|||||||
"Set a new status...": "Set a new status...",
|
"Set a new status...": "Set a new status...",
|
||||||
"View Community": "View Community",
|
"View Community": "View Community",
|
||||||
"Hide": "Hide",
|
"Hide": "Hide",
|
||||||
|
"Sign in": "Sign in",
|
||||||
"Login": "Login",
|
"Login": "Login",
|
||||||
"powered by Matrix": "powered by Matrix",
|
"powered by Matrix": "powered by Matrix",
|
||||||
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>",
|
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>",
|
||||||
@ -1250,7 +1251,6 @@
|
|||||||
"Username": "Username",
|
"Username": "Username",
|
||||||
"Mobile phone number": "Mobile phone number",
|
"Mobile phone number": "Mobile phone number",
|
||||||
"Not sure of your password? <a>Set a new one</a>": "Not sure of your password? <a>Set a new one</a>",
|
"Not sure of your password? <a>Set a new one</a>": "Not sure of your password? <a>Set a new one</a>",
|
||||||
"Sign in": "Sign in",
|
|
||||||
"Sign in to %(serverName)s": "Sign in to %(serverName)s",
|
"Sign in to %(serverName)s": "Sign in to %(serverName)s",
|
||||||
"Change": "Change",
|
"Change": "Change",
|
||||||
"Sign in with": "Sign in with",
|
"Sign in with": "Sign in with",
|
||||||
@ -1473,7 +1473,6 @@
|
|||||||
"unencrypted": "unencrypted",
|
"unencrypted": "unencrypted",
|
||||||
"Decryption error": "Decryption error",
|
"Decryption error": "Decryption error",
|
||||||
"Session ID": "Session ID",
|
"Session ID": "Session ID",
|
||||||
"End-to-end encryption information": "End-to-end encryption information",
|
|
||||||
"Event information": "Event information",
|
"Event information": "Event information",
|
||||||
"Sender device information": "Sender device information",
|
"Sender device information": "Sender device information",
|
||||||
"Passphrases must match": "Passphrases must match",
|
"Passphrases must match": "Passphrases must match",
|
||||||
@ -1534,7 +1533,6 @@
|
|||||||
"If you didn't set the new recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't set the new recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.",
|
"If you didn't set the new recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't set the new recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.",
|
||||||
"This device is encrypting history using the new recovery method.": "This device is encrypting history using the new recovery method.",
|
"This device is encrypting history using the new recovery method.": "This device is encrypting history using the new recovery method.",
|
||||||
"Go to Settings": "Go to Settings",
|
"Go to Settings": "Go to Settings",
|
||||||
"Setting up Secure Messages on this device will re-encrypt this device's message history with the new recovery method.": "Setting up Secure Messages on this device will re-encrypt this device's message history with the new recovery method.",
|
|
||||||
"Set up Secure Messages": "Set up Secure Messages",
|
"Set up Secure Messages": "Set up Secure Messages",
|
||||||
"Recovery Method Removed": "Recovery Method Removed",
|
"Recovery Method Removed": "Recovery Method Removed",
|
||||||
"This device has detected that your recovery passphrase and key for Secure Messages have been removed.": "This device has detected that your recovery passphrase and key for Secure Messages have been removed.",
|
"This device has detected that your recovery passphrase and key for Secure Messages have been removed.": "This device has detected that your recovery passphrase and key for Secure Messages have been removed.",
|
||||||
|
Loading…
Reference in New Issue
Block a user