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()
|
||||
const host = window.location.origin
|
||||
const url = `${host}?c=${code}`
|
||||
navigator.clipboard.writeText(url)
|
||||
.then(() => {
|
||||
// Optional: Show a success message or notification
|
||||
console.log('Copied to clipboard:', url)
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Failed to copy:', err)
|
||||
})
|
||||
navigator.clipboard.writeText(url).catch((err) => {
|
||||
console.error('Failed to copy:', err)
|
||||
})
|
||||
setTooltipPosition(null)
|
||||
setActiveCode(null)
|
||||
}
|
||||
|
||||
const showTooltip = (code: string, e: MouseEvent) => {
|
||||
const rect = (e.currentTarget as HTMLElement).getBoundingClientRect()
|
||||
setTooltipPosition({
|
||||
x: rect.left + rect.width / 2,
|
||||
y: rect.top - 10
|
||||
setTooltipPosition({
|
||||
x: rect.left + rect.width / 2,
|
||||
y: rect.top - 10,
|
||||
})
|
||||
setActiveCode(code)
|
||||
}
|
||||
|
@ -130,7 +125,7 @@ export default function SignupCodesManagementPage({ authService }: SignupCodesMa
|
|||
{codes.map((code) => (
|
||||
<tr key={code.code} className="hover:bg-gray-50">
|
||||
<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"
|
||||
onClick={(e) => copyCodeToClipboard(code.code, e)}
|
||||
onMouseEnter={(e) => showTooltip(code.code, e)}
|
||||
|
@ -222,7 +217,7 @@ export default function SignupCodesManagementPage({ authService }: SignupCodesMa
|
|||
</dialog>
|
||||
|
||||
{tooltipPosition && activeCode && (
|
||||
<dialog
|
||||
<dialog
|
||||
open
|
||||
className="fixed p-2 bg-gray-800 text-white text-xs rounded shadow-lg z-50"
|
||||
style={{
|
||||
|
|
|
@ -31,7 +31,6 @@ export function useUser(): User | null {
|
|||
const [user, setUser] = useState(globalUser)
|
||||
|
||||
useMessageListener('user:updated', (u) => {
|
||||
console.log('recieved user updated event')
|
||||
setUser(u)
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue