@@ -2,18 +2,19 @@ import { useEffect } from "react"
2
2
import { shallowEqual } from 'react-redux'
3
3
import { Helmet } from "react-helmet"
4
4
5
- import { useAppSelector , useAppDispatch } from "../redux/hooks"
6
- import { perPage , activitiesSlice , searchDeployments } from "../redux/activities"
5
+ import { useAppSelector , useAppDispatch } from "../../ redux/hooks"
6
+ import { perPage , activitiesSlice , searchDeployments } from "../../ redux/activities"
7
7
8
- import Main from "./Main"
9
- import SearchActivities from "../components/SearchActivities"
10
- import ActivityHistory from "../components/ActivityHistory"
11
- import Pagination from "../components/Pagination"
12
- import Spin from '../components/Spin'
8
+ import Main from "../main"
9
+ import SearchActivities , { SearchActivitiesProps } from "./SearchActivities"
10
+ import ActivityHistory , { ActivityHistoryProps } from "./ActivityHistory"
11
+ import Pagination , { PaginationProps } from "../../components/Pagination"
12
+ import Spin from "../../components/Spin"
13
+ import { deploy } from "../../redux/repoDeploy"
13
14
14
15
const { actions } = activitiesSlice
15
16
16
- export default function Activities ( ) : JSX . Element {
17
+ export default ( ) :JSX . Element => {
17
18
const {
18
19
loading,
19
20
deployments,
@@ -40,6 +41,39 @@ export default function Activities(): JSX.Element {
40
41
41
42
return (
42
43
< Main >
44
+ < Activities
45
+ onChangePeriod = { onChangePeriod }
46
+ onClickSearch = { onClickSearch }
47
+ loading = { loading }
48
+ deployments = { deployments }
49
+ disabledPrev = { page <= 1 }
50
+ disabledNext = { deployments . length != perPage }
51
+ onClickPrev = { onClickPrev }
52
+ onClickNext = { onClickNext }
53
+ />
54
+ </ Main >
55
+ )
56
+ }
57
+
58
+ interface ActivitiesProps extends SearchActivitiesProps , ActivityHistoryProps , PaginationProps {
59
+ loading : boolean
60
+ }
61
+
62
+ function Activities ( {
63
+ // Properties to search.
64
+ onChangePeriod,
65
+ onClickSearch,
66
+ // Properties for the deployment history.
67
+ loading,
68
+ deployments,
69
+ // Pagination for the pagination.
70
+ disabledPrev,
71
+ disabledNext,
72
+ onClickPrev,
73
+ onClickNext
74
+ } : ActivitiesProps ) : JSX . Element {
75
+ return (
76
+ < >
43
77
< Helmet >
44
78
< title > Activities</ title >
45
79
</ Helmet >
@@ -64,11 +98,11 @@ export default function Activities(): JSX.Element {
64
98
</ div >
65
99
< div style = { { marginTop : 30 , textAlign : "center" } } >
66
100
< Pagination
67
- page = { page }
68
- isLast = { deployments . length !== perPage }
101
+ disabledPrev = { disabledPrev }
102
+ disabledNext = { disabledNext }
69
103
onClickPrev = { onClickPrev }
70
104
onClickNext = { onClickNext } />
71
105
</ div >
72
- </ Main >
106
+ </ >
73
107
)
74
- }
108
+ }
0 commit comments