@@ -9,7 +9,7 @@ import CheckIcon from '@mui/icons-material/Check';
99import ConfirmationNumberIcon from '@mui/icons-material/ConfirmationNumber' ;
1010import DeleteIcon from '@mui/icons-material/Delete' ;
1111import LocalShippingIcon from '@mui/icons-material/LocalShipping' ;
12- import { Grid , Typography , useTheme } from '@mui/material' ;
12+ import { Grid , Typography , useTheme , Link , IconButton } from '@mui/material' ;
1313import { Box } from '@mui/system' ;
1414import { useState } from 'react' ;
1515import { useHistory } from 'react-router-dom' ;
@@ -30,14 +30,16 @@ import {
3030 undefinedPipe
3131} from '../../../utils/pipes' ;
3232import {
33- imagePreviewUrl ,
33+ imageDownloadUrl ,
34+ imageFileUrl ,
3435 isReimbursementRequestAdvisorApproved ,
3536 isReimbursementRequestSaboSubmitted
3637} from '../../../utils/reimbursement-request.utils' ;
3738import { routes } from '../../../utils/routes' ;
3839import AddSABONumberModal from './AddSABONumberModal' ;
3940import ReimbursementProductsView from './ReimbursementProductsView' ;
4041import SubmitToSaboModal from './SubmitToSaboModal' ;
42+ import DownloadIcon from '@mui/icons-material/Download' ;
4143
4244interface ReimbursementRequestDetailsViewProps {
4345 reimbursementRequest : ReimbursementRequest ;
@@ -145,7 +147,7 @@ const ReimbursementRequestDetailsView: React.FC<ReimbursementRequestDetailsViewP
145147 < Grid item xs = { 6 } textAlign = { 'center' } mt = { - 2 } >
146148 < Typography fontSize = { 50 } > Total Cost</ Typography >
147149 </ Grid >
148- < Grid xs = { 6 } mt = { - 2 } sx = { { display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } >
150+ < Grid xs = { 6 } mt = { - 2 } sx = { { display : 'flex' , alignItems : 'center' } } >
149151 < Typography fontSize = { 50 } > { `$${ centsToDollar ( reimbursementRequest . totalCost ) } ` } </ Typography >
150152 </ Grid >
151153 </ Grid >
@@ -172,14 +174,19 @@ const ReimbursementRequestDetailsView: React.FC<ReimbursementRequestDetailsViewP
172174 const ReceiptsView = ( ) => {
173175 return (
174176 < Box sx = { { maxHeight : `250px` , overflow : reimbursementRequest . receiptPictures . length > 0 ? 'auto' : 'none' } } >
175- < Typography variant = "h5" > Receipts</ Typography >
177+ < Box sx = { { position : 'sticky' , top : 0 , background : theme . palette . background . default , pb : 1 , zIndex : 1 } } >
178+ < Typography variant = "h5" > Receipts</ Typography >
179+ </ Box >
176180 { reimbursementRequest . receiptPictures . map ( ( receipt ) => {
177181 return (
178- < iframe
179- style = { { height : `200px` , width : '50%' } }
180- src = { imagePreviewUrl ( receipt . googleFileId ) }
181- title = { receipt . name }
182- />
182+ < Box sx = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'center' } } >
183+ < Link href = { imageFileUrl ( receipt . googleFileId ) } target = "_blank" underline = "hover" sx = { { mr : 1 , fontSize : 30 } } >
184+ { receipt . name }
185+ </ Link >
186+ < IconButton href = { imageDownloadUrl ( receipt . googleFileId ) } >
187+ < DownloadIcon sx = { { fontSize : 30 } } />
188+ </ IconButton >
189+ </ Box >
183190 ) ;
184191 } ) }
185192 </ Box >
0 commit comments