Skip to content

Commit 42414e4

Browse files
committed
Refactor react-switch color to less file
Signed-off-by: Carlos Martín <[email protected]>
1 parent 4490f27 commit 42414e4

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

frontend/src/components/CodeViewer.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,9 @@ class CodeViewer extends Component {
154154
uncheckedIcon={
155155
<span className="switch-text unchecked">UAST</span>
156156
}
157-
onColor="#ffba34"
158-
offColor="#e1e1e1"
159157
width={100}
160158
handleDiameter={20}
161-
className="code-toggler"
159+
className={`code-toggler ${showUast ? 'checked' : 'unchecked'}`}
162160
aria-label="Toggle UAST view"
163161
/>
164162
</Modal.Title>

frontend/src/components/CodeViewer.less

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,24 @@
3333
}
3434

3535
.switch-text.checked {
36-
color: @btn-gbpl-tertiary-color;
36+
color: @btn-gbpl-tertiary-color;
3737
padding-left: 28px;
3838
}
3939

4040
.switch-text.unchecked {
4141
color: #979797;
4242
margin-left: -29px;
4343
}
44+
45+
&.checked {
46+
.react-switch-bg {
47+
background: @tertiary !important;
48+
}
49+
}
50+
51+
&.unchecked {
52+
.react-switch-bg {
53+
background: #e1e1e1 !important;
54+
}
55+
}
4456
}

0 commit comments

Comments
 (0)