Skip to content

Commit

Permalink
Merge pull request #78 from makoto/detect_by_address
Browse files Browse the repository at this point in the history
Detect by address
  • Loading branch information
makoto authored Aug 27, 2017
2 parents 7e6026b + 3a9dd1a commit 4a3d04d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
22 changes: 18 additions & 4 deletions src/components/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@ import React from 'react';

let Data = [
{
name: 'CodeUp #21',
name: 'September Ethereum London Meetup at Imperial College',
address: null,
date:'Wednesday, September 13, 2017 6:45 PM to 9:00 PM(UTC+1)',
map_url: 'https://maps.google.com/maps?f=q&hl=en&q=Huxley+Building%2C+Imperial+College+%2C+London+SW7+2AZ%2C+gb',
location_text: 'Clore Lecture Theatre, Huxley Building, Imperial College, London (SW7 2AZ)',
description_text: ''
},
{
name: 'CodeUp #22',
address: null,
date:'Sep 7th (Thur) 6:30 PM(UTC+1)',
map_url: 'https://www.google.co.uk/maps/place/Simply+Business/@51.51528,-0.0904011,15z/data=!4m5!3m4!1s0x0:0x70f23f24baccffdc!8m2!3d51.51528!4d-0.0904011',
location_text: 'Simply Business (99 Gresham St, London EC2V 7NG)',
description_text: ''
},
{
name: 'CodeUp #21',
address: '0x97a6ec1ea5810388b6cb513b087e55a65c4bf417',
date:'Jun 22nd (Thur) 6:30 PM(UTC+1)',
map_url: 'https://www.google.co.uk/maps/place/Simply+Business/@51.51528,-0.0904011,15z/data=!4m5!3m4!1s0x0:0x70f23f24baccffdc!8m2!3d51.51528!4d-0.0904011',
location_text: 'Simply Business (99 Gresham St, London EC2V 7NG)',
description_text: ''
},
{
name: 'Edcon Post conference lunch',
// main:
// ropsten: 0x2a18b238aed745f923f954db65f7db45a4c41079
address: null,
address: '0x7b249881af36cccd1ab2e4325a8eed2a7848b263',
date:'Feb 19th (Sun) 12:30(UTC+1)',
map_url: 'https://www.google.co.uk/maps/place/Mama+Shelter+Paris/@48.8597157,2.4006691,17z/data=!4m5!3m4!1s0x47e66d8670ddcb91:0xb81d5c1e065c8167!8m2!3d48.8597122!4d2.4028631',
location_text: 'Mama Shelter Paris (109 Rue de Bagnolet, 75020 Paris)',
Expand Down
18 changes: 7 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,15 @@ window.onload = function() {
var Conference = TruffleContract(artifacts);
Conference.setProvider(provider);
Conference.setNetwork(network_id);
Data[0].address = Conference.address;
var contract = Conference.at(Conference.address);
let metadata;
let contractAddress = document.baseURI.split('#')[1]
if (contractAddress && contractAddress.length == 42) {
metadata = Data.filter(function(d){
return d.address == contractAddress
})[0];
}else{
contractAddress = Conference.address;

metadata = Data[0];
metadata = Data.filter(function(d){
return d.address == Conference.address;
})[0];
if (!metadata) {
metadata = Data[0]
metadata.address = Conference.address;
}
var contract = Conference.at(contractAddress);
window.contract = contract
window.web3 = web3
const eventEmitter = EventEmitter()
Expand Down

0 comments on commit 4a3d04d

Please sign in to comment.