feat: use useragent method to alternative of isMac Method

This commit is contained in:
tzhangchi
2022-12-18 13:08:36 +08:00
parent 30dde6cb43
commit 6627444036
2 changed files with 78 additions and 61 deletions
@@ -12,12 +12,13 @@ import { Footer } from './footer';
import { Command } from 'cmdk';
import { useEffect, useState } from 'react';
import { useModal } from '@/providers/global-modal-provider';
import { getUaHelper } from '@/utils';
type TransitionsModalProps = {
open: boolean;
onClose: () => void;
};
const isMac = () => {
return /macintosh|mac os x/i.test(navigator.userAgent);
return getUaHelper().isMacOs;
};
export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
const [query, setQuery] = useState('');