Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default () => {
const [isOpen, setIsOpen] = useState(false);
const { auth: { user } } = usePage();
const ref = useRef(null);
const closeDropdown = () => {
setIsOpen(false);
};
useClickAway(ref, closeDropdown);
const {
picture,
email,
full_name,
is_admin,
// username,
}: User = user;
return (
<div>
<button> setIsOpen(!isOpen)}
className="block h-10 w-10 rounded-full border-2 border-gray-200 overflow-hidden relative z-10"
>
</button></div>
const HeaderSearch = ({ onBlur, onSearch }) => {
const wrapperRef = useRef();
useClickAway(wrapperRef, onBlur);
useEscapeKey(onBlur);
return (
<div>
{({ currentValue, handleChange, handleSubmit }) => (
<>
</div>
currentSandbox: { customTemplate, template },
},
},
} = useOvermind();
const picker = useRef(null);
const [showPicker, setShowPicker] = useState(false);
const [selectedColor, setSelectedColor] = useState(
() => customTemplate.color || templates.default(template).color()
);
const colors = Object.keys(templates)
.filter(x => x !== 'default')
.map(t => templates[t])
.map(a => ({ color: a.color(), title: a.niceName }));
useClickAway(picker, () => {
setShowPicker(false);
editTemplate({
...customTemplate,
color: selectedColor,
});
});
return (
This is a template, you can find more info about templates{' '}
here
.
export default () => {
const [isOpen, setIsOpen] = useState(false);
const [show, setShow] = useState(false);
const [loader, setLoader] = useState(false);
const [query, setQuery] = useState('');
const [results, setResults] = useState([]);
const { auth } = usePage();
const input = useRef(null);
const ref = useRef(null);
const closeDropdown = () => {
setShow(false);
};
useClickAway(ref, closeDropdown);
const onKeyDown = (e: KeyboardEvent) => {
if (e.code === "Backslash") {
e.preventDefault();
if (input.current) {
const element = input.current;
element.focus();
}
}
};
function handleChange(e: React.ChangeEvent) {
const { value } = e.target;
setQuery(e.target.value);
if (value && value.length > 3) {