File tree Expand file tree Collapse file tree 2 files changed +44
-32
lines changed Expand file tree Collapse file tree 2 files changed +44
-32
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useState , useEffect } from "react" ;
4- import { useGlobalConnect } from "./GlobalConnectProvider" ;
3+ import {
4+ useState ,
5+ useEffect ,
6+ } from "react" ;
7+ import {
8+ useGlobalConnect ,
9+ } from "./GlobalConnectProvider" ;
510
611export default function ConnectLinkDemo ( ) {
7- const { tokenData, appSlug, setAppSlug } = useGlobalConnect ( ) ;
8- const [ connectLinkUrl , setConnectLinkUrl ] = useState ( "" ) ;
12+ const {
13+ tokenData,
14+ appSlug,
15+ setAppSlug,
16+ } = useGlobalConnect ( ) ;
17+ const [
18+ connectLinkUrl ,
19+ setConnectLinkUrl ,
20+ ] = useState ( "" ) ;
921
1022 useEffect ( ( ) => {
1123 if ( tokenData ?. connect_link_url ) {
@@ -92,12 +104,12 @@ export default function ConnectLinkDemo() {
92104
93105 < div className = "mt-4 text-sm text-gray-600" >
94106 < p >
95- This URL contains a Connect Token that expires in 4 hours
107+ This URL contains a Connect Token that expires in 4 hours
96108 < strong > or after it's used once</ strong > .
97109 You can send this link to your users via email, SMS, or chat.
98110 </ p >
99111 < p className = "mt-2 text-xs text-gray-500" >
100- < strong > Note:</ strong > Connect tokens are single-use. After a successful connection,
112+ < strong > Note:</ strong > Connect tokens are single-use. After a successful connection,
101113 you'll need to generate a new token.
102114 </ p >
103115 </ div >
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import {
4- createContext ,
5- useContext ,
6- useState ,
7- useEffect
3+ import {
4+ createContext ,
5+ useContext ,
6+ useState ,
7+ useEffect ,
88} from "react" ;
99import { createFrontendClient } from "@pipedream/sdk/browser" ;
10- import {
11- getServerCodeSnippet ,
12- getClientCodeSnippet
10+ import {
11+ getServerCodeSnippet ,
12+ getClientCodeSnippet ,
1313} from "./ConnectCodeSnippets" ;
14- import {
15- generateConnectToken ,
16- fetchAccountDetails
14+ import {
15+ generateConnectToken ,
16+ fetchAccountDetails ,
1717} from "./api" ;
1818
1919/**
@@ -22,8 +22,8 @@ import {
2222function generateUUID ( ) {
2323 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" . replace ( / [ x y ] / g, function ( c ) {
2424 const r = Math . random ( ) * 16 | 0 ;
25- const v = c === "x"
26- ? r
25+ const v = c === "x"
26+ ? r
2727 : ( r & 0x3 | 0x8 ) ;
2828 return v . toString ( 16 ) ;
2929 } ) ;
@@ -38,32 +38,32 @@ const GlobalConnectContext = createContext(null);
3838export function GlobalConnectProvider ( { children } ) {
3939 // User and app state
4040 const [
41- appSlug ,
42- setAppSlug
41+ appSlug ,
42+ setAppSlug ,
4343 ] = useState ( "slack" ) ;
4444 const [
45- externalUserId ,
46- setExternalUserId
45+ externalUserId ,
46+ setExternalUserId ,
4747 ] = useState ( "" ) ;
4848 const [
49- connectedAccount ,
50- setConnectedAccount
49+ connectedAccount ,
50+ setConnectedAccount ,
5151 ] = useState ( null ) ;
5252
5353 // Token state
5454 const [
55- tokenData ,
56- setTokenData
55+ tokenData ,
56+ setTokenData ,
5757 ] = useState ( null ) ;
58-
58+
5959 // UI state
6060 const [
61- tokenLoading ,
62- setTokenLoading
61+ tokenLoading ,
62+ setTokenLoading ,
6363 ] = useState ( false ) ;
6464 const [
65- error ,
66- setError
65+ error ,
66+ setError ,
6767 ] = useState ( null ) ;
6868
6969 // Generate a new UUID when the component mounts
You can’t perform that action at this time.
0 commit comments