11import  React ,  {  useEffect  }  from  'react' ; 
2- import  {  MigrationState  }  from  '../../../../api/migration-tool/migrator/migration-state.data' ; 
2+ import  { 
3+   MigrationState , 
4+   IS_HAVING_ISSUES , 
5+ }  from  '../../../../api/migration-tool/migrator/migration-state.data' ; 
36import  {  Carousel  }  from  '../carousel/carousel.component' ; 
47import  {  Slide1  }  from  '../carousel/slides/Slide1.component' ; 
58import  {  Slide2  }  from  '../carousel/slides/Slide2.component' ; 
69import  {  Slide3  }  from  '../carousel/slides/Slide3.component' ; 
710import  {  AlmostThere  }  from  '../almost-there/almost-there.component' ; 
811import  {  AllDone  }  from  '../all-done/all-done.component' ; 
912import  {  NoWallet  }  from  '../no-wallet/no-wallet.component' ; 
10- import  {  useColorModeValue ,  Flex  }  from  '@chakra-ui/react' ; 
13+ import  {  useColorModeValue ,  Flex ,   Link  }  from  '@chakra-ui/react' ; 
1114import  {  useFeatureFlagsContext  }  from  '../../../../features/feature-flags/provider' ; 
1215import  {  Events  }  from  '../../../../features/analytics/events' ; 
1316import  {  useCaptureEvent  }  from  '../../../../features/analytics/hooks' ; 
1417import  {  AnalyticsConsentModal  }  from  '../../../../features/analytics/ui/AnalyticsConsentModal' ; 
1518import  {  useAnalyticsContext  }  from  '../../../../features/analytics/provider' ; 
19+ import  {  storage  }  from  'webextension-polyfill' ; 
1620
1721export  const  MigrationView  =  ( { 
1822  migrationState, 
@@ -42,36 +46,42 @@ export const MigrationView = ({
4246  const  dismissibleSeconds  = 
4347    featureFlags ?. [ 'is-migration-active' ] ?. dismissInterval ; 
4448
49+   const  hasShowIssuesButton  = 
50+     featureFlags ?. [ 'show-having-issues-button' ]  ||  false ; 
51+ 
52+   const  handleHavingIssuesClick  =  ( )  =>  { 
53+     storage . local . set ( {  [ IS_HAVING_ISSUES ] : true  } ) ; 
54+     captureEvent ( Events . NamiMigrationHavingIssuesClick ) ; 
55+   } ; 
56+ 
4557  if  ( ! hasWallet )  { 
4658    captureEvent ( Events . MigrationViewNoWalletViewed ) ; 
4759    return  ( 
48-       < > < Flex 
49-         h = "100%" 
50-         backgroundColor = { panelBg } 
51-       > 
52-         < Flex 
53-           pt = "40px" 
54-           pb = "30px" 
55-           px = "40px" 
56-           borderTopRadius = '20px' 
57-           backgroundColor = { bgColor } 
58-           mt = '17px' 
59-           flexDirection = 'column' 
60-           h = 'calc(100% - 17px)' 
61-           w = "100%" 
62-         > 
63-           < NoWallet 
64-             isLaceInstalled = { isLaceInstalled } 
65-             onAction = { onNoWalletActionClick } 
66-             isDismissable = { isDismissable } 
67-             dismissibleSeconds = { dismissibleSeconds } 
68-           /> 
60+       < > 
61+         < Flex  h = "100%"  backgroundColor = { panelBg } > 
62+           < Flex 
63+             pt = "40px" 
64+             pb = "30px" 
65+             px = "40px" 
66+             borderTopRadius = "20px" 
67+             backgroundColor = { bgColor } 
68+             mt = "17px" 
69+             flexDirection = "column" 
70+             h = "calc(100% - 17px)" 
71+             w = "100%" 
72+           > 
73+             < NoWallet 
74+               isLaceInstalled = { isLaceInstalled } 
75+               onAction = { onNoWalletActionClick } 
76+               isDismissable = { isDismissable } 
77+               dismissibleSeconds = { dismissibleSeconds } 
78+             /> 
79+           </ Flex > 
6980        </ Flex > 
70-       </ Flex > 
71-       < AnalyticsConsentModal  
72-         askForConsent = { analytics . consent  ===  undefined } 
73-         setConsent = { setAnalyticsConsent } 
74-       /> 
81+         < AnalyticsConsentModal 
82+           askForConsent = { analytics . consent  ===  undefined } 
83+           setConsent = { setAnalyticsConsent } 
84+         /> 
7585      </ > 
7686    ) ; 
7787  } 
@@ -81,19 +91,16 @@ export const MigrationView = ({
8191    case  MigrationState . None :
8292      captureEvent ( Events . MigrationNoStartedViewed ) ; 
8393      return  ( 
84-         < Flex 
85-           h = "100%" 
86-           backgroundColor = { panelBg } 
87-         > 
94+         < Flex  h = "100%"  backgroundColor = { panelBg } > 
8895          < Flex 
8996            flexDirection = { 'column' } 
9097            pt = "40px" 
9198            pb = "30px" 
9299            px = "0px" 
93-             borderTopRadius = ' 20px' 
100+             borderTopRadius = " 20px" 
94101            backgroundColor = { bgColor } 
95-             mt = ' 17px' 
96-             h = ' calc(100% - 17px)' 
102+             mt = " 17px" 
103+             h = " calc(100% - 17px)" 
97104            w = "100%" 
98105          > 
99106            < Carousel  onSlideSwitched = { onSlideSwitched } > 
@@ -124,19 +131,16 @@ export const MigrationView = ({
124131      if  ( ! isLaceInstalled )  { 
125132        onWaitingForLaceScreenViewed ?. ( ) ; 
126133        return  ( 
127-           < Flex 
128-             h = "100%" 
129-             backgroundColor = { panelBg } 
130-           > 
134+           < Flex  h = "100%"  backgroundColor = { panelBg } > 
131135            < Flex 
132136              pt = "40px" 
133137              pb = "30px" 
134138              px = "40px" 
135-               borderTopRadius = ' 20px' 
139+               borderTopRadius = " 20px" 
136140              backgroundColor = { bgColor } 
137-               mt = ' 17px' 
138-               flexDirection = ' column' 
139-               h = ' calc(100% - 17px)' 
141+               mt = " 17px" 
142+               flexDirection = " column" 
143+               h = " calc(100% - 17px)" 
140144              w = "100%" 
141145            > 
142146              < AlmostThere 
@@ -151,19 +155,16 @@ export const MigrationView = ({
151155      }  else  { 
152156        onOpenLaceScreenViewed ?. ( ) ; 
153157        return  ( 
154-           < Flex 
155-             h = "100%" 
156-             backgroundColor = { panelBg } 
157-           > 
158+           < Flex  h = "100%"  backgroundColor = { panelBg } > 
158159            < Flex 
159160              pt = "40px" 
160161              pb = "30px" 
161162              px = "40px" 
162-               borderTopRadius = ' 20px' 
163+               borderTopRadius = " 20px" 
163164              backgroundColor = { bgColor } 
164-               mt = ' 17px' 
165-               flexDirection = ' column' 
166-               h = ' calc(100% - 17px)' 
165+               mt = " 17px" 
166+               flexDirection = " column" 
167+               h = " calc(100% - 17px)" 
167168              w = "100%" 
168169            > 
169170              < AlmostThere 
@@ -180,19 +181,16 @@ export const MigrationView = ({
180181    case  MigrationState . Completed :
181182      onAllDoneScreenViewed ?. ( ) ; 
182183      return  ( 
183-         < Flex 
184-           h = "100%" 
185-           backgroundColor = { panelBg } 
186-         > 
184+         < Flex  h = "100%"  backgroundColor = { panelBg } > 
187185          < Flex 
188186            pt = "40px" 
189187            pb = "30px" 
190188            px = "40px" 
191-             borderTopRadius = ' 20px' 
189+             borderTopRadius = " 20px" 
192190            backgroundColor = { bgColor } 
193-             mt = ' 17px' 
194-             flexDirection = ' column' 
195-             h = ' calc(100% - 17px)' 
191+             mt = " 17px" 
192+             flexDirection = " column" 
193+             h = " calc(100% - 17px)" 
196194            w = "100%" 
197195          > 
198196            < AllDone 
@@ -201,6 +199,15 @@ export const MigrationView = ({
201199                isLaceInstalled  ? onOpenLaceClicked  : onDownloadLaceClicked 
202200              } 
203201            /> 
202+             { hasShowIssuesButton  &&  ( 
203+               < Link 
204+                 textAlign = "center" 
205+                 marginTop = { 4 } 
206+                 onClick = { handleHavingIssuesClick } 
207+               > 
208+                 Having issues? Click here to continue using Nami
209+               </ Link > 
210+             ) } 
204211          </ Flex > 
205212        </ Flex > 
206213      ) ; 
0 commit comments