Skip to content

Commit

Permalink
update buttons and switches
Browse files Browse the repository at this point in the history
  • Loading branch information
hendriksen-mark committed Apr 26, 2024
1 parent b386862 commit 5a6389a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
15 changes: 9 additions & 6 deletions src/Pages/Bridge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,15 @@ const Bridge = ({ HOST_IP, API_KEY }) => {
<GlassContainer options="spacer">
<PageContent>
<div className="headline">Bridge control</div>
<FlipSwitch
value={AdvanceConfig}
onChange={(e) => setAdvanceConfig(e)}
checked={AdvanceConfig}
label={`${AdvanceConfig ? "Hide" : "Show"} advanced config`}
/>
<div className="form-control">
<GenericButton
value={`${AdvanceConfig ? "Hide" : "Show"} advanced config`}
color="blue"
size=""
type="submit"
onClick={() => setAdvanceConfig(!AdvanceConfig)}
/>
</div>
<div className="form-control">
<GenericButton
value="Force Config Dump"
Expand Down
32 changes: 17 additions & 15 deletions src/components/FlipSwitch/FlipSwitch.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import "./flipswitch.scss";

const FlipSwitch = ({ value, onChange, checked, defaultChecked, label }) => (
<div className="flipSwitch">
<p>{label}</p>
<label className="flipSwitchLabel">
<input
type="checkbox"
value={value}
onChange={(e) => onChange(e.target.checked)}
checked={checked}
defaultChecked={defaultChecked}
/>
<span className="slider"></span>
</label>
</div>
);
const FlipSwitch = ({ value, onChange, checked, defaultChecked, label }) => (<>
<div className="flipSwitch">
<p>{label}</p>
</div>
<div className="flipSwitch">
<label className="flipSwitchLabel">
<input
type="checkbox"
value={value}
onChange={(e) => onChange(e.target.checked)}
checked={checked}
defaultChecked={defaultChecked}
/>
<span className="slider"></span>
</label>
</div>
</>);

export default FlipSwitch;
6 changes: 4 additions & 2 deletions src/components/FlipSwitch/flipswitch.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.flipSwitch {
display: flex;
padding: 10px;
align-items: center;

p{
margin-right: 10px;
padding: 10px;
margin-top: 10px;
}

.flipSwitchLabel{
Expand All @@ -19,6 +19,8 @@
}

.slider {
margin-bottom: 10px;
margin-left: 10px;
position: absolute;
cursor: pointer;
top: 0;
Expand Down
5 changes: 3 additions & 2 deletions src/components/GenericButton/genericButton.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
input.btn-block {
background: rgba(52, 152, 219, 1);
padding: 20px 60px;
padding: 20px 0px;
border-radius: 35px;
color: #eee;
font-size: 18px;
Expand All @@ -18,7 +18,8 @@ input.btn-block {
}

&.small{
padding: 20px 20px;
font-size: 14px;
padding: 10px;
width: auto;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/Wizard/wizard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.header {
display: flex;
font-size: 20px;
color: #fff;
color: #ccc;

.headline {
flex: 1 1 auto;
Expand All @@ -42,7 +42,7 @@

.wizardContent {
p {
color: #ccc;
color: #fff;
margin-top: 5px;
}
}
Expand Down

0 comments on commit 5a6389a

Please sign in to comment.