0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-25 23:38:14 +00:00

renamed client to src

This commit is contained in:
Víctor Losada Hernández
2026-02-01 17:34:50 +01:00
parent 820160d0f5
commit c28736bd01
140 changed files with 0 additions and 0 deletions

View File

@@ -1,31 +0,0 @@
// Dialog box, for popups and modal blocking messages
import React from 'react';
const { useRef, useEffect } = React;
function Dialog({ dismisskeys = [], closeText = 'Close', blocking = false, ...rest }) {
const dialogRef = useRef(null);
useEffect(()=>{
blocking ? dialogRef.current?.showModal() : dialogRef.current?.show();
}, []);
const dismiss = ()=>{
dismisskeys.forEach((key)=>{
if(key) {
localStorage.setItem(key, 'true');
}
});
dialogRef.current?.close();
};
return (
<dialog ref={dialogRef} onCancel={dismiss} {...rest}>
{rest.children}
<button className='dismiss' onClick={dismiss}>
{closeText}
</button>
</dialog>
);
};
export default Dialog;