@@ -14,6 +14,15 @@ const HubWrapper: React.FC = () => {
1414 const appUrl = import . meta. env . VITE_APP_URL ?? 'https://app.stackone.com' ;
1515 const [ theme , setTheme ] = useState < 'light' | 'dark' > ( 'light' ) ;
1616 const [ accountId , setAccountId ] = useState < string > ( ) ;
17+ const [ originOwnerId , setOriginOwnerId ] = useState < string > (
18+ import . meta. env . VITE_ORIGIN_OWNER_ID ?? 'dummy_customer_id' ,
19+ ) ;
20+ const [ originOwnerName , setOriginOwnerName ] = useState < string > (
21+ import . meta. env . VITE_ORIGIN_OWNER_NAME ?? 'dummy_customer_name' ,
22+ ) ;
23+ const [ originUsername , setOriginUsername ] = useState < string > (
24+ import . meta. env . VITE_ORIGIN_USERNAME ?? 'dummy_username' ,
25+ ) ;
1726
1827 const fetchToken = useCallback ( async ( ) => {
1928 try {
@@ -30,10 +39,9 @@ const HubWrapper: React.FC = () => {
3039 } ,
3140 body : {
3241 metadata : { source : 'hub' } ,
33- origin_owner_id : import . meta. env . VITE_ORIGIN_OWNER_ID ?? 'dummy_customer_id' ,
34- origin_owner_name :
35- import . meta. env . VITE_ORIGIN_OWNER_NAME ?? 'dummy_customer_name' ,
36- origin_username : import . meta. env . VITE_ORIGIN_USERNAME ?? 'dummy_username' ,
42+ origin_owner_id : originOwnerId ,
43+ origin_owner_name : originOwnerName ,
44+ origin_username : originUsername ,
3745 account_id : accountId !== '' && accountId != null ? accountId : undefined ,
3846 } ,
3947 } ) ;
@@ -48,7 +56,7 @@ const HubWrapper: React.FC = () => {
4856 } finally {
4957 setLoading ( false ) ;
5058 }
51- } , [ accountId ] ) ;
59+ } , [ accountId , originOwnerId , originOwnerName , originUsername ] ) ;
5260
5361 useEffect ( ( ) => {
5462 fetchToken ( ) ;
@@ -70,9 +78,57 @@ const HubWrapper: React.FC = () => {
7078 { theme === 'light' ? '🌞' : '🌚' }
7179 </ button >
7280 </ div >
73- < input type = "text" value = { accountId } onChange = { ( e ) => setAccountId ( e . target . value ) } />
81+ < input
82+ style = { {
83+ marginBottom : '10px' ,
84+ width : '100%' ,
85+ border : '1px solid #ccc' ,
86+ borderRadius : '5px' ,
87+ padding : '5px' ,
88+ } }
89+ type = "text"
90+ value = { accountId }
91+ onChange = { ( e ) => setAccountId ( e . target . value ) }
92+ />
93+ < input
94+ style = { {
95+ marginBottom : '10px' ,
96+ width : '100%' ,
97+ border : '1px solid #ccc' ,
98+ borderRadius : '5px' ,
99+ padding : '5px' ,
100+ } }
101+ type = "text"
102+ value = { originOwnerId }
103+ onChange = { ( e ) => setOriginOwnerId ( e . target . value ) }
104+ />
105+ < input
106+ style = { {
107+ marginBottom : '10px' ,
108+ width : '100%' ,
109+ border : '1px solid #ccc' ,
110+ borderRadius : '5px' ,
111+ padding : '5px' ,
112+ } }
113+ type = "text"
114+ value = { originOwnerName }
115+ onChange = { ( e ) => setOriginOwnerName ( e . target . value ) }
116+ />
117+ < input
118+ style = { {
119+ marginBottom : '10px' ,
120+ width : '100%' ,
121+ border : '1px solid #ccc' ,
122+ borderRadius : '5px' ,
123+ padding : '5px' ,
124+ } }
125+ type = "text"
126+ value = { originUsername }
127+ onChange = { ( e ) => setOriginUsername ( e . target . value ) }
128+ />
74129 < h1 > StackOneHub Demo</ h1 >
75130 < StackOneHub
131+ key = { token }
76132 mode = { mode }
77133 token = { token }
78134 baseUrl = { apiUrl }
0 commit comments