forked from metabrainz/listenbrainz-server
-
Notifications
You must be signed in to change notification settings - Fork 0
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 metabrainz#2603 from anshg1214/releases
LB-1172: Fresh releases improvements
- Loading branch information
Showing
28 changed files
with
3,100 additions
and
3,252 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,53 @@ | ||
.toggle { | ||
cursor: pointer; | ||
display: inline-block; | ||
} | ||
|
||
.toggle-switch { | ||
display: inline-block; | ||
background: #8d8d8d; | ||
border-radius: 16px; | ||
width: 42px; | ||
height: 14px; | ||
position: relative; | ||
vertical-align: middle; | ||
transition: background 0.25s; | ||
} | ||
.toggle-switch:before, | ||
.toggle-switch:after { | ||
content: ""; | ||
} | ||
.toggle-switch:before { | ||
display: block; | ||
background: #d9d9d9; | ||
border-radius: 50%; | ||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); | ||
width: 20px; | ||
height: 20px; | ||
position: absolute; | ||
top: -3px; | ||
left: 0px; | ||
transition: left 0.25s; | ||
} | ||
.toggle:hover .toggle-switch:before { | ||
background: #d9d9d9; | ||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); | ||
} | ||
.toggle-checkbox:checked + .toggle-switch { | ||
background: #1e1e1e; | ||
} | ||
.toggle-checkbox:checked + .toggle-switch:before { | ||
left: 23px; | ||
background: #8d8d8d; | ||
} | ||
|
||
.toggle-checkbox { | ||
position: absolute; | ||
visibility: hidden; | ||
} | ||
|
||
.toggle-label { | ||
margin-left: 10px; | ||
position: relative; | ||
font-weight: 400; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,28 @@ | ||
import * as React from "react"; | ||
|
||
type SwitchProps = { | ||
id: string; | ||
value: string | undefined; | ||
checked: boolean; | ||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
switchLabel: string | undefined; | ||
}; | ||
|
||
export default function Switch(props: SwitchProps) { | ||
const { id, value = "", onChange, checked, switchLabel = "" } = props; | ||
|
||
return ( | ||
<label className="toggle" htmlFor={id}> | ||
<input | ||
id={id} | ||
className="toggle-checkbox" | ||
type="checkbox" | ||
value={value} | ||
checked={checked} | ||
onChange={onChange} | ||
/> | ||
<div className="toggle-switch" /> | ||
<span className="toggle-label">{switchLabel}</span> | ||
</label> | ||
); | ||
} |
Oops, something went wrong.