@@ -2,18 +2,19 @@ import { useEffect } from "react"
22import { shallowEqual } from 'react-redux'
33import { Helmet } from "react-helmet"
44
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"
77
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"
1314
1415const { actions } = activitiesSlice
1516
16- export default function Activities ( ) : JSX . Element {
17+ export default ( ) :JSX . Element => {
1718 const {
1819 loading,
1920 deployments,
@@ -40,6 +41,39 @@ export default function Activities(): JSX.Element {
4041
4142 return (
4243 < 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+ < >
4377 < Helmet >
4478 < title > Activities</ title >
4579 </ Helmet >
@@ -64,11 +98,11 @@ export default function Activities(): JSX.Element {
6498 </ div >
6599 < div style = { { marginTop : 30 , textAlign : "center" } } >
66100 < Pagination
67- page = { page }
68- isLast = { deployments . length !== perPage }
101+ disabledPrev = { disabledPrev }
102+ disabledNext = { disabledNext }
69103 onClickPrev = { onClickPrev }
70104 onClickNext = { onClickNext } />
71105 </ div >
72- </ Main >
106+ </ >
73107 )
74- }
108+ }
0 commit comments