Commit e2fd31d3 authored by Цой Данил's avatar Цой Данил 💬

Changed sizes of modal window + fixxed bug where user can not properly look his own gallery

parent bba25780
......@@ -28,19 +28,6 @@ const Header: React.FunctionComponent = (): React.ReactElement => {
dispatch(setToInitState())
}
const handleListKeyDown = (event: React.KeyboardEvent): void => {
if (event.key === 'Tab') {
event.preventDefault();
setOpen(false);
} else if (event.key === 'Escape') {
setOpen(false);
}
}
const handleToggle = (): void => {
setOpen((prevOpen) => !prevOpen);
};
const navigateToPage = (page: string): void => {
setOpen(false)
navigate(`${page}`)
......@@ -59,7 +46,7 @@ const Header: React.FunctionComponent = (): React.ReactElement => {
return(
<div>
<header className={styles.Header}>
<header className={styles.Header}>
<div className={styles.Header_inner_container}>
<div className={styles.LinksBlock}>
<NavLink to={'/'}>
......
......@@ -20,11 +20,13 @@ const modalStyles = {
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 700,
maxWidth: 1000,
width: '100%',
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 1,
borderRadius: '5px'
};
const MainPage: React.FunctionComponent = (): React.ReactElement => {
......
......@@ -20,11 +20,13 @@ const modalStyles = {
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 700,
maxWidth: 1000,
width: '100%',
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 1,
borderRadius: '5px'
};
export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
......@@ -60,6 +62,7 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
useEffect(() => {
if (params.id) dispatch(getPhotosByUserId(params.id))
if (params.id && params.id === user?._id) dispatch(setTargetedUser(user))
}, [])
return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment