diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-09-12 13:55:48 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-09-13 11:29:04 +0200 |
| commit | 4c5cc66fe0fc59d399225b7f2eff199785f94fa1 (patch) | |
| tree | 2f01b083434af6d9bb70fe9de1de94a85e9bd4d7 /gui/src/renderer/components | |
| parent | d3238497e9485f2ebc56d7ca5efc44be5b9eb68e (diff) | |
| download | mullvadvpn-4c5cc66fe0fc59d399225b7f2eff199785f94fa1.tar.xz mullvadvpn-4c5cc66fe0fc59d399225b7f2eff199785f94fa1.zip | |
Migrate UI to use the new "active" flag in the relay list v3 schema
Diffstat (limited to 'gui/src/renderer/components')
| -rw-r--r-- | gui/src/renderer/components/LocationList.tsx | 1 | ||||
| -rw-r--r-- | gui/src/renderer/components/RelayRow.tsx | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gui/src/renderer/components/LocationList.tsx b/gui/src/renderer/components/LocationList.tsx index 418da66e94..72a3b64f75 100644 --- a/gui/src/renderer/components/LocationList.tsx +++ b/gui/src/renderer/components/LocationList.tsx @@ -84,6 +84,7 @@ export default class LocationList extends Component<IProps, IState> { return ( <RelayRow key={getLocationKey(relayLocation)} + active={relay.active} hostname={relay.hostname} onSelect={this.handleSelection} {...this.getCommonCellProps(relayLocation)} diff --git a/gui/src/renderer/components/RelayRow.tsx b/gui/src/renderer/components/RelayRow.tsx index 69f632e04e..5dff0a33f1 100644 --- a/gui/src/renderer/components/RelayRow.tsx +++ b/gui/src/renderer/components/RelayRow.tsx @@ -7,6 +7,7 @@ import RelayStatusIndicator from './RelayStatusIndicator'; interface IProps { location: RelayLocation; + active: boolean; hostname: string; selected: boolean; onSelect?: (location: RelayLocation) => void; @@ -30,6 +31,7 @@ export default class RelayRow extends Component<IProps> { return ( oldProps.hostname === nextProps.hostname && oldProps.selected === nextProps.selected && + oldProps.active === nextProps.active && compareRelayLocation(oldProps.location, nextProps.location) ); } @@ -43,8 +45,9 @@ export default class RelayRow extends Component<IProps> { <Cell.CellButton onPress={this.handlePress} cellHoverStyle={this.props.selected ? styles.selected : undefined} + disabled={!this.props.active} style={[styles.base, this.props.selected ? styles.selected : undefined]}> - <RelayStatusIndicator isActive={true} isSelected={this.props.selected} /> + <RelayStatusIndicator isActive={this.props.active} isSelected={this.props.selected} /> <Cell.Label>{this.props.hostname}</Cell.Label> </Cell.CellButton> |
