Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HopPicker: improve channel selection colors #1611

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/Channels/ChannelItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ export function ChannelItem({
padding: 16,
justifyContent: 'space-around',
borderBottomColor: themeColor('secondary'),
borderBottomWidth: noBorder ? 0 : 1
borderBottomWidth: noBorder ? 0 : 1,
backgroundColor: selected ? themeColor('background') : undefined
}}
>
<Row justify="space-between">
{title && (
<View style={{ flex: 1, paddingRight: 10 }}>
<Body color={selected ? 'highlight' : 'text'}>
<Body
color={selected ? 'highlight' : 'text'}
bold={selected}
>
{PrivacyUtils.sensitiveValue(title)}
</Body>
</View>
Expand Down
166 changes: 78 additions & 88 deletions components/HopPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,102 +122,92 @@ export default class ChannelPicker extends React.Component<
<View
style={{
...styles.modal,
backgroundColor: themeColor('background')
backgroundColor: themeColor('secondary')
}}
>
{showChannelModal && (
<>
<Text
style={{
...styles.text,
color: themeColor('text'),
fontSize: 25
}}
>
{localeString(
'components.ChannelPicker.modal.title'
)}
</Text>
<Text
style={{
...styles.text,
color: themeColor('text'),
paddingTop: 20,
paddingBottom: 20
}}
>
{localeString(
'components.ChannelPicker.modal.description'
)}
</Text>
<Text
style={{
...styles.text,
color: themeColor('text'),
fontSize: 25
}}
>
{localeString(
'components.ChannelPicker.modal.title'
)}
</Text>
<Text
style={{
...styles.text,
color: themeColor('text'),
paddingTop: 20,
paddingBottom: 20
}}
>
{localeString(
'components.ChannelPicker.modal.description'
)}
</Text>

<FlatList
data={channels}
renderItem={(item) =>
this.renderItem(item)
}
onEndReachedThreshold={50}
refreshing={loading}
onRefresh={() => getChannels()}
/>
<FlatList
data={channels}
renderItem={(item) => this.renderItem(item)}
onEndReachedThreshold={50}
refreshing={loading}
onRefresh={() => getChannels()}
/>

<View style={styles.button}>
<Button
title={localeString(
'components.ChannelPicker.modal.set'
)}
onPress={() => {
const { channelSelected }: any =
this.state;
<View style={styles.button}>
<Button
title={localeString(
'components.ChannelPicker.modal.set'
)}
onPress={() => {
const { channelSelected }: any =
this.state;

if (channelSelected) {
const displayName =
channelSelected.alias ||
(nodes[
channelSelected
.remote_pubkey
] &&
nodes[
channelSelected
.remote_pubkey
].alias) ||
(channelSelected &&
channelSelected.remote_pubkey) ||
(channelSelected &&
channelSelected.channelId);
if (channelSelected) {
const displayName =
channelSelected.alias ||
(nodes[
channelSelected
.remote_pubkey
] &&
nodes[
channelSelected
.remote_pubkey
].alias) ||
(channelSelected &&
channelSelected.remote_pubkey) ||
(channelSelected &&
channelSelected.channelId);

this.setState({
showChannelModal: false,
valueSet: displayName
});
this.setState({
showChannelModal: false,
valueSet: displayName
});

onValueChange(
channelSelected
);
} else {
this.setState({
showChannelModal: false
});
}
}}
/>
</View>
onValueChange(channelSelected);
} else {
this.setState({
showChannelModal: false
});
}
}}
/>
</View>

<View style={styles.button}>
<Button
title={localeString(
'general.cancel'
)}
onPress={() =>
this.setState({
showChannelModal: false
})
}
secondary
/>
</View>
</>
)}
<View style={styles.button}>
<Button
title={localeString('general.cancel')}
onPress={() =>
this.setState({
showChannelModal: false
})
}
secondary
/>
</View>
</View>
</View>
</Modal>
Expand Down