File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
packages/homepage/src/screens/home/hero Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { useEffect , useState } from 'react' ;
22import { motion } from 'framer-motion' ;
3+ import { useExperimentResult } from '@codesandbox/ab' ;
34
45import { HeroWrapper , Title , SubTitle } from './elements' ;
56import { CTATemplateAVersion } from './A-Version' ;
67import { ListTemplateBVersion } from './B-Version' ;
78
89export default ( ) => {
10+ const [ templateVersion , setTemplateVersion ] = useState ( undefined ) ;
11+ const experimentPromise = useExperimentResult ( 'dashboard-invite-members' ) ;
12+
13+ console . log ( templateVersion ) ;
14+
15+ useEffect ( ( ) => {
16+ /* Wait for the API */
17+ experimentPromise . then ( setTemplateVersion ) ;
18+ } , [ experimentPromise ] ) ;
19+
920 return (
1021 < HeroWrapper >
1122 < motion . div
@@ -26,8 +37,8 @@ export default () => {
2637 web development.
2738 </ SubTitle >
2839
29- < ListTemplateBVersion />
30- < CTATemplateAVersion />
40+ { templateVersion === 'A' && < CTATemplateAVersion /> }
41+ { templateVersion === 'B' && < ListTemplateBVersion /> }
3142 </ motion . div >
3243 </ HeroWrapper >
3344 ) ;
You can’t perform that action at this time.
0 commit comments