Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw87AlenBolatov
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
Болатов Ален
hw87AlenBolatov
Commits
00b0ce0f
Commit
00b0ce0f
authored
Mar 25, 2023
by
Болатов Ален
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#8
showed albums on click
parent
84ad8c8b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
Albums.tsx
frontend/src/containers/Albums.tsx
+24
-0
No files found.
frontend/src/containers/Albums.tsx
View file @
00b0ce0f
import
React
,
{
useEffect
}
from
'react'
;
import
{
getAlbumsByQueryParams
}
from
'../features/album/albumSlice'
;
import
{
useAppDispatch
,
useAppSelector
}
from
'../store/hooks'
;
const
Albums
=
()
=>
{
const
{
albums
}
=
useAppSelector
((
state
)
=>
state
.
album
);
const
dispatch
=
useAppDispatch
();
const
params
=
new
URLSearchParams
(
window
.
location
.
search
);
const
artist
=
params
.
get
(
'artist'
);
useEffect
(()
=>
{
dispatch
(
getAlbumsByQueryParams
(
artist
!
));
},
[]);
return
(
<
div
>
{
albums
.
map
((
album
)
=>
{
return
<
div
key=
{
album
.
_id
}
>
{
album
.
name
}
</
div
>;
})
}
</
div
>
);
};
export
default
Albums
;
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