@@ -731,7 +731,7 @@ function changeAccordionButtonText(button, text) {
731731 button . textContent = text ;
732732}
733733
734- function showBuySellWidgets ( ) {
734+ function showBuyWidget ( ) {
735735
736736 var buyWidget = window . MoonPayWebSdk . init ( {
737737 flow : 'buy' ,
@@ -748,10 +748,30 @@ function showBuySellWidgets() {
748748 buyWidget . show ( ) ;
749749}
750750
751- function handlePageRedirect ( isBuyPage ) {
751+ function showSellWidget ( ) {
752+
753+ var sellWidget = window . MoonPayWebSdk . init ( {
754+ flow : 'sell' ,
755+ environment : 'production' ,
756+ containerNodeSelector : '.sell-widget' ,
757+ variant : 'embedded' ,
758+ params : {
759+ apiKey : 'pk_live_QWvwDl3WJAq7S8fDjsOUMfjn09DSw8R' ,
760+ theme : 'light' ,
761+ colorCode : '#FF9500'
762+ }
763+ } ) ;
764+
765+ sellWidget . show ( ) ;
766+ }
767+
768+ function handlePageRedirect ( isBuyPage , isSellPage ) {
752769 if ( isBuyPage === undefined ) {
753770 isBuyPage = false ;
754771 }
772+ if ( isSellPage === undefined ) {
773+ isSellPage = false ;
774+ }
755775
756776 $ . get ( '/cdn-cgi/trace' )
757777 . done ( function ( response ) {
@@ -771,20 +791,27 @@ function handlePageRedirect(isBuyPage) {
771791 if ( data . loc === 'GB' ) {
772792 window . location . href = '/' ;
773793 } else {
774- showBuySellWidgets ( ) ;
794+ showBuyWidget ( ) ;
795+ }
796+ } else if ( isSellPage ) {
797+ if ( data . loc === 'GB' ) {
798+ window . location . href = '/' ;
799+ } else {
800+ showSellWidget ( ) ;
775801 }
776802 } else {
777- if ( data . loc === 'GB' ) {
803+ if ( data . loc === 'GB' ) {
778804 $ ( '#buybitcoinbutton' ) . hide ( ) ;
779805 $ ( '#buybitcoinmenulink' ) . hide ( ) ;
780806 $ ( '#buybitcoinfootermenulink' ) . hide ( ) ;
781807 $ ( '#getstartedbuybutton' ) . hide ( ) ;
808+ $ ( '#sellbitcoinmenulink' ) . hide ( ) ;
809+ $ ( '#sellbitcoinfootermenulink' ) . hide ( ) ;
782810 }
783811 }
784812 } ) ;
785813}
786814
787-
788815function sortTableColumn ( selectedOption ) {
789816 var tableAccordion = document . getElementById ( 'tableAccordion' ) ;
790817 var tableAccordionButton = document . getElementById ( 'tableAccordionButton' ) ;
0 commit comments