@@ -12,7 +12,8 @@ import { usePriceCarousel } from './nav/price-carousel'
12
12
13
13
export const PriceContext = React . createContext ( {
14
14
price : null ,
15
- fiatSymbol : null
15
+ fiatSymbol : null ,
16
+ bigMacPrice : null
16
17
} )
17
18
18
19
export function usePrice ( ) {
@@ -34,8 +35,9 @@ export function PriceProvider ({ price, children }) {
34
35
35
36
const contextValue = useMemo ( ( ) => ( {
36
37
price : data ?. price || price ,
37
- fiatSymbol : CURRENCY_SYMBOLS [ fiatCurrency ] || '$'
38
- } ) , [ data ?. price , price , me ?. privates ?. fiatCurrency ] )
38
+ fiatSymbol : CURRENCY_SYMBOLS [ fiatCurrency ] || '$' ,
39
+ bigMacPrice : data ?. bigMacPrice || 5.79
40
+ } ) , [ data ?. price , data ?. bigMacPrice , price , me ?. privates ?. fiatCurrency ] )
39
41
40
42
return (
41
43
< PriceContext . Provider value = { contextValue } >
@@ -56,7 +58,7 @@ function AccessibleButton ({ id, description, children, ...props }) {
56
58
export default function Price ( { className } ) {
57
59
const [ selection , handleClick ] = usePriceCarousel ( )
58
60
59
- const { price, fiatSymbol } = usePrice ( )
61
+ const { price, fiatSymbol, bigMacPrice } = usePrice ( )
60
62
const { height : blockHeight , halving } = useBlockHeight ( )
61
63
const { fee : chainFee } = useChainFee ( )
62
64
@@ -106,6 +108,15 @@ export default function Price ({ className }) {
106
108
)
107
109
}
108
110
111
+ if ( selection === 'bigmac' ) {
112
+ if ( ! price || price < 0 || ! bigMacPrice ) return null
113
+ return (
114
+ < AccessibleButton id = 'bigmac-hint' description = 'Show satoshis per Big Mac' className = { compClassName } onClick = { handleClick } variant = 'link' >
115
+ { fixedDecimal ( Math . round ( ( bigMacPrice / price ) * 100000000 ) , 0 ) } sats/Big Mac
116
+ </ AccessibleButton >
117
+ )
118
+ }
119
+
109
120
if ( selection === 'fiat' ) {
110
121
if ( ! price || price < 0 ) return null
111
122
return (
0 commit comments