Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
exam_12_Tsoy_Danil
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Цой Данил
exam_12_Tsoy_Danil
Commits
980ac969
Commit
980ac969
authored
Apr 15, 2023
by
Цой Данил
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more validation to check is user authorized
parent
3c04c854
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
UserGallery.tsx
frontend/src/containers/UserGallery/UserGallery.tsx
+3
-3
No files found.
frontend/src/containers/UserGallery/UserGallery.tsx
View file @
980ac969
...
@@ -40,7 +40,7 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
...
@@ -40,7 +40,7 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
const
{
photosByUser
,
targetedUser
}
=
useSelector
((
state
:
AppState
)
=>
state
.
photos
,
shallowEqual
)
const
{
photosByUser
,
targetedUser
}
=
useSelector
((
state
:
AppState
)
=>
state
.
photos
,
shallowEqual
)
const
{
user
}
=
useSelector
((
state
:
AppState
)
=>
state
.
users
,
shallowEqual
)
const
{
user
,
isAuth
}
=
useSelector
((
state
:
AppState
)
=>
state
.
users
,
shallowEqual
)
const
navigate
=
useNavigate
()
const
navigate
=
useNavigate
()
...
@@ -102,8 +102,8 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
...
@@ -102,8 +102,8 @@ export const UserGallery: React.FunctionComponent = (): React.ReactElement => {
</
Fade
>
</
Fade
>
</
Modal
>
</
Modal
>
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
}
>
<
h1
>
{
targetedUser
.
_id
===
user
?.
_id
?
'This is your gallery'
:
`${targetedUser.username}'s gallery`
}
</
h1
>
<
h1
>
{
isAuth
&&
targetedUser
.
_id
===
user
?.
_id
?
'This is your gallery'
:
`${targetedUser.username}'s gallery`
}
</
h1
>
{
targetedUser
.
_id
===
user
?.
_id
?
{
isAuth
&&
targetedUser
.
_id
===
user
?.
_id
?
<
Button
variant=
"contained"
size=
'medium'
onClick=
{
goToAddForm
}
>
<
Button
variant=
"contained"
size=
'medium'
onClick=
{
goToAddForm
}
>
Add Photo
Add Photo
</
Button
>
:
null
}
</
Button
>
:
null
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment