Skip to content

Commit

Permalink
Merge pull request #1611 from myxmaster/improve-channel-selection-mod…
Browse files Browse the repository at this point in the history
…al-colors

HopPicker: improve channel selection colors
  • Loading branch information
kaloudis authored Aug 21, 2023
2 parents 86a5a13 + 97c2928 commit c4b4824
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 90 deletions.
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

0 comments on commit c4b4824

Please sign in to comment.