From 7a9e07579be51bd4aae7adc706564d976fd816e2 Mon Sep 17 00:00:00 2001 From: Mikaya Kim Date: Sun, 23 Apr 2023 15:33:01 -0500 Subject: [PATCH 1/3] =?UTF-8?q?ISSUE=20#1326=20=E2=80=94=20Added=20vibrati?= =?UTF-8?q?on=20and=20delay=20functionality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Board/Board.component.js | 10 +++- .../Navigation/Navigation.component.js | 54 +++++++++++++++++++ .../Navigation/Navigation.messages.js | 18 +++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/components/Board/Board.component.js b/src/components/Board/Board.component.js index c531326ec..3868cfa6b 100644 --- a/src/components/Board/Board.component.js +++ b/src/components/Board/Board.component.js @@ -25,6 +25,7 @@ import { DISPLAY_SIZE_GRID_COLS } from '../Settings/Display/Display.constants'; import NavigationButtons from '../NavigationButtons'; import EditGridButtons from '../EditGridButtons'; import { DEFAULT_ROWS_NUMBER, DEFAULT_COLUMNS_NUMBER } from './Board.constants'; +import Navigation from '../Settings/Navigation/Navigation.component.js'; import { Link } from 'react-router-dom'; @@ -144,7 +145,14 @@ export class Board extends Component { : 'boardContainerRef'; this[boardComponentRef].current.scrollTop = 0; } - onTileClick(tile); + if (Navigation.vibrationMode) { + navigator.vibrate(200); + } + if (Navigation.delayMode) { + setTimeout(onTileClick(tile), 200); + } else { + onTileClick(tile); + } }; handleTileFocus = tileId => { diff --git a/src/components/Settings/Navigation/Navigation.component.js b/src/components/Settings/Navigation/Navigation.component.js index 9059411b9..0627e48e1 100644 --- a/src/components/Settings/Navigation/Navigation.component.js +++ b/src/components/Settings/Navigation/Navigation.component.js @@ -80,6 +80,18 @@ class Navigation extends React.Component { }); }; + toggleVibration = () => { + this.setState({ + vibrationMode: !this.state.vibrationMode + }); + }; + + toggleDelay = () => { + this.setState({ + delayMode: !this.state.delayMode + }); + }; + onSubmit = () => { const { isLiveMode, changeLiveMode } = this.props; if (!this.state.liveMode && isLiveMode) { @@ -289,6 +301,48 @@ class Navigation extends React.Component { /> + + + + + } + secondary={ + + } + /> + + + + + + + + + } + secondary={ + + } + /> + + + + diff --git a/src/components/Settings/Navigation/Navigation.messages.js b/src/components/Settings/Navigation/Navigation.messages.js index 7822e571a..6cded972e 100644 --- a/src/components/Settings/Navigation/Navigation.messages.js +++ b/src/components/Settings/Navigation/Navigation.messages.js @@ -56,6 +56,24 @@ export default defineMessages({ defaultMessage: 'Live mode allows you to write text directly into the output bar and quickly play the sound. It is intended for users that can write.' }, + showVibrationMode: { + id: 'cboard.components.Settings.Navigation.showVibrationMode', + defaultMessage: 'Vibration Mode' + }, + showVibrationModeSecondary: { + id: 'cboard.components.Settings.Navigation.showVibrationModeSecondary', + defaultMessage: + "Vibration mode makes your device vibrate whenever a tile is pressed, allowing for feedback once you've pressed a tile." + }, + showDelayMode: { + id: 'cboard.components.Settings.Navigation.showVibrationMode', + defaultMessage: 'Turn on delay' + }, + showDelayModeSecondary: { + id: 'cboard.components.Settings.Navigation.showVibrationModeSecondary', + defaultMessage: + 'Delay mode disallows new tile presses while a tile is speaking' + }, bigScroll: { id: 'cboard.components.Settings.Navigation.bigScroll', defaultMessage: 'Enable big scroll buttons' From 5b0f0d5c98660fb0e57910e9a1a6ac170e0508d7 Mon Sep 17 00:00:00 2001 From: Mikaya Kim Date: Sun, 23 Apr 2023 20:23:35 -0500 Subject: [PATCH 2/3] added Travis CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..587bd3e03 --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: node_js From 8f473d1577753d65ae4560c34c121095aa7af058 Mon Sep 17 00:00:00 2001 From: Mikaya Kim <93180280+mikayak@users.noreply.github.com> Date: Sun, 23 Apr 2023 21:20:44 -0500 Subject: [PATCH 3/3] Removed Travis CI --- .travis.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 587bd3e03..000000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: node_js