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 => { ...@@ -28,19 +28,6 @@ const Header: React.FunctionComponent = (): React.ReactElement => {
dispatch(setToInitState()) 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 => { const navigateToPage = (page: string): void => {
setOpen(false) setOpen(false)
navigate(`${page}`) navigate(`${page}`)
...@@ -59,7 +46,7 @@ const Header: React.FunctionComponent = (): React.ReactElement => { ...@@ -59,7 +46,7 @@ const Header: React.FunctionComponent = (): React.ReactElement => {
return( return(
<div> <div>
<header className={styles.Header}> <header className={styles.Header}>
<div className={styles.Header_inner_container}> <div className={styles.Header_inner_container}>
<div className={styles.LinksBlock}> <div className={styles.LinksBlock}>
<NavLink to={'/'}> <NavLink to={'/'}>
......
...@@ -20,11 +20,13 @@ const modalStyles = { ...@@ -20,11 +20,13 @@ const modalStyles = {
top: '50%', top: '50%',
left: '50%', left: '50%',
transform: 'translate(-50%, -50%)', transform: 'translate(-50%, -50%)',
width: 700, maxWidth: 1000,
width: '100%',
bgcolor: 'background.paper', bgcolor: 'background.paper',
border: '2px solid #000', border: '2px solid #000',
boxShadow: 24, boxShadow: 24,
p: 1, p: 1,
borderRadius: '5px'
}; };
const MainPage: React.FunctionComponent = (): React.ReactElement => { const MainPage: React.FunctionComponent = (): React.ReactElement => {
......
...@@ -20,11 +20,13 @@ const modalStyles = { ...@@ -20,11 +20,13 @@ const modalStyles = {
top: '50%', top: '50%',
left: '50%', left: '50%',
transform: 'translate(-50%, -50%)', transform: 'translate(-50%, -50%)',
width: 700, maxWidth: 1000,
width: '100%',
bgcolor: 'background.paper', bgcolor: 'background.paper',
border: '2px solid #000', border: '2px solid #000',
boxShadow: 24, boxShadow: 24,
p: 1, p: 1,
borderRadius: '5px'
}; };
export const UserGallery: React.FunctionComponent = (): React.ReactElement => { export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
...@@ -60,6 +62,7 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => { ...@@ -60,6 +62,7 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
useEffect(() => { useEffect(() => {
if (params.id) dispatch(getPhotosByUserId(params.id)) if (params.id) dispatch(getPhotosByUserId(params.id))
if (params.id && params.id === user?._id) dispatch(setTargetedUser(user))
}, []) }, [])
return ( 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