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

ZEUS-2701: Wallets: better highlighting of active node #2702

Merged
merged 3 commits into from
Jan 9, 2025
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
2 changes: 1 addition & 1 deletion components/FeeBreakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export default class FeeBreakdown extends React.Component<
keyValue={localeString('views.Channel.peerStatus')}
value={
isActive
? localeString('views.Channel.active')
? localeString('general.active')
: localeString('views.Channel.inactive')
}
/>
Expand Down
3 changes: 1 addition & 2 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"general.count": "Count",
"general.experimental": "Experimental",
"general.defaultNodeNickname": "My Lightning Node",
"general.active": "Active",
"restart.title": "Restart required",
"restart.msg": "ZEUS has to be restarted before the new configuration is applied.",
"restart.msg1": "Would you like to restart now?",
Expand Down Expand Up @@ -402,7 +403,6 @@
"views.Channel.fundedBy": "Funded by",
"views.Channel.unannounced": "Unannounced",
"views.Channel.status": "Status",
"views.Channel.active": "Active",
"views.Channel.inactive": "Inactive",
"views.Channel.private": "Private",
"views.Channel.totalReceived": "Total Received",
Expand Down Expand Up @@ -834,7 +834,6 @@
"views.Settings.POS.Product.noProductsDefined": "No products defined yet",
"views.Settings.POS.Product.sku": "SKU",
"views.Settings.POS.Product.price": "Price",
"views.Settings.POS.Product.active": "Active",
"views.Settings.POS.saveProduct": "Save product",
"views.Settings.POS.deleteProduct": "Delete product",
"views.Settings.POS.confirmDelete": "Confirm delete",
Expand Down
2 changes: 1 addition & 1 deletion views/Channels/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export default class ChannelView extends React.Component<
: closeHeight
? localeString('views.Channel.closed')
: isActive
? localeString('views.Channel.active')
? localeString('general.active')
: localeString('views.Channel.inactive')}
</Text>
{channelId && (
Expand Down
4 changes: 1 addition & 3 deletions views/POS/ProductDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,7 @@ export default class ProductDetails extends React.Component<
left: -10
}}
>
{localeString(
'views.Settings.POS.Product.active'
)}
{localeString('general.active')}
</ListItem.Title>
<View
style={{
Expand Down
2 changes: 1 addition & 1 deletion views/PayCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class PayCodeView extends React.Component<
>
{error_msg && <ErrorMessage message={error_msg} />}
<KeyValue
keyValue={localeString('views.Channel.active')}
keyValue={localeString('general.active')}
value={
active
? localeString('general.true')
Expand Down
2 changes: 1 addition & 1 deletion views/PayCodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class PayCodes extends React.Component<PayCodesProps, {}> {
}}
>
{item.active
? localeString('views.Channel.active')
? localeString('general.active')
: localeString('views.Channel.inactive')}
</Text>
</View>
Expand Down
64 changes: 41 additions & 23 deletions views/Settings/Wallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,16 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
item,
index,
onDragStart,
onDragEnd,
isActive
onDragEnd
}: DragListRenderItemInfo<any>) => {
let nodeSubtitle = '';
if (
const nodeActive =
selectedNode === index ||
(!selectedNode && index === 0)
) {
nodeSubtitle = 'Active | ';
(!selectedNode && index === 0);
if (nodeActive) {
nodeSubtitle = `${localeString(
'general.active'
)} | `;
}

nodeSubtitle +=
Expand All @@ -234,8 +235,11 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
key={index}
style={{
borderBottomWidth: 0,
backgroundColor: isActive
? themeColor('highlight')
backgroundColor: nodeActive
? // match the LayerBalance sliders
themeColor(
'buttonBackground'
) || themeColor('secondary')
: 'transparent'
}}
onPress={async () => {
Expand Down Expand Up @@ -285,9 +289,13 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
<ListItem.Content>
<ListItem.Title
style={{
color: themeColor(
'text'
),
color: nodeActive
? themeColor(
'buttonText'
)
: themeColor(
'text'
),
fontFamily:
'PPNeueMontreal-Book'
}}
Expand All @@ -296,9 +304,13 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
</ListItem.Title>
<ListItem.Subtitle
style={{
color: themeColor(
'secondaryText'
),
color: nodeActive
? themeColor(
'buttonText'
)
: themeColor(
'secondaryText'
),
fontFamily:
'PPNeueMontreal-Book'
}}
Expand All @@ -315,9 +327,11 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
icon={{
name: 'settings',
size: 35,
color: themeColor(
'text'
)
color: nodeActive
? themeColor(
'buttonText'
)
: themeColor('text')
}}
onPress={() =>
navigation.navigate(
Expand All @@ -327,9 +341,7 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
item
),
index,
active:
selectedNode ===
index,
active: nodeActive,
saved: true
}
)
Expand All @@ -346,9 +358,15 @@ export default class Nodes extends React.Component<NodesProps, NodesState> {
)}
>
<DragDots
fill={themeColor(
'text'
)}
fill={
nodeActive
? themeColor(
'buttonText'
)
: themeColor(
'text'
)
}
width="30"
height="30"
style={{
Expand Down
Loading