|
@@ -1,10 +1,25 @@
|
|
|
-import React from 'react';
|
|
|
|
|
|
|
+import React, { useCallback } from 'react';
|
|
|
|
|
+
|
|
|
|
|
+import { useSearchModal } from '~/stores/modal';
|
|
|
|
|
|
|
|
import styles from './SearchButton.module.scss';
|
|
import styles from './SearchButton.module.scss';
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const SearchButton = (): JSX.Element => {
|
|
const SearchButton = (): JSX.Element => {
|
|
|
|
|
+
|
|
|
|
|
+ const { open: openSearchModal } = useSearchModal();
|
|
|
|
|
+
|
|
|
|
|
+ const searchButtonClickHandler = useCallback(() => {
|
|
|
|
|
+ openSearchModal();
|
|
|
|
|
+ }, [openSearchModal]);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
- <button type="button" className={`me-3 btn btn-search ${styles['btn-search']}`}>
|
|
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ className={`me-3 btn btn-search ${styles['btn-search']}`}
|
|
|
|
|
+ onClick={searchButtonClickHandler}
|
|
|
|
|
+ >
|
|
|
<span className="material-symbols-outlined">search</span>
|
|
<span className="material-symbols-outlined">search</span>
|
|
|
</button>
|
|
</button>
|
|
|
);
|
|
);
|