source: phonelux-frontend/src/components/CheaperOffersComponent/CheaperOffersComponent.js@ 48f3030

Last change on this file since 48f3030 was 48f3030, checked in by Marko <Marko@…>, 22 months ago

Implemented all use cases

  • Property mode set to 100644
File size: 2.1 KB
Line 
1import React, { Component } from 'react'
2import Box from '@mui/material/Box';
3import Modal from '@mui/material/Modal';
4import "./CheaperOffersComponent.css"
5import PhoneOfferComponent from '../PhoneOfferComponent/PhoneOfferComponent';
6import { Link } from 'react-router-dom';
7
8
9export class CheaperOffersComponent extends Component {
10constructor(props) {
11 super(props)
12
13 this.state = {
14
15 }
16}
17
18 render() {
19
20 return (
21 <div className='cheaperoffers-modal-main'>
22 <Modal
23 open={this.props.openModal}
24 onClose={this.props.handleClose}
25 aria-labelledby="cheaperoffers-modal-title"
26 aria-describedby="cheaperoffers-modal-description"
27 >
28 {
29 this.props.cheaperOffers.length > 0 ?
30 <Box className='cheaperoffers-modal-box'>
31 <table cellPadding={20} className='cheaperoffers-table'>
32 <thead className='cheaperoffers-table-head'>
33 <tr>
34 <th>Продавница</th>
35 <th>Име на понуда</th>
36 <th>Цена</th>
37 <th>Поевтина за</th>
38 <th></th>
39 </tr>
40 </thead>
41 <tbody>
42 {
43 this.props.cheaperOffers.map((offer,idx) =>
44 <tr key={idx} className='cheaperoffers-table-row'>
45 <td>{offer.offer_shop}</td>
46 <td><a href={offer.offer_url}>{offer.offer_name}</a></td>
47 <td>{offer.price} ден.</td>
48 <td><b>{this.props.openedOfferPrice-offer.price} ден.</b></td>
49 <td>
50 <Link style={{ textDecoration: 'none' }} to={"/phoneoffer/"+offer.id}>
51 <button className='phone-offer-specifications-button'>Спецификации</button>
52 </Link>
53 </td>
54 </tr>
55 )
56 }
57 </tbody>
58 </table>
59 </Box> : <h1 className='no-cheaper-offers-message'>Нема поевтини понуди</h1>
60 }
61 </Modal>
62 </div>
63 )
64 }
65}
66
67export default CheaperOffersComponent
68
69
Note: See TracBrowser for help on using the repository browser.