add sync npub logic & change perms and activity history design & add delete app/perm requests
This commit is contained in:
23
src/hooks/useIsIOS.ts
Normal file
23
src/hooks/useIsIOS.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
/**
|
||||
* Custom hook to detect if the platform is iOS or not.
|
||||
* @returns {boolean} True if the platform is iOS, false otherwise.
|
||||
*/
|
||||
|
||||
const iOSRegex = /iPad|iPhone|iPod/
|
||||
|
||||
function useIsIOS() {
|
||||
const [isIOS, setIsIOS] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
const isIOSUserAgent =
|
||||
iOSRegex.test(navigator.userAgent) ||
|
||||
(navigator.userAgent.includes('Mac') && 'ontouchend' in document)
|
||||
setIsIOS(isIOSUserAgent)
|
||||
}, [])
|
||||
|
||||
return isIOS
|
||||
}
|
||||
|
||||
export default useIsIOS
|
||||
Reference in New Issue
Block a user