-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow customers to send feedback (#811)
We have two requirements: - receive messages in #feedback - allow users to send screenshots Ideally we'd also be able to chat with users on the page, by just replying on the slack thread, but that requirement seems to be mutually exclusive with taking screenshots Tried so many **** vendors that did not work... even hubspot's didn't work out of the box like this one did. More vendors discussed in https://www.notion.so/gloochat/live-feedback-in-app-tool-4426a1fc381242958804697f7c753882?pvs=4
- Loading branch information
Showing
5 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { useEffect } from 'react' | ||
|
||
const loadDoorbell = () => { | ||
;(window as any).doorbellOptions = { | ||
id: '14262', | ||
appKey: '4coKRb0R5AVhGfyJOuDm45GYC7NsD8uQUfe5x2zNHEh2FYTZhQxks1l1d0kyWHsC', | ||
} | ||
;(function (w: any, d, t) { | ||
var hasLoaded = false | ||
function l() { | ||
if (hasLoaded) { | ||
return | ||
} | ||
hasLoaded = true | ||
;(window as any).doorbellOptions.windowLoaded = true | ||
var g = d.createElement(t) as any | ||
g.id = 'doorbellScript' | ||
g.type = 'text/javascript' | ||
g.crossorigin = 'anonymous' | ||
g.async = true | ||
g.src = 'https://embed.doorbell.io/button/' + (window as any).doorbellOptions['id'] + '?t=' + new Date().getTime() | ||
;(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(g) | ||
} | ||
if (w.attachEvent) { | ||
w.attachEvent('onload', l) | ||
} else if (w.addEventListener) { | ||
w.addEventListener('load', l, false) | ||
} else { | ||
l() | ||
} | ||
if (d.readyState == 'complete') { | ||
l() | ||
} | ||
})(window, document, 'script') | ||
} | ||
|
||
const loadSignalZen = () => { | ||
var _sz = (_sz || {}) as any | ||
;(_sz.appId = '03fb7e7f'), | ||
(function () { | ||
var e = document.createElement('script') | ||
;(e.src = 'https://cdn.signalzen.com/signalzen.js'), | ||
e.setAttribute('async', 'true'), | ||
document.documentElement.firstChild?.appendChild(e) | ||
var t = setInterval(function () { | ||
const SignalZen = (window as any).SignalZen | ||
'undefined' != typeof SignalZen && (clearInterval(t), new SignalZen(_sz).load()) | ||
}, 10) | ||
})() | ||
} | ||
|
||
const loadSmallChat = () => { | ||
const e = document.createElement('script') | ||
e.src = 'https://embed.small.chat/T03KV1PH19PC07DA5G14HY.js' | ||
e.setAttribute('async', 'true') | ||
document.documentElement.firstChild?.appendChild(e) | ||
} | ||
|
||
export const useFeedbackWidget = () => { | ||
useEffect(() => { | ||
loadDoorbell() | ||
// loadSignalZen() | ||
// loadSmallChat() | ||
}, []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters