Skip to content

Commit

Permalink
Hide tablet mode on Gladys Plus + improve UX tablet mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Oct 23, 2023
1 parent 51a2048 commit a1291bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"toggleDefineTabletMode": "Mode tablette",
"tabletMode": {
"description": "Le mode tablette sert à la fonctionnalité alarme. Si vous armez l'alarme, toutes les tablettes de la maison seront verrouillées et afficherons un clavier virtuel pour désactiver l'alarme.",
"fullScreenForce": "Si vous voulez forcer une tablette à rester en mode plein écran, vous pouvez ajouter <code>?fullscreen=force</code> à l'URL.",
"houseLabel": "Maison",
"tabletModeDisabled": "Mode tablette désactivé"
},
Expand Down
14 changes: 8 additions & 6 deletions front/src/routes/dashboard/DashboardPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ const DashboardPage = ({ children, ...props }) => (
</div>

<div class="page-options d-flex align-content-between flex-wrap">
<button onClick={props.toggleDefineTabletMode} class={cx('btn btn-outline-secondary ml-2')}>
<span class={style.editDashboardText}>
<Text id="dashboard.toggleDefineTabletMode" />
</span>{' '}
<i class="fe fe-tablet" />
</button>
{!props.isGladysPlus && (
<button onClick={props.toggleDefineTabletMode} class={cx('btn btn-outline-secondary ml-2')}>
<span class={style.editDashboardText}>
<Text id="dashboard.toggleDefineTabletMode" />
</span>{' '}
<i class="fe fe-tablet" />
</button>
)}
{!props.dashboardNotConfigured &&
props.browserFullScreenCompatible &&
!props.hideExitFullScreenButton && (
Expand Down
5 changes: 4 additions & 1 deletion front/src/routes/dashboard/SetTabletMode.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from 'preact';
import { connect } from 'unistore/preact';
import { Text } from 'preact-i18n';
import { Text, MarkupText } from 'preact-i18n';
import cx from 'classnames';
import mainActions from '../../actions/main';
import style from './style.css';
Expand Down Expand Up @@ -110,6 +110,9 @@ class SetTabletMode extends Component {
))}
</select>
</div>
<p>
<MarkupText id="dashboard.tabletMode.fullScreenForce" />
</p>
<div className="form-group">
<button class="btn btn-success" onClick={this.saveTabletMode}>
<Text id="global.save" />
Expand Down
1 change: 1 addition & 0 deletions front/src/routes/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class Dashboard extends Component {
super(props);
this.props = props;
this.state = {
isGladysPlus: this.props.session.gatewayClient !== undefined,
dashboardDropdownOpened: false,
defineTabletModeOpened: false,
dashboardEditMode: false,
Expand Down

0 comments on commit a1291bf

Please sign in to comment.