11import { useEffect , useRef , useState } from "react" ;
22import {
3- Box ,
43 FormGroup ,
54 FormControlLabel ,
65 Switch ,
76 TextField ,
87 Typography ,
9- Stack
8+ Paper ,
109} from "@mui/material" ;
1110import { enqueueSnackbar } from "notistack" ;
1211
1312function SlackIntegrationSnippet ( { app } ) {
1413 const inputRef = useRef ( null ) ;
1514 const url = `${ window . location . origin } /api/apps/${ app ?. uuid } /slack/run` ;
1615 return (
17- < Box >
18- < Typography sx = { { textAlign : "left" } } >
19- Copy the following URL in the Event Subscriptions Section in your Slack
20- App
16+ < Paper sx = { { padding : 2 } } >
17+ < Typography variant = "h5" sx = { { marginLeft : 0 } } >
18+ Slack Configuration
19+ </ Typography >
20+ < Typography sx = { { textAlign : "left" , marginBottom : 2 } } variant = "body1" >
21+ Copy and paste the following URL in the Event Subscriptions Section in
22+ your Slack App
2123 </ Typography >
2224 < TextField
2325 inputRef = { inputRef }
@@ -38,18 +40,21 @@ function SlackIntegrationSnippet({ app }) {
3840 Make sure to add app_mention scope in the Subscribe to bot events
3941 section
4042 </ Typography >
41- </ Box >
43+ </ Paper >
4244 ) ;
4345}
4446
4547function DiscordIntegrationSnippet ( { app } ) {
4648 const inputRef = useRef ( null ) ;
4749 const url = `${ window . location . origin } /api/apps/${ app ?. uuid } /discord/run` ;
4850 return (
49- < Box >
50- < Typography sx = { { textAlign : "left" } } >
51- Copy the following URL in the INTERACTIONS ENDPOINT URL Section in your
52- Discord App
51+ < Paper sx = { { padding : 2 } } >
52+ < Typography variant = "h5" sx = { { marginLeft : 0 } } >
53+ Discord Configuration
54+ </ Typography >
55+ < Typography sx = { { textAlign : "left" , marginBottom : 2 } } variant = "body1" >
56+ Copy and paste the following URL in the INTERACTIONS ENDPOINT URL
57+ Section in your Discord App
5358 </ Typography >
5459 < TextField
5560 inputRef = { inputRef }
@@ -70,7 +75,7 @@ function DiscordIntegrationSnippet({ app }) {
7075 Make sure to add bot scopes in the OAuth2 URL Generator section of your
7176 app.
7277 </ Typography >
73- </ Box >
78+ </ Paper >
7479 ) ;
7580}
7681
@@ -94,8 +99,11 @@ function WebIntegrationSnippet({ app }) {
9499 } , [ ] ) ;
95100
96101 return (
97- < Box >
98- < Typography sx = { { textAlign : "left" } } >
102+ < Paper sx = { { padding : 2 } } >
103+ < Typography variant = "h5" sx = { { marginLeft : 0 } } >
104+ Code Snippet
105+ </ Typography >
106+ < Typography sx = { { textAlign : "left" , marginBottom : 2 } } variant = "body1" >
99107 Copy the following code and paste it in your website body section to
100108 embed this app on your page.
101109 </ Typography >
@@ -130,24 +138,28 @@ function WebIntegrationSnippet({ app }) {
130138 />
131139 </ FormGroup >
132140 ) }
133- </ Box >
141+ </ Paper >
134142 ) ;
135143}
136144
137145function TwilioIntegrationSnippet ( { app } ) {
138146 const inputRef = useRef ( null ) ;
139147 const showTwilioVoiceUrl =
140148 app ?. twilio_config ?. use_twilio_transcription ||
141- app ?. twilio_config ?. voicemail_greeting ||
142- app ?. twilio_config ?. voicemail_length || false ;
149+ app ?. twilio_config ?. voicemail_greeting ||
150+ app ?. twilio_config ?. voicemail_length ||
151+ false ;
143152 const smsUrl = `${ window . location . origin } /api/apps/${ app ?. uuid } /twiliosms/run` ;
144153 const voiceUrl = `${ window . location . origin } /api/apps/${ app ?. uuid } /twiliovoice/run` ;
145154
146155 return (
147- < Stack >
148- < Typography sx = { { textAlign : "left" } } >
149- Copy the following URL in the Messaging Configuration URL Section in
150- your Twilio Phone Number
156+ < Paper sx = { { padding : 2 } } >
157+ < Typography variant = "h5" sx = { { marginLeft : 0 } } >
158+ Twilio Configuration
159+ </ Typography >
160+ < Typography sx = { { textAlign : "left" , marginBottom : 2 } } variant = "body1" >
161+ Copy and paste the following URL in the Messaging Configuration URL
162+ Section in your Twilio Phone Number
151163 </ Typography >
152164 < TextField
153165 inputRef = { inputRef }
@@ -164,6 +176,10 @@ function TwilioIntegrationSnippet({ app }) {
164176 enqueueSnackbar ( "Code copied successfully" , { variant : "success" } ) ;
165177 } }
166178 />
179+ < Typography sx = { { textAlign : "left !important" } } variant = "subtitle2" >
180+ This will be automatically done if you have selected "Create Twilio SMS
181+ Webhook" above
182+ </ Typography >
167183 { showTwilioVoiceUrl && (
168184 < div >
169185 < Typography sx = { { textAlign : "left" } } >
@@ -189,7 +205,7 @@ function TwilioIntegrationSnippet({ app }) {
189205 />
190206 </ div >
191207 ) }
192- </ Stack >
208+ </ Paper >
193209 ) ;
194210}
195211
0 commit comments