import React, { Component } from 'react' import axios from 'axios' import './PhoneOfferDetailsComponent.css' import HeaderComponent from '../HeaderComponent/HeaderComponent' import UserContext from '../../context/UserContext' import { Link } from 'react-router-dom' export class PhoneOfferDetailsComponent extends Component { constructor(props) { super(props) this.state = { offerId: window.location.href.split('/')[4], offer: null } } componentDidMount(){ axios.get('/phoneoffer/'+this.state.offerId) .then(response => { this.setState({ offer: response.data }) }).catch(error => console.log(error)) } render() { return (

Последно ажурирана: {this.state.offer == null || this.state.offer.last_updated == null ? '#' : this.state.offer.last_updated.split('T')[0]}

{ localStorage.getItem('token') && (this.context.role == 'ADMIN' || this.context.role == 'SUPERADMIN') ?

Измени понуда

: <> }
Детали за понудата
Понуда{this.state.offer == null || this.state.offer.offer_name == null ? '/' : this.state.offer.offer_name}
Продавница{this.state.offer == null || this.state.offer.offer_shop == null ? '/' : this.state.offer.offer_shop}
Цена{this.state.offer == null || this.state.offer.price == null ? '/' : this.state.offer.price+' ден.'}
Предна камера{this.state.offer == null || this.state.offer.front_camera == null ? '/' : this.state.offer.front_camera}
Задна камера{this.state.offer == null || this.state.offer.back_camera == null ? '/' : this.state.offer.back_camera}
РОМ меморија{this.state.offer == null || this.state.offer.rom_memory == null ? '/' : this.state.offer.rom_memory}
РАМ меморија{this.state.offer == null || this.state.offer.ram_memory == null ? '/' : this.state.offer.ram_memory}
Оперативен систем{this.state.offer == null || this.state.offer.operating_system == null ? '/' : this.state.offer.operating_system}
Чипсет{this.state.offer == null || this.state.offer.chipset == null ? '/' : this.state.offer.chipset}
Процесор{this.state.offer == null || this.state.offer.cpu == null ? '/' : this.state.offer.cpu}
Батерија{this.state.offer == null || this.state.offer.battery == null ? '/' : this.state.offer.battery}
Боја{this.state.offer == null || this.state.offer.color == null ? '/' : this.state.offer.color}
Опис{this.state.offer == null || this.state.offer.offer_description == null ? '/' : this.state.offer.offer_description}
) } } PhoneOfferDetailsComponent.contextType = UserContext export default PhoneOfferDetailsComponent