@@ -61,7 +61,7 @@ import {
61
61
} from './style' ;
62
62
import { getTwitterLink } from './lib' ;
63
63
import CodingMobile from './CodingMobile' ;
64
- import { BountyEstimates } from './Components' ;
64
+ import { BountyEstimates , SelfAssignButton } from './Components' ;
65
65
import CodingBountyProofModal from './CodingBountyProofModal' ;
66
66
let interval ;
67
67
@@ -123,7 +123,9 @@ function MobileView(props: CodingBountiesProps) {
123
123
isEditButtonDisable,
124
124
completed,
125
125
payment_failed,
126
- payment_pending
126
+ payment_pending,
127
+ stake_min,
128
+ is_stakable
127
129
} = props ;
128
130
const color = colors [ 'light' ] ;
129
131
@@ -147,6 +149,8 @@ function MobileView(props: CodingBountiesProps) {
147
149
const [ menuOpen , setMenuOpen ] = useState < number | null > ( null ) ;
148
150
const textareaRef = useRef < HTMLTextAreaElement > ( null ) ;
149
151
const bountyID = id ?. toString ( ) || '' ;
152
+ const [ showComingSoonModal , setShowComingSoonModal ] = useState ( false ) ;
153
+ const [ featureFlags , setFeatureFlags ] = useState < any > ( { } ) ;
150
154
151
155
useEffect ( ( ) => {
152
156
if ( textareaRef . current ) {
@@ -415,7 +419,7 @@ function MobileView(props: CodingBountiesProps) {
415
419
416
420
const makePayment = async ( ) => {
417
421
setPaymentLoading ( true ) ;
418
- // If the bounty has a commitment fee, add the fee to the user payment
422
+ // If the bounty has a commitment fee, add the fee to the user's payment
419
423
const price = Number ( props . price ) ;
420
424
// if there is an workspace and the workspace's
421
425
// buudget is sufficient keysend to the user immediately
@@ -717,6 +721,25 @@ function MobileView(props: CodingBountiesProps) {
717
721
let pillColor = color . statusAssigned ;
718
722
let pillText = 'assigned' ;
719
723
724
+ useEffect ( ( ) => {
725
+ const fetchFeatureFlags = async ( ) => {
726
+ try {
727
+ const response = await main . getFeatureFlags ( ) ;
728
+ if ( response ?. success ) {
729
+ setFeatureFlags (
730
+ response . data . reduce ( ( acc : any , flag : any ) => {
731
+ acc [ flag . name ] = flag . enabled ;
732
+ return acc ;
733
+ } , { } )
734
+ ) ;
735
+ }
736
+ } catch ( error ) {
737
+ console . error ( 'Error fetching feature flags:' , error ) ;
738
+ }
739
+ } ;
740
+ fetchFeatureFlags ( ) ;
741
+ } , [ main ] ) ;
742
+
720
743
if ( isMobile ) {
721
744
return (
722
745
< CodingMobile
@@ -847,6 +870,14 @@ function MobileView(props: CodingBountiesProps) {
847
870
/>
848
871
) }
849
872
873
+ { featureFlags . staking && is_stakable && (
874
+ < SelfAssignButton
875
+ onClick = { ( ) => setShowComingSoonModal ( true ) }
876
+ stakeMin = { stake_min || 0 }
877
+ EstimatedSessionLength = { props . estimated_session_length || '' }
878
+ />
879
+ ) }
880
+
850
881
{ isOpenProofModal && (
851
882
< CodingBountyProofModal
852
883
closeModal = { ( ) => setIsOpenProofModal ( false ) }
@@ -1291,6 +1322,13 @@ function MobileView(props: CodingBountiesProps) {
1291
1322
completion_date = { props . estimated_completion_date }
1292
1323
session_length = { props . estimated_session_length }
1293
1324
/>
1325
+ { featureFlags . staking && is_stakable && (
1326
+ < SelfAssignButton
1327
+ onClick = { ( ) => setShowComingSoonModal ( true ) }
1328
+ stakeMin = { stake_min || 0 }
1329
+ EstimatedSessionLength = { props . estimated_session_length || '' }
1330
+ />
1331
+ ) }
1294
1332
< div className = "buttonSet" >
1295
1333
< ButtonSet
1296
1334
githubShareAction = { ( ) => {
@@ -1889,6 +1927,13 @@ function MobileView(props: CodingBountiesProps) {
1889
1927
completion_date = { props . estimated_completion_date }
1890
1928
session_length = { props . estimated_session_length }
1891
1929
/>
1930
+ { featureFlags . staking && is_stakable && (
1931
+ < SelfAssignButton
1932
+ onClick = { ( ) => setShowComingSoonModal ( true ) }
1933
+ stakeMin = { stake_min || 0 }
1934
+ EstimatedSessionLength = { props . estimated_session_length || '' }
1935
+ />
1936
+ ) }
1892
1937
< ButtonSet
1893
1938
showGithubBtn = { ! ! ticket_url }
1894
1939
githubShareAction = { ( ) => {
@@ -1979,6 +2024,13 @@ function MobileView(props: CodingBountiesProps) {
1979
2024
completion_date = { props . estimated_completion_date }
1980
2025
session_length = { props . estimated_session_length }
1981
2026
/>
2027
+ { featureFlags . staking && is_stakable && (
2028
+ < SelfAssignButton
2029
+ onClick = { ( ) => setShowComingSoonModal ( true ) }
2030
+ stakeMin = { stake_min || 0 }
2031
+ EstimatedSessionLength = { props . estimated_session_length || '' }
2032
+ />
2033
+ ) }
1982
2034
< ButtonSet
1983
2035
showGithubBtn = { ! ! ticket_url }
1984
2036
githubShareAction = { ( ) => {
@@ -2002,6 +2054,61 @@ function MobileView(props: CodingBountiesProps) {
2002
2054
</ AssigneeProfile >
2003
2055
</ NormalUser >
2004
2056
) }
2057
+ { showComingSoonModal && (
2058
+ < Modal
2059
+ visible = { true }
2060
+ envStyle = { {
2061
+ borderRadius : '12px' ,
2062
+ background : color . pureWhite ,
2063
+ padding : '32px 24px' ,
2064
+ width : '400px' ,
2065
+ maxWidth : '90vw' ,
2066
+ boxShadow : '0px 8px 24px rgba(0, 0, 0, 0.1)'
2067
+ } }
2068
+ bigCloseImage = { ( ) => setShowComingSoonModal ( false ) }
2069
+ bigCloseImageStyle = { {
2070
+ top : '-12px' ,
2071
+ right : '-12px' ,
2072
+ background : color . pureWhite ,
2073
+ borderRadius : '50%' ,
2074
+ boxShadow : '0 2px 4px rgba(0, 0, 0, 0.1)' ,
2075
+ padding : '4px'
2076
+ } }
2077
+ >
2078
+ < div
2079
+ style = { {
2080
+ display : 'flex' ,
2081
+ flexDirection : 'column' ,
2082
+ alignItems : 'center' ,
2083
+ textAlign : 'center' ,
2084
+ gap : '16px'
2085
+ } }
2086
+ >
2087
+ < EuiText
2088
+ style = { {
2089
+ fontSize : '24px' ,
2090
+ fontWeight : 600 ,
2091
+ color : color . grayish . G100 ,
2092
+ marginBottom : '8px'
2093
+ } }
2094
+ >
2095
+ Staking Coming Soon!
2096
+ </ EuiText >
2097
+ < Button
2098
+ color = "primary"
2099
+ onClick = { ( ) => setShowComingSoonModal ( false ) }
2100
+ text = "Got It!"
2101
+ style = { {
2102
+ width : '120px' ,
2103
+ height : '40px' ,
2104
+ fontSize : '16px' ,
2105
+ fontWeight : 600 ,
2106
+ borderRadius : '8px'
2107
+ } }
2108
+ />
2109
+ </ div >
2110
+ </ Modal >
2111
+ ) }
2005
2112
< EuiGlobalToastList toasts = { toasts } dismissToast = { removeToast } toastLifeTimeMs = { 6000 } />
2006
2113
</ div >
2007
2114
) ;
0 commit comments