diff --git a/test/e2e/threebox.spec.js b/test/e2e/threebox.spec.js index 10bb0fcfb..54f7f01cd 100644 --- a/test/e2e/threebox.spec.js +++ b/test/e2e/threebox.spec.js @@ -223,7 +223,7 @@ describe('MetaMask', function () { it('finds the blockies toggle turned on', async function () { await driver.delay(regularDelayMs) - const toggleLabel = await driver.findElement(By.css('.toggle-button__status-label')) + const toggleLabel = await driver.findElement(By.css('.toggle-button__status')) const toggleLabelText = await toggleLabel.getText() assert.equal(toggleLabelText, 'ON') }) diff --git a/ui/app/components/ui/toggle-button/index.scss b/ui/app/components/ui/toggle-button/index.scss index 868d416c8..a72cf8bdb 100644 --- a/ui/app/components/ui/toggle-button/index.scss +++ b/ui/app/components/ui/toggle-button/index.scss @@ -1,7 +1,8 @@ .toggle-button { display: flex; + $self: &; - &__status-label { + &__status { font-family: Roboto; font-style: normal; font-weight: normal; @@ -10,5 +11,28 @@ display: flex; align-items: center; text-transform: uppercase; + display: grid; } -} \ No newline at end of file + + &__label-off, &__label-on { + grid-area: 1 / 1 / 1 / 1; + } + + &__label-off { + visibility: hidden; + } + + &__label-on { + visibility: visible; + } + + &--off { + #{ $self }__label-off { + visibility: visible; + } + + #{ $self }__label-on { + visibility: hidden; + } + } +} diff --git a/ui/app/components/ui/toggle-button/toggle-button.component.js b/ui/app/components/ui/toggle-button/toggle-button.component.js index 38ffb27fd..3809b7877 100644 --- a/ui/app/components/ui/toggle-button/toggle-button.component.js +++ b/ui/app/components/ui/toggle-button/toggle-button.component.js @@ -48,8 +48,10 @@ const colors = { const ToggleButton = (props) => { const { value, onToggle, offLabel, onLabel } = props + const modifier = value ? 'on' : 'off' + return ( -
+
{ thumbAnimateRange={[3, 18]} colors={colors} /> -
{ value ? onLabel : offLabel }
+
+ {offLabel} + {onLabel} +
) }