Skip to content

Commit

Permalink
feat: style images loaded from ipfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniolet committed Nov 23, 2021
1 parent c2e7090 commit 5bfc298
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
13 changes: 13 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"@testing-library/jest-dom": "^5.15.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"classnames": "^2.3.1",
"dotenv": "^10.0.0",
"ipfs-api": "^26.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-paginate": "^8.0.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2",
"web3": "^1.6.0"
Expand Down
12 changes: 10 additions & 2 deletions client/src/components/HotelItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ export default class HotelItem extends Component {
constructor(props) {
super(props);
this.state = {

rooms:[]
}
}

async componentWillMount(){

}

async fetcchRooms(){

}

render(){
return (
<div className="container">
<p>This div is for a single hotel Item</p>

</div>
)
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/HotelList.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export default class HotelList extends Component {
<div className="card-title">{ hotel.name }</div>
</div>
<div className="card-body">
<img src={`https://ipfs.infura.io/ipfs/${hotel.imageHash}`} alte="hotel image" style={{ width: '100%', height: '200px'}}></img>
<img src={`https://ipfs.infura.io/ipfs/${hotel.imageHash}`} alt="hotel image" style={{ width: '100%', height: '200px'}} className="mb-3 img-thumbnail"></img>
<p>Location: {hotel.locationAddress}</p>
<p>Descrition: {hotel.description}</p>
<p>Number Of Rooms: {hotel.totalRooms}</p>
<p>Published By: {hotel.user}</p>
<p>Hotel Type: {hotel.hotelCategory == 0 ? "Chain Hotel":""}</p>
<p>Image Hash: {hotel.imageHash}</p>
<button className="btn btn-success"> View </button>
<button className="btn btn-success"> View Rooms </button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/NewHotel.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class NewHotel extends Component {
).send({
from: account,
value: await web3.utils.toWei(fee.toString(),"ether"),
gas: 6721975,
gas: 6721975
}).then(( result) =>{
console.log("Image Hash after file upload",this.state.ipfsImageHash);
console.log(result);
Expand Down

0 comments on commit 5bfc298

Please sign in to comment.