Skip to content

Commit

Permalink
Add new context for guidebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
blmage committed Nov 15, 2022
1 parent 10f2651 commit 78dade3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"chrome-storage-promise": "git+https://github.com/blmage/chrome-storage-promise.git#semver:^1.0.0",
"classnames": "^2.3.1",
"duo-toolbox": "git+https://github.com/blmage/duo-toolbox.git#semver:^3.5.0",
"duo-toolbox": "git+https://github.com/blmage/duo-toolbox.git#semver:^3.7.0",
"lodash.merge": "^4.6.2",
"preact": "^10.5.14",
"preact-use": "git+https://github.com/blmage/preact-use.git#semver:^17.3.1-patch",
Expand Down
19 changes: 12 additions & 7 deletions src/components/SettingsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import {
CONTEXT_CHARACTERS,
CONTEXT_FORUM_DISCUSSION,
CONTEXT_GUIDEBOOK,
CONTEXT_LISTENING_CHALLENGE,
CONTEXT_OTHER_CHALLENGE,
CONTEXT_UNKNOWN,
Expand Down Expand Up @@ -145,6 +146,10 @@ const CONTEXT_HEADERS = {
icon: PrimeIcons.PENCIL,
label: 'Challenge (other)',
},
[CONTEXT_GUIDEBOOK]: {
icon: PrimeIcons.MAP,
label: 'Guidebook',
},
[CONTEXT_STORY]: {
icon: PrimeIcons.BOOK,
label: 'Story',
Expand Down Expand Up @@ -280,13 +285,13 @@ const SettingSlider =

const SettingsPanel =
({
context = null,
config,
disabled = false,
activeSetting = null,
onSettingValueChange = noop,
onActiveSettingChange = noop,
}) => {
context = null,
config,
disabled = false,
activeSetting = null,
onSettingValueChange = noop,
onActiveSettingChange = noop,
}) => {
const soundSettingPanels = SOUND_SETTINGS.map(setting => {
const value = getSettingMainValue(config, setting, context, false);
const defaultValue = context && getSettingMainValue(config, setting, null);
Expand Down
3 changes: 3 additions & 0 deletions src/contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CONTEXT_CHALLENGE,
CONTEXT_CHARACTERS,
CONTEXT_FORUM_DISCUSSION,
CONTEXT_GUIDEBOOK,
CONTEXT_STORY,
CONTEXT_UNKNOWN,
getCurrentContext as getBaseCurrentContext,
Expand All @@ -22,6 +23,7 @@ export const CONTEXT_OTHER_CHALLENGE = 'other_challenge';
export {
CONTEXT_CHARACTERS,
CONTEXT_FORUM_DISCUSSION,
CONTEXT_GUIDEBOOK,
CONTEXT_STORY,
CONTEXT_UNKNOWN,
};
Expand All @@ -32,6 +34,7 @@ export {
export const CONTEXTS = [
CONTEXT_LISTENING_CHALLENGE,
CONTEXT_OTHER_CHALLENGE,
CONTEXT_GUIDEBOOK,
CONTEXT_STORY,
CONTEXT_FORUM_DISCUSSION,
CONTEXT_CHARACTERS,
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1634,9 +1634,9 @@ dom-helpers@^5.0.1:
"@babel/runtime" "^7.8.7"
csstype "^3.0.2"

"duo-toolbox@git+https://github.com/blmage/duo-toolbox.git#semver:^3.5.0":
version "3.5.0"
resolved "git+https://github.com/blmage/duo-toolbox.git#7394cf37c6f18f00097a7103feff990e24bab0f4"
"duo-toolbox@git+https://github.com/blmage/duo-toolbox.git#semver:^3.7.0":
version "3.7.0"
resolved "git+https://github.com/blmage/duo-toolbox.git#6978864996ad10af33e613f24fd08d45aa5dc4c4"

electron-to-chromium@^1.4.202:
version "1.4.206"
Expand Down

0 comments on commit 78dade3

Please sign in to comment.