Skip to content

Commit

Permalink
Use default value (true) for boolean props
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Nov 18, 2021
1 parent 05fb89b commit b4ab6be
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ object ButtonBases extends FunctionComponent[Unit] {
<.div(^.className := styleOf(classes.root))(
images.map { case (imageUrl, imageTitle, imageWidth) =>
<.ButtonBase(
^.focusRipple := true,
^.focusRipple(),
^.key := imageTitle,
^.className := styleOf(classes.image),
^.focusVisibleClassName := styleOf(classes.focusVisible),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object ContainedButtons extends FunctionComponent[Unit] {
<.Button(^.variant := "contained", ^.color := "secondary")(
"Secondary"
),
<.Button(^.variant := "contained", ^.disabled := true)(
<.Button(^.variant := "contained", ^.disabled())(
"Disabled"
),
<.Button(^.variant := "contained", ^.color := "primary", ^.href := "#contained-buttons")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object CustomizedButtons extends FunctionComponent[Unit] {
"Theme Provider"
)
),
<(BootstrapButton)(^.variant := "contained", ^.color := "primary", ^.disableRipple := true, ^.className := styleOf(classes.margin))(
<(BootstrapButton)(^.variant := "contained", ^.color := "primary", ^.disableRipple(), ^.className := styleOf(classes.margin))(
"Bootstrap"
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scommons.react._
object DisableElevation extends FunctionComponent[Unit] {

protected def render(compProps: Props): ReactElement = {
<.Button(^.variant := "contained", ^.color := "primary", ^.disableElevation := true)(
<.Button(^.variant := "contained", ^.color := "primary", ^.disableElevation())(
"Disable elevation"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object IconButtons extends FunctionComponent[Unit] {
<.IconButton(^("aria-label") := "delete")(
<(DeleteIcon)()()
),
<.IconButton(^("aria-label") := "delete", ^.disabled := true, ^.color := "primary")(
<.IconButton(^("aria-label") := "delete", ^.disabled(), ^.color := "primary")(
<(DeleteIcon)()()
),
<.IconButton(^.color := "secondary", ^("aria-label") := "add an alarm")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object IconLabelButtons extends FunctionComponent[Unit] {
),
<.Button(
^.variant := "contained",
^.disabled := true,
^.disabled(),
^.color := "secondary",
^.className := styleOf(classes.button),
^.startIcon := <(KeyboardVoiceIcon)()()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object OutlinedButtons extends FunctionComponent[Unit] {
<.Button(^.variant := "outlined", ^.color := "secondary")(
"Secondary"
),
<.Button(^.variant := "outlined", ^.disabled := true)(
<.Button(^.variant := "outlined", ^.disabled())(
"Disabled"
),
<.Button(^.variant := "outlined", ^.color := "primary", ^.href := "#outlined-buttons")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object TextButtons extends FunctionComponent[Unit] {
<.Button()("Default"),
<.Button(^.color := "primary")("Primary"),
<.Button(^.color := "secondary")("Secondary"),
<.Button(^.disabled := true)("Disabled"),
<.Button(^.disabled())("Disabled"),
<.Button(^.href := "#text-buttons", ^.color := "primary")(
"Link"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object UploadButtons extends FunctionComponent[Unit] {
^.accept := "image/*",
^.className := styleOf(classes.input),
^.id := "contained-button-file",
^.multiple := true,
^.multiple(),
^.`type` := "file"
)(),
<.label(^.htmlFor := "contained-button-file")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ButtonBasesSpec extends TestSpec with MuiBaseTestSpec {
<.div(^.className := styleOf(classes.root))(
images.map { case (imageUrl, imageTitle, imageWidth) =>
<.ButtonBase(
^.focusRipple := true,
^.focusRipple(),
^.key := imageTitle,
^.className := styleOf(classes.image),
^.focusVisibleClassName := styleOf(classes.focusVisible),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ContainedButtonsSpec extends TestSpec with MuiBaseTestSpec {
<.Button(^.variant := "contained", ^.color := "secondary")(
"Secondary"
),
<.Button(^.variant := "contained", ^.disabled := true)(
<.Button(^.variant := "contained", ^.disabled())(
"Disabled"
),
<.Button(^.variant := "contained", ^.color := "primary", ^.href := "#contained-buttons")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CustomizedButtonsSpec extends TestSpec with MuiBaseTestSpec {
"Theme Provider"
)
),
<(BootstrapButton)(^.variant := "contained", ^.color := "primary", ^.disableRipple := true, ^.className := styleOf(classes.margin))(
<(BootstrapButton)(^.variant := "contained", ^.color := "primary", ^.disableRipple(), ^.className := styleOf(classes.margin))(
"Bootstrap"
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DisableElevationSpec extends TestSpec with TestRendererUtils {

//then
assertNativeComponent(result,
<.Button(^.variant := "contained", ^.color := "primary", ^.disableElevation := true)(
<.Button(^.variant := "contained", ^.color := "primary", ^.disableElevation())(
"Disable elevation"
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class IconButtonsSpec extends TestSpec with MuiBaseTestSpec {
<.IconButton(^("aria-label") := "delete")(
<(DeleteIcon)()()
),
<.IconButton(^("aria-label") := "delete", ^.disabled := true, ^.color := "primary")(
<.IconButton(^("aria-label") := "delete", ^.disabled(), ^.color := "primary")(
<(DeleteIcon)()()
),
<.IconButton(^.color := "secondary", ^("aria-label") := "add an alarm")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class IconLabelButtonsSpec extends TestSpec with MuiBaseTestSpec {
assertNativeComponent(b4,
<.Button(
^.variant := "contained",
^.disabled := true,
^.disabled(),
^.color := "secondary",
^.className := styleOf(classes.button)
)(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OutlinedButtonsSpec extends TestSpec with MuiBaseTestSpec {
<.Button(^.variant := "outlined", ^.color := "secondary")(
"Secondary"
),
<.Button(^.variant := "outlined", ^.disabled := true)(
<.Button(^.variant := "outlined", ^.disabled())(
"Disabled"
),
<.Button(^.variant := "outlined", ^.color := "primary", ^.href := "#outlined-buttons")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TextButtonsSpec extends TestSpec with MuiBaseTestSpec {
<.Button()("Default"),
<.Button(^.color := "primary")("Primary"),
<.Button(^.color := "secondary")("Secondary"),
<.Button(^.disabled := true)("Disabled"),
<.Button(^.disabled())("Disabled"),
<.Button(^.href := "#text-buttons", ^.color := "primary")(
"Link"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UploadButtonsSpec extends TestSpec with MuiBaseTestSpec {
^.accept := "image/*",
^.className := styleOf(classes.input),
^.id := "contained-button-file",
^.multiple := true,
^.multiple(),
^.`type` := "file"
)(),
<.label(^.htmlFor := "contained-button-file")(
Expand Down

0 comments on commit b4ab6be

Please sign in to comment.