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

fix: advanced button wording and behavior #390

Merged
merged 1 commit into from
Jul 11, 2022
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
11 changes: 5 additions & 6 deletions src/components/Earn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ const persistFormValues = (values) => {

const initialFormValues = (settings) => ({
offertype:
(settings.useAdvancedWalletMode && window.localStorage.getItem(FORM_INPUT_LOCAL_STORAGE_KEYS.offertype)) ||
FORM_INPUT_DEFAULT_VALUES.offertype,
window.localStorage.getItem(FORM_INPUT_LOCAL_STORAGE_KEYS.offertype) || FORM_INPUT_DEFAULT_VALUES.offertype,
feeRel:
parseFloat(window.localStorage.getItem(FORM_INPUT_LOCAL_STORAGE_KEYS.feeRel)) || FORM_INPUT_DEFAULT_VALUES.feeRel,
feeAbs:
Expand Down Expand Up @@ -94,7 +93,7 @@ export default function Earn() {
const reloadServiceInfo = useReloadServiceInfo()
const balanceSummary = useBalanceSummary(currentWalletInfo)

const [isAdvancedView, setIsAdvancedView] = useState(settings.useAdvancedWalletMode)
const [showAdvancedSettings, setShowAdvancedSettings] = useState(false)
const [alert, setAlert] = useState(null)
const [serviceInfoAlert, setServiceInfoAlert] = useState(null)
const [isLoading, setIsLoading] = useState(true)
Expand Down Expand Up @@ -346,17 +345,17 @@ export default function Earn() {
<rb.Button
variant={`${settings.theme}`}
className={`${styles['settings-btn']} d-flex align-items-center`}
onClick={() => setIsAdvancedView((current) => !current)}
onClick={() => setShowAdvancedSettings((current) => !current)}
>
{t('earn.button_settings')}
<Sprite
symbol={`caret-${isAdvancedView ? 'up' : 'down'}`}
symbol={`caret-${showAdvancedSettings ? 'up' : 'down'}`}
className="ms-1"
width="20"
height="20"
/>
</rb.Button>
{isAdvancedView && (
{showAdvancedSettings && (
<div className="my-4">
<rb.Form.Group className="mb-4 d-flex justify-content-center" controlId="offertype">
<SegmentedTabs
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"error_copy_address_failed": "Could not copy address.",
"button_copy_address": "Copy",
"text_copy_address_confirmed": "Copied",
"button_settings": "Advanced",
"button_settings": "More options",
"label_amount": "Amount to request in sats",
"feedback_invalid_amount": "Please provide a valid amount.",
"button_new_address": "Get new address",
Expand All @@ -235,7 +235,7 @@
"alert_stopping": "Service is stopping.",
"alert_running": "Earning sats...",
"alert_coinjoin_in_progress": "A collaborative transaction is currently in progress.",
"button_settings": "Advanced",
"button_settings": "More options",
"radio_abs_offer_label": "Absolute offer",
"radio_rel_offer_label": "Relative offer",
"label_rel_fee": "Relative fee {{ fee }}",
Expand Down