diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-02-19 15:59:50 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-02-19 15:59:50 +0100 |
| commit | e2eb2c6a40de00fd19d3d9a337b268580535d4c3 (patch) | |
| tree | f6c09b7e2fb0349f3e91449e849eb305504b6c09 /gui/src/renderer/components | |
| parent | 937cd41dc54d9426e8970f6d83ead110817c27e7 (diff) | |
| parent | a423058d74447fb9f24d12631d644b7cd597a517 (diff) | |
| download | mullvadvpn-e2eb2c6a40de00fd19d3d9a337b268580535d4c3.tar.xz mullvadvpn-e2eb2c6a40de00fd19d3d9a337b268580535d4c3.zip | |
Merge branch 'fix-lint-no-explicit-any'
Diffstat (limited to 'gui/src/renderer/components')
| -rw-r--r-- | gui/src/renderer/components/AppButton.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/LocationList.tsx | 14 | ||||
| -rw-r--r-- | gui/src/renderer/components/SvgMap.tsx | 6 |
3 files changed, 13 insertions, 9 deletions
diff --git a/gui/src/renderer/components/AppButton.tsx b/gui/src/renderer/components/AppButton.tsx index 212e5cb1a3..d31194e072 100644 --- a/gui/src/renderer/components/AppButton.tsx +++ b/gui/src/renderer/components/AppButton.tsx @@ -183,7 +183,7 @@ export class BlockingButton extends Component<IBlockingProps, IBlockingState> { public render() { return React.Children.map(this.props.children, (child) => { if (React.isValidElement(child)) { - return React.cloneElement(child as React.ReactElement<any>, { + return React.cloneElement(child as React.ReactElement, { ...child.props, disabled: this.state.isBlocked || this.props.disabled, onPress: this.onPress, diff --git a/gui/src/renderer/components/LocationList.tsx b/gui/src/renderer/components/LocationList.tsx index a86ae25897..2acb1adf66 100644 --- a/gui/src/renderer/components/LocationList.tsx +++ b/gui/src/renderer/components/LocationList.tsx @@ -248,10 +248,10 @@ interface IRelayLocationsProps { onExpand?: (location: RelayLocation, expand: boolean) => void; } -interface ICommonCellProps { +interface ICommonCellProps<T> { location: RelayLocation; selected: boolean; - ref?: React.Ref<any>; + ref?: React.Ref<T>; } export class RelayLocations extends Component<IRelayLocationsProps> { @@ -269,7 +269,7 @@ export class RelayLocations extends Component<IRelayLocationsProps> { expanded={this.isExpanded(countryLocation)} onSelect={this.handleSelection} onExpand={this.handleExpand} - {...this.getCommonCellProps(countryLocation)}> + {...this.getCommonCellProps<CountryRow>(countryLocation)}> {relayCountry.cities.map((relayCity) => { const cityLocation: RelayLocation = { city: [relayCountry.code, relayCity.code], @@ -283,7 +283,7 @@ export class RelayLocations extends Component<IRelayLocationsProps> { expanded={this.isExpanded(cityLocation)} onSelect={this.handleSelection} onExpand={this.handleExpand} - {...this.getCommonCellProps(cityLocation)}> + {...this.getCommonCellProps<CityRow>(cityLocation)}> {relayCity.relays.map((relay) => { const relayLocation: RelayLocation = { hostname: [relayCountry.code, relayCity.code, relay.hostname], @@ -295,7 +295,7 @@ export class RelayLocations extends Component<IRelayLocationsProps> { active={relay.active} hostname={relay.hostname} onSelect={this.handleSelection} - {...this.getCommonCellProps(relayLocation)} + {...this.getCommonCellProps<RelayRow>(relayLocation)} /> ); })} @@ -333,12 +333,12 @@ export class RelayLocations extends Component<IRelayLocationsProps> { } }; - private getCommonCellProps(location: RelayLocation): ICommonCellProps { + private getCommonCellProps<T>(location: RelayLocation): ICommonCellProps<T> { const selected = this.isSelected(location); const ref = selected && this.props.selectedElementRef ? this.props.selectedElementRef : undefined; - return { ref, selected, location }; + return { ref: ref as React.Ref<T>, selected, location }; } } diff --git a/gui/src/renderer/components/SvgMap.tsx b/gui/src/renderer/components/SvgMap.tsx index 3f715a434e..4884e57861 100644 --- a/gui/src/renderer/components/SvgMap.tsx +++ b/gui/src/renderer/components/SvgMap.tsx @@ -182,7 +182,11 @@ export default class SvgMap extends React.Component<IProps, IState> { ); } - private mergeRsmStyle(style: { [key: string]: any }) { + private mergeRsmStyle(style: { + default?: React.CSSProperties; + hover?: React.CSSProperties; + pressed?: React.CSSProperties; + }) { const defaultStyle = style.default || {}; return { default: defaultStyle, |
