mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
44 lines
872 B
JavaScript
44 lines
872 B
JavaScript
// @flow
|
|
import * as React from 'react';
|
|
import styled from 'styled-components';
|
|
|
|
const StyledRadioButtonGroup: React.ComponentType<{}> = styled.div`
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: var(--padding-xs);
|
|
border: 1px solid var(--hl-xs);
|
|
border-radius: var(--radius--sm);
|
|
& > * :not(:last-child) {
|
|
margin-right: var(--padding-xs);
|
|
}
|
|
|
|
label {
|
|
cursor: pointer;
|
|
color: var(--color-font);
|
|
flex-grow: 1;
|
|
justify-content: center;
|
|
|
|
input {
|
|
display: none;
|
|
}
|
|
|
|
span {
|
|
text-align: center;
|
|
padding: var(--padding-sm) var(--padding-xs);
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
input:checked + span {
|
|
background-color: var(--hl-xs);
|
|
}
|
|
`;
|
|
|
|
class RadioButtonGroup extends React.Component<{}> {
|
|
render() {
|
|
return <StyledRadioButtonGroup {...this.props} />;
|
|
}
|
|
}
|
|
|
|
export default RadioButtonGroup;
|