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

Receive: add preset buttons for expiration time #1963

Merged
merged 3 commits into from
Feb 19, 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
13 changes: 7 additions & 6 deletions components/DropdownSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export default class DropdownSetting extends React.Component<
color: themeColor('text'),
backgroundColor: themeColor('secondary'),
...styles.field,
opacity: disabled ? 0.25 : 1
opacity: disabled ? 0.25 : 1,
top: 5,
height: 60
}}
dropdownIconColor={themeColor('text')}
enabled={!disabled}
Expand Down Expand Up @@ -125,7 +127,7 @@ export default class DropdownSetting extends React.Component<
style={{
position: 'absolute',
right: 10,
top: '33%'
top: '30%'
}}
>
<CaretDown
Expand All @@ -148,12 +150,11 @@ const styles = StyleSheet.create({
field: {
fontSize: 20,
width: '100%',
height: 55,
top: 10,
paddingTop: 15,
top: 8,
borderRadius: 6,
borderBottomWidth: 20,
marginBottom: 20,
paddingTop: 15,
borderBottomWidth: 20,
paddingLeft: 10,
overflow: 'hidden',
fontFamily: 'PPNeueMontreal-Book'
Expand Down
13 changes: 11 additions & 2 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
"views.Receive.memoPlaceholder": "A tribute to the gods",
"views.Receive.amount": "Amount",
"views.Receive.satoshis": "satoshis",
"views.Receive.expiration": "Expiration (in seconds)",
"views.Receive.expiration": "Expiration",
"views.Receive.customPreimage": "Custom preimage",
"views.Receive.createInvoice": "Create invoice",
"views.Receive.andSubmitTo": "and submit to",
Expand Down Expand Up @@ -1020,5 +1020,14 @@
"views.LspExplanationOverview.buttonText": "Learn more about wrapped invoices",
"views.Sweep.title": "Sweep on-chain wallet",
"views.Sweep.explainer": "Sweeping the on-chain wallet will send both the confirmed and unconfirmed balance to the destination address specified above.",
"pos.customItem": "Custom item"
"pos.customItem": "Custom item",
"time.seconds": "Seconds",
"time.minutes": "Minutes",
"time.hours": "Hours",
"time.days": "Days",
"time.weeks": "Weeks",
"time.10min": "10 min",
"time.1H": "1H",
"time.1D": "1D",
"time.1W": "1W"
}
12 changes: 12 additions & 0 deletions stores/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ interface InvoicesSettings {
addressType?: string;
memo?: string;
expiry?: string;
timePeriod?: string;
expirySeconds?: string;
routeHints?: boolean;
ampInvoice?: boolean;
showCustomPreimageField?: boolean;
Expand Down Expand Up @@ -735,6 +737,14 @@ export const AUTOMATIC_ATTESTATION_KEYS = [
}
];

export const TIME_PERIOD_KEYS = [
{ key: 'Seconds', translateKey: 'time.seconds', value: 'Seconds' },
{ key: 'Minutes', translateKey: 'time.minutes', value: 'Minutes' },
{ key: 'Hours', translateKey: 'time.hours', value: 'Hours' },
{ key: 'Days', translateKey: 'time.days', value: 'Days' },
{ key: 'Weeks', translateKey: 'time.weeks', value: 'Weeks' }
];

const STORAGE_KEY = 'zeus-settings';

export default class SettingsStore {
Expand Down Expand Up @@ -776,6 +786,8 @@ export default class SettingsStore {
addressType: '0',
memo: '',
expiry: '3600',
timePeriod: 'Seconds',
expirySeconds: '3600',
routeHints: false,
ampInvoice: false,
showCustomPreimageField: false
Expand Down
Loading
Loading