remove logs
This commit is contained in:
parent
cc3d138fd3
commit
8b92a780bf
2 changed files with 8 additions and 14 deletions
|
@ -83,23 +83,18 @@ export default function SignupCodesManagementPage({ authService }: SignupCodesMa
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const host = window.location.origin
|
const host = window.location.origin
|
||||||
const url = `${host}?c=${code}`
|
const url = `${host}?c=${code}`
|
||||||
navigator.clipboard.writeText(url)
|
navigator.clipboard.writeText(url).catch((err) => {
|
||||||
.then(() => {
|
console.error('Failed to copy:', err)
|
||||||
// Optional: Show a success message or notification
|
})
|
||||||
console.log('Copied to clipboard:', url)
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error('Failed to copy:', err)
|
|
||||||
})
|
|
||||||
setTooltipPosition(null)
|
setTooltipPosition(null)
|
||||||
setActiveCode(null)
|
setActiveCode(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showTooltip = (code: string, e: MouseEvent) => {
|
const showTooltip = (code: string, e: MouseEvent) => {
|
||||||
const rect = (e.currentTarget as HTMLElement).getBoundingClientRect()
|
const rect = (e.currentTarget as HTMLElement).getBoundingClientRect()
|
||||||
setTooltipPosition({
|
setTooltipPosition({
|
||||||
x: rect.left + rect.width / 2,
|
x: rect.left + rect.width / 2,
|
||||||
y: rect.top - 10
|
y: rect.top - 10,
|
||||||
})
|
})
|
||||||
setActiveCode(code)
|
setActiveCode(code)
|
||||||
}
|
}
|
||||||
|
@ -130,7 +125,7 @@ export default function SignupCodesManagementPage({ authService }: SignupCodesMa
|
||||||
{codes.map((code) => (
|
{codes.map((code) => (
|
||||||
<tr key={code.code} className="hover:bg-gray-50">
|
<tr key={code.code} className="hover:bg-gray-50">
|
||||||
<td className="py-2 ">
|
<td className="py-2 ">
|
||||||
<button
|
<button
|
||||||
className="bg-primary-100 px-2 py-1 rounded font-mono text-sm cursor-pointer hover:bg-primary-200 transition-colors"
|
className="bg-primary-100 px-2 py-1 rounded font-mono text-sm cursor-pointer hover:bg-primary-200 transition-colors"
|
||||||
onClick={(e) => copyCodeToClipboard(code.code, e)}
|
onClick={(e) => copyCodeToClipboard(code.code, e)}
|
||||||
onMouseEnter={(e) => showTooltip(code.code, e)}
|
onMouseEnter={(e) => showTooltip(code.code, e)}
|
||||||
|
@ -222,7 +217,7 @@ export default function SignupCodesManagementPage({ authService }: SignupCodesMa
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
{tooltipPosition && activeCode && (
|
{tooltipPosition && activeCode && (
|
||||||
<dialog
|
<dialog
|
||||||
open
|
open
|
||||||
className="fixed p-2 bg-gray-800 text-white text-xs rounded shadow-lg z-50"
|
className="fixed p-2 bg-gray-800 text-white text-xs rounded shadow-lg z-50"
|
||||||
style={{
|
style={{
|
||||||
|
|
|
@ -31,7 +31,6 @@ export function useUser(): User | null {
|
||||||
const [user, setUser] = useState(globalUser)
|
const [user, setUser] = useState(globalUser)
|
||||||
|
|
||||||
useMessageListener('user:updated', (u) => {
|
useMessageListener('user:updated', (u) => {
|
||||||
console.log('recieved user updated event')
|
|
||||||
setUser(u)
|
setUser(u)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue