@@ -23,6 +23,7 @@ import {
23
23
} from "../store/actions/packageActions" ;
24
24
import ShowUserListDialog from "./showUserListDialog" ;
25
25
import ReportPackageForm from "./reportPackageForm" ;
26
+ import RatePackageForm from "./ratePackageForm" ;
26
27
import { Button } from "react-bootstrap" ;
27
28
import PackageRatingGraph from "./packageRatingGraph" ;
28
29
@@ -37,6 +38,7 @@ const PackagePage = () => {
37
38
const [ togglePackageMaintainersDialog , settogglePackageMaintainersDialog ] =
38
39
useState ( false ) ;
39
40
const [ showReportForm , setShowReportForm ] = useState ( false ) ;
41
+ const [ showRateForm , setRateForm ] = useState ( false ) ;
40
42
41
43
const handleIconsClick = ( value ) => {
42
44
if ( value === iconsActive ) {
@@ -123,7 +125,7 @@ const PackagePage = () => {
123
125
< MDBRow >
124
126
< MDBCol size = "9" > { data . description } </ MDBCol >
125
127
126
- { sideBar ( data , setShowReportForm ) }
128
+ { sideBar ( data , setShowReportForm , setRateForm ) }
127
129
</ MDBRow >
128
130
</ MDBContainer >
129
131
</ MDBTabsPane >
@@ -194,6 +196,12 @@ const PackagePage = () => {
194
196
</ MDBContainer >
195
197
</ MDBTabsPane >
196
198
</ MDBTabsContent >
199
+ < RatePackageForm
200
+ namespace = { namespace_name }
201
+ package = { package_name }
202
+ show = { showRateForm }
203
+ onHide = { ( ) => setRateForm ( false ) }
204
+ > </ RatePackageForm >
197
205
< ReportPackageForm
198
206
namespace = { namespace_name }
199
207
package = { package_name }
@@ -249,7 +257,7 @@ const ViewPackageMaintainersButton = ({
249
257
) ;
250
258
} ;
251
259
252
- const sideBar = ( data , setShowReportForm ) => {
260
+ const sideBar = ( data , setShowReportForm , setRateForm ) => {
253
261
return (
254
262
< MDBCol size = "3" >
255
263
< p style = { { fontSize : 16 , textAlign : "left" } } > Install</ p >
@@ -271,13 +279,22 @@ const sideBar = (data, setShowReportForm) => {
271
279
< p style = { { fontSize : 16 , textAlign : "left" } } > Last publish</ p >
272
280
{ updatedDays ( data . updated_at ) } days ago
273
281
< hr > </ hr >
274
- < Button
275
- variant = "danger"
276
- style = { { margin : 0 } }
277
- onClick = { ( ) => setShowReportForm ( true ) }
278
- >
279
- Report
280
- </ Button >
282
+ < div >
283
+ < Button
284
+ variant = "success"
285
+ style = { { margin : 0 } }
286
+ onClick = { ( ) => setRateForm ( true ) }
287
+ >
288
+ Rate
289
+ </ Button >
290
+ < Button
291
+ variant = "danger"
292
+ style = { { marginLeft : "4px" } }
293
+ onClick = { ( ) => setShowReportForm ( true ) }
294
+ >
295
+ Report
296
+ </ Button >
297
+ </ div >
281
298
</ MDBCol >
282
299
) ;
283
300
} ;
0 commit comments