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
a6fa3afe
Commit
a6fa3afe
authored
Mar 27, 2023
by
Болатов Ален
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed set interavls
parent
a7046027
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
11 deletions
+36
-11
Preloader.tsx
frontend/src/components/UI/Preloader.tsx
+27
-0
Albums.tsx
frontend/src/containers/Albums.tsx
+1
-3
HomePage.tsx
frontend/src/containers/HomePage.tsx
+6
-5
Tracks.tsx
frontend/src/containers/Tracks.tsx
+1
-3
artistSlice.ts
frontend/src/features/artist/artistSlice.ts
+1
-0
No files found.
frontend/src/components/UI/Preloader.tsx
0 → 100644
View file @
a6fa3afe
import
React
from
'react'
;
const
Preloader
=
()
=>
{
return
(
<
div
role=
"status"
>
<
svg
aria
-
hidden=
"true"
className=
"w-8 h-8 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600"
viewBox=
"0 0 100 101"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
path
d=
"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill=
"currentColor"
/>
<
path
d=
"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill=
"currentFill"
/>
</
svg
>
<
span
className=
"sr-only"
>
Loading...
</
span
>
</
div
>
);
};
export
default
Preloader
;
frontend/src/containers/Albums.tsx
View file @
a6fa3afe
...
...
@@ -13,9 +13,7 @@ const Albums: React.FunctionComponent = (): React.ReactElement => {
const
navigate
=
useNavigate
();
useEffect
(()
=>
{
setInterval
(()
=>
{
dispatch
(
getAlbumsByQueryParams
(
artist
!
));
},
1000
);
dispatch
(
getAlbumsByQueryParams
(
artist
!
));
},
[
dispatch
]);
return
(
...
...
frontend/src/containers/HomePage.tsx
View file @
a6fa3afe
...
...
@@ -2,23 +2,24 @@ import React, {useEffect} from 'react';
import
{
getArtists
}
from
'../features/artist/artistSlice'
;
import
{
useAppDispatch
,
useAppSelector
}
from
'../store/hooks'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
Preloader
from
'../components/UI/Preloader'
;
const
HomePage
:
React
.
FunctionComponent
=
():
React
.
ReactElement
=>
{
const
{
artists
}
=
useAppSelector
((
state
)
=>
state
.
artist
);
const
{
artists
,
loading
}
=
useAppSelector
((
state
)
=>
state
.
artist
);
const
dispatch
=
useAppDispatch
();
const
navigate
=
useNavigate
();
useEffect
(()
=>
{
setInterval
(()
=>
{
dispatch
(
getArtists
());
},
1000
);
dispatch
(
getArtists
());
},
[
dispatch
]);
return
(
<
div
>
<
h2
className=
"mt-0 mb-2 text-4xl font-medium leading-tight "
>
Artists
</
h2
>
<
div
className=
"flex flex-wrap gap-10 justify-between "
>
{
artists
.
length
?
(
{
loading
?
(
<
Preloader
/>
)
:
artists
.
length
?
(
artists
.
map
((
artist
)
=>
{
return
(
<
div
key=
{
artist
.
_id
}
>
...
...
frontend/src/containers/Tracks.tsx
View file @
a6fa3afe
...
...
@@ -11,9 +11,7 @@ const Tracks: React.FunctionComponent = (): React.ReactElement => {
const
album
=
params
.
get
(
'album'
);
useEffect
(()
=>
{
setInterval
(()
=>
{
dispatch
(
getTracksByQuery
(
album
!
));
},
1000
);
dispatch
(
getTracksByQuery
(
album
!
));
},
[
dispatch
]);
return
(
...
...
frontend/src/features/artist/artistSlice.ts
View file @
a6fa3afe
...
...
@@ -34,6 +34,7 @@ export const artistSlice = createSlice({
getArtists
.
fulfilled
,
(
state
,
{
payload
}:
PayloadAction
<
IArtist
[]
>
)
=>
{
state
.
artists
=
payload
;
state
.
loading
=
false
;
}
);
},
...
...
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