@@ -12,7 +12,8 @@ import { usePriceCarousel } from './nav/price-carousel'
1212
1313export const PriceContext = React . createContext ( {
1414 price : null ,
15- fiatSymbol : null
15+ fiatSymbol : null ,
16+ bigMacPrice : null
1617} )
1718
1819export function usePrice ( ) {
@@ -34,8 +35,9 @@ export function PriceProvider ({ price, children }) {
3435
3536 const contextValue = useMemo ( ( ) => ( {
3637 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 ] )
3941
4042 return (
4143 < PriceContext . Provider value = { contextValue } >
@@ -56,7 +58,7 @@ function AccessibleButton ({ id, description, children, ...props }) {
5658export default function Price ( { className } ) {
5759 const [ selection , handleClick ] = usePriceCarousel ( )
5860
59- const { price, fiatSymbol } = usePrice ( )
61+ const { price, fiatSymbol, bigMacPrice } = usePrice ( )
6062 const { height : blockHeight , halving } = useBlockHeight ( )
6163 const { fee : chainFee } = useChainFee ( )
6264
@@ -106,6 +108,15 @@ export default function Price ({ className }) {
106108 )
107109 }
108110
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+
109120 if ( selection === 'fiat' ) {
110121 if ( ! price || price < 0 ) return null
111122 return (
0 commit comments