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

Reworked Send screen logic #2008

Merged
merged 2 commits into from
Mar 3, 2024
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
15 changes: 11 additions & 4 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ interface HeaderProps {
placement?: 'left' | 'center' | 'right' | undefined;
navigation?: any;
onBack?: () => void;
navigateBackOnBackPress?: boolean;
}

function ZeusHeader(props: HeaderProps) {
const BackButton = (onBack?: () => void) => (
const BackButton = (
onBack?: () => void,
navigateBackOnBackPress?: boolean
) => (
<TouchableOpacity
onPress={() => {
if (onBack) onBack();
props.navigation.goBack();
if (navigateBackOnBackPress) {
props.navigation.goBack();
}
}}
accessibilityLabel={localeString('general.goBack')}
>
Expand Down Expand Up @@ -77,13 +83,14 @@ function ZeusHeader(props: HeaderProps) {
rightComponent,
containerStyle,
placement,
onBack
onBack,
navigateBackOnBackPress = true
} = props;
return (
<Header
leftComponent={
leftComponent === 'Back'
? BackButton(onBack)
? BackButton(onBack, navigateBackOnBackPress)
: leftComponent === 'Close'
? CloseButton(onBack)
: leftComponent
Expand Down
2 changes: 2 additions & 0 deletions components/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const TextInput: React.FC<TextInputProps> = (
? {
paddingTop: 10
}
: multiline
? {}
: {
height: 60
};
Expand Down
5 changes: 2 additions & 3 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
"general.yes": "Yes",
"general.no": "No",
"general.advanced": "Advanced",
"general.clearChanges": "Clear changes",
"general.destination": "Destination",
"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 @@ -492,7 +494,6 @@
"views.Payment.fee": "Fee",
"views.Payment.paymentHash": "Payment Hash",
"views.Payment.paymentPreimage": "Payment Preimage",
"views.Payment.destination": "Destination",
"views.Payment.creationDate": "Creation Date",
"views.Payment.path": "Path",
"views.Payment.paths": "Paths",
Expand All @@ -510,7 +511,6 @@
"views.PaymentRequest.timestamp": "Timestamp",
"views.PaymentRequest.expiry": "Expiry",
"views.PaymentRequest.cltvExpiry": "CLTV Expiry",
"views.PaymentRequest.destination": "Destination",
"views.PaymentRequest.paymentHash": "Payment Hash",
"views.PaymentRequest.mpp": "Attempt multi-path payment",
"views.PaymentRequest.amp": "Attempt atomic multi-path payment",
Expand Down Expand Up @@ -881,7 +881,6 @@
"views.ActivityFilter.minimumAmount": "Minimum Amount (sats)",
"views.ActivityFilter.inTransit": "In transit payments",
"views.ActivityFilter.isFailed": "Failed payments",
"general.clearChanges": "Clear changes",
"views.Routing.RoutingEvent.sourceChannel": "Source Channel",
"views.Routing.RoutingEvent.destinationChannel": "Destination Channel",
"views.Olympians.title": "Olympians",
Expand Down
3 changes: 1 addition & 2 deletions views/LnurlPay/LnurlPay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default class LnurlPay extends React.Component<
)
}}
>
{'):'}
{')'}
</Text>
</>
)}
Expand Down Expand Up @@ -312,7 +312,6 @@ export default class LnurlPay extends React.Component<
{localeString(
'views.LnurlPay.LnurlPay.comment'
) + ` (${lnurl.commentAllowed} char)`}
:
</Text>
<TextInput
value={comment}
Expand Down
2 changes: 1 addition & 1 deletion views/PaymentRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export default class PaymentRequest extends React.Component<
{!!destination && (
<KeyValue
keyValue={localeString(
'views.PaymentRequest.destination'
'general.destination'
)}
value={destination}
/>
Expand Down
Loading
Loading