1
1
import React from 'react'
2
2
import PropTypes from 'prop-types'
3
- import { Button , Row , Col } from 'react-bootstrap'
3
+ import { Row , Col } from 'react-bootstrap'
4
4
import Image from '../../components/Image/Image'
5
+ import LinkedButton from '../LinkedButton/LinkedButton'
5
6
import TextBox from '../../components/TextBox/TextBox'
6
7
import Title from '../../components/Title/Title'
7
8
8
- const ItemPage = ( { title, titleStyle, description, descriptionStyle, img } ) => {
9
+ const ItemPage = ( { title, titleStyle, description, descriptionStyle, id , img, slug } ) => {
9
10
// sets a default width while still allowing width to be overridden
10
11
img = { width : 400 , ...img }
11
12
@@ -15,8 +16,11 @@ const ItemPage = ({ title, titleStyle, description, descriptionStyle, img }) =>
15
16
< Row className = 'mt-3' >
16
17
< Col xs = { 12 } md = { 6 } className = 'd-flex flex-column' >
17
18
< TextBox text = { description } style = { descriptionStyle } size = 'medium' />
18
- { /* TODO(summer-cook): Update this button's href so it is pointing at the item's form instead of blank request form */ }
19
- < Button href = '/requests/new' className = 'align-self-start mt-4' > Initiate Request</ Button >
19
+ < LinkedButton
20
+ addClass = 'align-self-start mt-4'
21
+ buttonProps = { { label : 'Initiate Request' } }
22
+ path = { { pathname : `/requests/new/${ slug } ` , query : { id } } }
23
+ />
20
24
</ Col >
21
25
< Col xs = { 12 } md = { 6 } className = 'mt-4 mt-md-0 me-md-auto d-flex justify-content-start justify-content-md-end' >
22
26
< Image { ...img } />
@@ -29,7 +33,9 @@ const ItemPage = ({ title, titleStyle, description, descriptionStyle, img }) =>
29
33
ItemPage . propTypes = {
30
34
description : PropTypes . string . isRequired ,
31
35
descriptionStyle : PropTypes . shape ( { } ) ,
36
+ id : PropTypes . string . isRequired ,
32
37
img : Image . defaultProps . isRequired ,
38
+ slug : PropTypes . string . isRequired ,
33
39
title : PropTypes . string . isRequired ,
34
40
titleStyle : PropTypes . shape ( { } ) ,
35
41
}
0 commit comments