@@ -476,90 +476,6 @@ export default function BBalnSlider({
476476 < Typography variant = { titleVariant } paddingRight = { '7px' } paddingBottom = { isSmallScreen ? '5px' : '0' } >
477477 { title } { ' ' }
478478 </ Typography >
479- < Typography padding = "0 3px 2px 0" style = { titleVariant === 'h4' ? { transform : 'translateY(1px)' } : { } } >
480- { simple ? (
481- < >
482- { earningPower &&
483- balnTotal ?. isGreaterThan ( 1 ) &&
484- ( numberOfPositions || dynamicBBalnAmount . isGreaterThan ( 0 ) || isAdjusting ) && (
485- < span style = { { marginRight : '8px' } } > { earningPower . toFixed ( 0 ) } %</ span >
486- ) }
487- < Tooltip
488- show = { showGlobalTooltip || tooltipHovered }
489- offset = { isSuperExtraSmallScreen ? [ 0 , 66 ] : isSmallScreen ? [ 0 , 40 ] : [ 0 , 10 ] }
490- text = {
491- < >
492- { ! isAdjusting && < EarningPowerTooltipContent /> }
493- { ( isAdjusting || numberOfPositions || dynamicBBalnAmount . isGreaterThan ( 0 ) ) && (
494- < Typography mt = { ! isAdjusting ? 3 : 0 } >
495- You have{ ' ' }
496- < strong >
497- { dynamicBBalnAmount . dp ( dynamicBBalnAmount . isGreaterThan ( 100 ) ? 0 : 2 ) . toFormat ( ) } bBALN
498- </ strong >
499- . { numberOfPositions ? maxRewardNoticeContent : '' }
500- </ Typography >
501- ) }
502- </ >
503- }
504- placement = "top"
505- forcePlacement = { true }
506- width = { 280 }
507- strategy = "absolute"
508- >
509- < QuestionWrapper
510- onMouseEnter = { ( ) => handleGlobalHover ( true ) }
511- onMouseLeave = { ( ) => handleGlobalHover ( false ) }
512- onTouchStart = { ( ) => handleGlobalHover ( true ) }
513- onTouchCancel = { ( ) => handleGlobalHover ( false ) }
514- style = { { transform : 'translateY(1px)' } }
515- >
516- < QuestionIcon width = { 14 } />
517- </ QuestionWrapper >
518- </ Tooltip >
519- </ >
520- ) : (
521- < >
522- < Tooltip
523- text = { maxRewardNoticeContent }
524- width = { 215 }
525- show = {
526- ! ! showMaxRewardsNotice &&
527- ! ! numberOfPositions &&
528- isAdjusting &&
529- maxRewardThreshold . isGreaterThan ( 0 )
530- }
531- placement = "top-start"
532- forcePlacement = { true }
533- strategy = "absolute"
534- offset = { [ - 18 , 20 ] }
535- >
536- { isAdjusting ? dynamicBBalnAmount . dp ( 2 ) . toFormat ( ) : bBalnAmount . dp ( 2 ) . toFormat ( ) }
537- </ Tooltip >
538- { ' bBALN' }
539- < QuestionHelper
540- text = {
541- < >
542- < Trans >
543- Lock up BALN to hold voting power and boost your earning potential by up to 2.5 x.
544- </ Trans >
545- < Typography mt = { 2 } >
546- < Trans >
547- The longer you lock up BALN, the more bBALN (Boosted BALN) you'll receive; the amount will
548- decrease over time.
549- </ Trans >
550- </ Typography >
551- { showMaxRewardsNotice && ! isAdjusting && numberOfPositions && (
552- < >
553- < Divider my = { 2 } />
554- < Typography fontWeight = { 700 } > { maxRewardNoticeContent } </ Typography >
555- </ >
556- ) }
557- </ >
558- }
559- />
560- </ >
561- ) }
562- </ Typography >
563479 </ Flex >
564480
565481 { stakedBalance ?. isEqualTo ( 0 ) && balnTotal ?. isGreaterThan ( 1 ) && (
@@ -601,153 +517,6 @@ export default function BBalnSlider({
601517 </ ButtonsWrap >
602518 ) }
603519 </ Flex >
604-
605- { stakedBalance ?. isGreaterThan ( 0 ) ? (
606- < UnstakePrompt stakedBalance = { stakedBalance } availableBalance = { balnBalanceAvailable } />
607- ) : balnTotal ?. isGreaterThan ( 1 ) ? (
608- < >
609- < SliderWrap sliderBg = { sliderBg } $sliderMargin = { sliderMargin } >
610- { lockupNotice && (
611- < Typography className = { `lockup-notice${ isAdjusting ? '' : ' show' } ` } > { lockupNotice } </ Typography >
612- ) }
613- { shouldShowLock && isAdjusting && (
614- < Box style = { { position : 'relative' } } >
615- { simple ? (
616- < StyledThreshold
617- position = { lockbarPercentPosition }
618- flipTextDirection = { lockbarPercentPosition < 50 }
619- >
620- < MetaData as = "dl" style = { { textAlign : 'right' } } >
621- < dd > Locked</ dd >
622- </ MetaData >
623- </ StyledThreshold >
624- ) : (
625- < Threshold position = { lockbarPercentPosition } flipTextDirection = { lockbarPercentPosition < 50 } >
626- < MetaData as = "dl" style = { { textAlign : 'right' } } >
627- < dd > Locked</ dd >
628- </ MetaData >
629- </ Threshold >
630- ) }
631- </ Box >
632- ) }
633-
634- < Box
635- margin = "10px 0"
636- className = { balnSliderAmount . isLessThan ( beforeBalnAmount ) ? 'withdraw-warning' : '' }
637- >
638- < Nouislider
639- disabled = { ! isAdjusting }
640- id = "slider-bbaln"
641- start = { [ Number ( lockedBalnAmount ?. toFixed ( 0 ) || 0 ) ] }
642- connect = { [ true , false ] }
643- step = { 1 }
644- range = { {
645- min : [ 0 ] ,
646- max : [ balnTotal ? balnTotal . dp ( 0 , BigNumber . ROUND_DOWN ) . toNumber ( ) : 1 ] ,
647- } }
648- instanceRef = { instance => {
649- if ( instance ) {
650- sliderInstance . current = instance ;
651- }
652- } }
653- onSlide = { onSlide }
654- />
655- </ Box >
656-
657- < Flex justifyContent = "space-between" flexWrap = { 'wrap' } marginTop = { isAdjusting ? '15px' : '' } >
658- < Flex alignItems = "center" >
659- { isAdjusting ? (
660- < BalnPreviewInput
661- type = "text"
662- disabled = { ! isAdjusting }
663- value = { balnSliderAmount . toNumber ( ) }
664- onChange = { handleBBalnInputChange }
665- />
666- ) : (
667- < Typography paddingRight = { '5px' } > { balnSliderAmount . toFormat ( ) } </ Typography >
668- ) }
669-
670- < Typography paddingRight = { '15px' } >
671- { ' ' }
672- / { balnTotal ? balnTotal . dp ( 0 , BigNumber . ROUND_DOWN ) . toFormat ( 0 ) : '-' } BALN
673- </ Typography >
674- </ Flex >
675-
676- { /* Show unlocked date */ }
677- { hasLockExpired && lockedBalnAmount ?. greaterThan ( 0 ) && ! isAdjusting && (
678- < Typography > { t `Available since ${ formatDate ( lockedUntil ) } ` } </ Typography >
679- ) }
680-
681- { /* Show selected or locked time period */ }
682- { ( bBalnAmount ?. isGreaterThan ( 0 ) || isAdjusting ) && (
683- < Typography paddingTop = { isAdjusting ? '5px' : '0' } >
684- { shouldBoost ? (
685- < >
686- { t `Locked until` } { ' ' }
687- { isAdjusting ? (
688- < >
689- < ClickAwayListener onClickAway = { closeDropdown } >
690- < div >
691- < UnderlineTextWithArrow
692- onClick = { handlePeriodDropdownToggle }
693- text = { formatDate (
694- getClosestUnixWeekStart (
695- new Date (
696- new Date ( ) . setDate ( new Date ( ) . getDate ( ) + ( selectedPeriod . weeks * 7 - 7 ) ) ,
697- ) . getTime ( ) ,
698- ) ,
699- ) }
700- arrowRef = { periodArrowRef }
701- />
702-
703- < DropdownPopper
704- show = { Boolean ( periodDropdownAnchor ) }
705- anchorEl = { periodDropdownAnchor }
706- placement = "bottom-end"
707- >
708- < MenuList >
709- { availablePeriods
710- . filter (
711- ( period , index ) =>
712- index === 0 || comparePeriods ( period , availablePeriods [ index - 1 ] ) !== 0 ,
713- )
714- . map ( period => (
715- < MenuItem
716- key = { period . weeks }
717- onClick = { ( ) => handleLockingPeriodChange ( period ) }
718- >
719- { period . name }
720- </ MenuItem >
721- ) ) }
722- </ MenuList >
723- </ DropdownPopper >
724- </ div >
725- </ ClickAwayListener >
726- </ >
727- ) : (
728- formatDate ( lockedUntil )
729- ) }
730- </ >
731- ) : (
732- isAdjusting && (
733- < Typography fontSize = { 14 } color = "#fb6a6a" >
734- { t `Pay a ${ getFormattedNumber (
735- earlyWithdrawPenalty || 0 ,
736- 'number2' ,
737- ) } BALN fee to unlock early.`}
738- </ Typography >
739- )
740- ) }
741- </ Typography >
742- ) }
743- </ Flex >
744- </ SliderWrap >
745- </ >
746- ) : (
747- < Typography fontSize = { 14 } opacity = { 0.75 } mt = { 6 } >
748- < Trans > Earn or buy BALN, then lock it up here to boost your rewards.</ Trans >
749- </ Typography >
750- ) }
751520 </ >
752521 ) : (
753522 < >
0 commit comments