diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-05-08 14:52:20 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-05-08 14:52:20 +0200 |
| commit | 4226406ec8f15c5dde88642fd9ebf69eab5a5f3b (patch) | |
| tree | 1af082914b00fd3d0c7063653a49b3295cd89976 /gui/src/renderer/components/ChevronButton.tsx | |
| parent | 0f7a364f9a8f6087da007fac3c6d5606472e956d (diff) | |
| parent | 05ff02a622c14562b54a11d675655d7327afdc79 (diff) | |
| download | mullvadvpn-4226406ec8f15c5dde88642fd9ebf69eab5a5f3b.tar.xz mullvadvpn-4226406ec8f15c5dde88642fd9ebf69eab5a5f3b.zip | |
Merge branch 'convert-imageview-to-styled-component'
Diffstat (limited to 'gui/src/renderer/components/ChevronButton.tsx')
| -rw-r--r-- | gui/src/renderer/components/ChevronButton.tsx | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/gui/src/renderer/components/ChevronButton.tsx b/gui/src/renderer/components/ChevronButton.tsx index 04aabf6a99..aed6bacaec 100644 --- a/gui/src/renderer/components/ChevronButton.tsx +++ b/gui/src/renderer/components/ChevronButton.tsx @@ -1,34 +1,32 @@ import * as React from 'react'; -import { Component, Styles, Types } from 'reactxp'; +import styled from 'styled-components'; import { colors } from '../../config.json'; import * as Cell from './Cell'; interface IProps { up: boolean; - onPress?: (event: Types.SyntheticEvent) => void; - style?: Types.StyleRuleSetRecursive<Types.ViewStyleRuleSet>; + onClick?: (event: React.MouseEvent) => void; + className?: string; } -const style = Styles.createViewStyle({ +const Icon = styled(Cell.Icon)({ flex: 0, alignSelf: 'stretch', justifyContent: 'center', - paddingRight: 16, - paddingLeft: 16, + paddingRight: '16px', + paddingLeft: '16px', }); -export default class ChevronButton extends Component<IProps> { - public render() { - return ( - <Cell.Icon - style={[style, this.props.style]} - tintColor={colors.white80} - tintHoverColor={colors.white} - onPress={this.props.onPress} - source={this.props.up ? 'icon-chevron-up' : 'icon-chevron-down'} - height={24} - width={24} - /> - ); - } +export default function ChevronButton(props: IProps) { + return ( + <Icon + tintColor={colors.white80} + tintHoverColor={colors.white} + onClick={props.onClick} + source={props.up ? 'icon-chevron-up' : 'icon-chevron-down'} + height={24} + width={24} + className={props.className} + /> + ); } |
