Skip to content

Commit abe4d95

Browse files
committed
update service button to have the correct path
1 parent 746bb50 commit abe4d95

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/compounds/ItemPage/ItemPage.jsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import { Button, Row, Col } from 'react-bootstrap'
3+
import { Row, Col } from 'react-bootstrap'
44
import Image from '../../components/Image/Image'
5+
import LinkedButton from '../LinkedButton/LinkedButton'
56
import TextBox from '../../components/TextBox/TextBox'
67
import Title from '../../components/Title/Title'
78

8-
const ItemPage = ({ title, titleStyle, description, descriptionStyle, img }) => {
9+
const ItemPage = ({ title, titleStyle, description, descriptionStyle, id, img, slug }) => {
910
// sets a default width while still allowing width to be overridden
1011
img = { width: 400, ...img }
1112

@@ -15,8 +16,11 @@ const ItemPage = ({ title, titleStyle, description, descriptionStyle, img }) =>
1516
<Row className='mt-3'>
1617
<Col xs={12} md={6} className='d-flex flex-column'>
1718
<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+
/>
2024
</Col>
2125
<Col xs={12} md={6} className='mt-4 mt-md-0 me-md-auto d-flex justify-content-start justify-content-md-end'>
2226
<Image {...img} />
@@ -29,7 +33,9 @@ const ItemPage = ({ title, titleStyle, description, descriptionStyle, img }) =>
2933
ItemPage.propTypes = {
3034
description: PropTypes.string.isRequired,
3135
descriptionStyle: PropTypes.shape({}),
36+
id: PropTypes.string.isRequired,
3237
img: Image.defaultProps.isRequired,
38+
slug: PropTypes.string.isRequired,
3339
title: PropTypes.string.isRequired,
3440
titleStyle: PropTypes.shape({}),
3541
}

0 commit comments

Comments
 (0)