-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1617 from SammyIsConfused/bugfix/allow_wider_cont…
…rols_in_settings_list Change styles to allow SettingsListControl to support wider controls
- Loading branch information
Showing
4 changed files
with
1,403 additions
and
363 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...e/Plugins/Core/com.equella.core/js/__stories__/components/SettingsListControl.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import * as React from "react"; | ||
import { boolean, number, text } from "@storybook/addon-knobs"; | ||
import SettingsListControl from "../../tsrc/components/SettingsListControl"; | ||
import SettingsToggleSwitch from "../../tsrc/components/SettingsToggleSwitch"; | ||
import { Mark, Slider } from "@material-ui/core"; | ||
import { action } from "@storybook/addon-actions"; | ||
|
||
export default { | ||
title: "SettingsListControl", | ||
component: SettingsListControl | ||
}; | ||
|
||
const marks: Mark[] = [ | ||
{ label: "Off", value: 0 }, | ||
{ label: "x0.25", value: 1 }, | ||
{ label: "x0.5", value: 2 }, | ||
{ label: "No boost", value: 3 }, | ||
{ label: "x1.5", value: 4 }, | ||
{ label: "x2", value: 5 }, | ||
{ label: "x4", value: 6 }, | ||
{ label: "x8", value: 7 } | ||
]; | ||
|
||
export const ToggleSwitchControl = () => ( | ||
<SettingsListControl | ||
secondaryText={text("Secondary Text", "Box for checking")} | ||
control={ | ||
<SettingsToggleSwitch | ||
disabled={boolean("Disabled", false)} | ||
id={"toggle"} | ||
setValue={action("Value of checkbox changed")} | ||
value={boolean("Toggle state", false)} | ||
/> | ||
} | ||
divider={boolean("divider", false)} | ||
primaryText={text("primaryText", "Checkbox")} | ||
/> | ||
); | ||
export const SliderControl = () => ( | ||
<SettingsListControl | ||
secondaryText={text("Secondary Text", "Slide for sliding")} | ||
control={ | ||
<Slider | ||
marks={marks} | ||
onChangeCommitted={action("Value of slider changed")} | ||
min={number("min", 0)} | ||
max={number("max", 7)} | ||
step={null} | ||
/> | ||
} | ||
divider={boolean("divider", false)} | ||
primaryText={text("primaryText", "SliderControl")} | ||
/> | ||
); |
2 changes: 1 addition & 1 deletion
2
...gins/Core/com.equella.core/js/__tests__/tsrc/components/SearchSettingFormControl.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.