mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-05 07:38:07 +01:00
feat(feedback): cut over to the FleetCrown embeddable widget
Swap the in-repo React suggestion widget (SuggestionButton) for the FleetCrown script-tag embed. Visitor feedback now lands in the FleetCrown project inbox (triage + dispatch-to-agent) instead of site_suggestions. data-fc-bottom=88 stacks the FAB above HirnPublicFab. The retired React widget files stay in place this commit for easy revert; the admin inbox and /api/suggestions remain for historical data. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac3b0a514a
commit
e08edb67f1
2 files changed
+36
-2
No files matched your search
@@ -0,0 +1,34 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect } from 'react'
|
||||
|
||||
const WIDGET_SRC = 'https://fleetcrown.orangecat.ch/widget.js'
|
||||
const PROJECT_TOKEN = 'fcw_45baa3d5c31f7cde10d65c168f6b9df9'
|
||||
/** Sits above HirnPublicFab (bottom-6 + h-14 ≈ 80px) so the two FABs stack. */
|
||||
const BOTTOM_OFFSET_PX = '88'
|
||||
|
||||
/**
|
||||
* FleetCrown embeddable feedback widget (revampit = customer #1).
|
||||
*
|
||||
* Replaces the in-repo React widget (SuggestionButton et al.): feedback now
|
||||
* flows into the FleetCrown project inbox where it can be dispatched to an
|
||||
* agent as a fix-task, instead of the local site_suggestions table. The token
|
||||
* is write-only and public by design; the server enforces an Origin allowlist
|
||||
* (www.revamp-it.ch / revamp-it.ch), so the widget renders on localhost but
|
||||
* submissions only succeed from prod.
|
||||
*/
|
||||
export function FleetCrownFeedbackEmbed() {
|
||||
useEffect(() => {
|
||||
if (document.querySelector(`script[src="${WIDGET_SRC}"]`)) return
|
||||
const script = document.createElement('script')
|
||||
script.src = WIDGET_SRC
|
||||
script.async = true
|
||||
script.setAttribute('data-fc-project', PROJECT_TOKEN)
|
||||
script.setAttribute('data-fc-bottom', BOTTOM_OFFSET_PX)
|
||||
document.body.appendChild(script)
|
||||
// No cleanup: the widget mounts once per page load and MainLayout wraps
|
||||
// every non-lean page, so unmount/remount churn would only flicker the FAB.
|
||||
}, [])
|
||||
|
||||
return null
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { ReactNode } from 'react'
|
||||
import { Header } from './header'
|
||||
import Footer from './Footer'
|
||||
import { HirnPublicFab } from '@/components/hirn/HirnPublicFab'
|
||||
import SuggestionButton from '@/components/feedback/SuggestionButton'
|
||||
import { FleetCrownFeedbackEmbed } from '@/components/feedback/FleetCrownFeedbackEmbed'
|
||||
|
||||
interface MainLayoutProps {
|
||||
children: ReactNode
|
||||
@@ -26,7 +26,7 @@ export default function MainLayout({ children, leanChrome = false }: MainLayoutP
|
||||
{!leanChrome && (
|
||||
<>
|
||||
<HirnPublicFab />
|
||||
<SuggestionButton />
|
||||
<FleetCrownFeedbackEmbed />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user