diff --git a/components/footer.js b/components/footer.js index 7c043b79..1a8d645d 100644 --- a/components/footer.js +++ b/components/footer.js @@ -136,7 +136,7 @@ export default function Footer ({ noLinks }) { ? darkMode.toggle()} className='fill-grey theme' /> : darkMode.toggle()} className='fill-grey theme' />} } -
+
analytics diff --git a/components/form.js b/components/form.js index 233c28ad..97d67b53 100644 --- a/components/form.js +++ b/components/form.js @@ -430,20 +430,14 @@ export function SyncForm ({ ) } -export function Dropdown ({ label, items, groupClassName, ...props }) { - const [field, _, helper] = useField({ ...props, type: 'input' }) +export function Select ({ label, items, groupClassName, ...props }) { + const [field] = useField(props) + return ( - - - {field.value} - - - {items.map(item => ( - helper.setValue(item)}>{item} - ))} - - + + {items.map(item => )} + ) -} \ No newline at end of file +} diff --git a/components/price.js b/components/price.js index 4e4fb383..b1c4df41 100644 --- a/components/price.js +++ b/components/price.js @@ -11,12 +11,12 @@ export const PriceContext = React.createContext({ }) export const CURRENCY_SYMBOLS = { - 'AUD': '$', - 'CAD': '$', - 'EUR': '€', - 'GBP': '£', - 'USD': '$', - 'NZD': '$' + AUD: '$', + CAD: '$', + EUR: '€', + GBP: '£', + USD: '$', + NZD: '$' } const endpoint = (fiat) => `https://api.coinbase.com/v2/prices/BTC-${fiat ?? 'USD'}/spot` @@ -58,7 +58,7 @@ export default function Price () { }, []) const price = usePrice() const me = useMe() - const fiatSymbol = CURRENCY_SYMBOLS[me?.fiatCurrency || 'USD']; + const fiatSymbol = CURRENCY_SYMBOLS[me?.fiatCurrency || 'USD'] if (!price) return null diff --git a/pages/settings.js b/pages/settings.js index 61fed3d2..2f6d535e 100644 --- a/pages/settings.js +++ b/pages/settings.js @@ -1,4 +1,4 @@ -import { Checkbox, Form, Input, SubmitButton, Dropdown } from '../components/form' +import { Checkbox, Form, Input, SubmitButton, Select } from '../components/form' import * as Yup from 'yup' import { Alert, Button, InputGroup, Modal } from 'react-bootstrap' import LayoutCenter from '../components/layout-center' @@ -71,8 +71,8 @@ export default function Settings ({ data: { settings } }) { greeterMode: settings?.greeterMode }} schema={SettingsSchema} - onSubmit={async ({ tipDefault, fiatCurrency, ...values }) => { - await setSettings({ variables: { tipDefault: Number(tipDefault), fiatCurrency, ...values } }) + onSubmit={async ({ tipDefault, ...values }) => { + await setSettings({ variables: { tipDefault: Number(tipDefault), ...values } }) setSuccess('settings saved') }} > @@ -84,9 +84,10 @@ export default function Settings ({ data: { settings } }) { autoFocus append={sats} /> -