aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/layout
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-17 12:14:48 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-17 12:14:48 +0200
commitd14071f3503f768c9c0e040dee549be6a6b40e5f (patch)
treeb6c945c8b4baf31344dbabd2ac555559285ebec6 /src/components/layout
parentAdd "npm run prepare-code" command (diff)
downloadferdium-app-d14071f3503f768c9c0e040dee549be6a6b40e5f.tar.gz
ferdium-app-d14071f3503f768c9c0e040dee549be6a6b40e5f.tar.zst
ferdium-app-d14071f3503f768c9c0e040dee549be6a6b40e5f.zip
Implement #41
Diffstat (limited to 'src/components/layout')
-rw-r--r--src/components/layout/Sidebar.js27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js
index 729bd35af..d26eb852d 100644
--- a/src/components/layout/Sidebar.js
+++ b/src/components/layout/Sidebar.js
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import ReactTooltip from 'react-tooltip'; 3import ReactTooltip from 'react-tooltip';
4import { defineMessages, intlShape } from 'react-intl'; 4import { defineMessages, intlShape } from 'react-intl';
5import { observer } from 'mobx-react'; 5import { inject, observer } from 'mobx-react';
6import { Link } from 'react-router'; 6import { Link } from 'react-router';
7 7
8import Tabbar from '../services/tabs/Tabbar'; 8import Tabbar from '../services/tabs/Tabbar';
@@ -44,9 +44,13 @@ const messages = defineMessages({
44 id: 'sidebar.closeTodosDrawer', 44 id: 'sidebar.closeTodosDrawer',
45 defaultMessage: '!!!Close Franz Todos', 45 defaultMessage: '!!!Close Franz Todos',
46 }, 46 },
47 lockFerdi: {
48 id: 'sidebar.lockFerdi',
49 defaultMessage: '!!!Lock Ferdi',
50 },
47}); 51});
48 52
49export default @observer class Sidebar extends Component { 53export default @inject('stores', 'actions') @observer class Sidebar extends Component {
50 static propTypes = { 54 static propTypes = {
51 openSettings: PropTypes.func.isRequired, 55 openSettings: PropTypes.func.isRequired,
52 toggleMuteApp: PropTypes.func.isRequired, 56 toggleMuteApp: PropTypes.func.isRequired,
@@ -87,6 +91,8 @@ export default @observer class Sidebar extends Component {
87 isAppMuted, 91 isAppMuted,
88 isWorkspaceDrawerOpen, 92 isWorkspaceDrawerOpen,
89 toggleWorkspaceDrawer, 93 toggleWorkspaceDrawer,
94 stores,
95 actions,
90 } = this.props; 96 } = this.props;
91 const { intl } = this.context; 97 const { intl } = this.context;
92 const todosToggleMessage = ( 98 const todosToggleMessage = (
@@ -107,6 +113,23 @@ export default @observer class Sidebar extends Component {
107 /> 113 />
108 { isLoggedIn ? ( 114 { isLoggedIn ? (
109 <> 115 <>
116 { stores.settings.all.app.lockingFeatureEnabled ? (
117 <button
118 type="button"
119 className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`}
120 onClick={() => {
121 actions.settings.update({
122 type: 'app',
123 data: {
124 locked: true,
125 },
126 });
127 }}
128 data-tip={`${intl.formatMessage(messages.lockFerdi)} (${ctrlKey}+Shift+L)`}
129 >
130 <i className="mdi mdi-lock" />
131 </button>
132 ) : null}
110 {todosStore.isFeatureEnabled && todosStore.isFeatureEnabledByUser ? ( 133 {todosStore.isFeatureEnabled && todosStore.isFeatureEnabledByUser ? (
111 <button 134 <button
112 type="button" 135 type="button"