-
Notifications
You must be signed in to change notification settings - Fork 1
/
AddressList.js
78 lines (71 loc) · 1.89 KB
/
AddressList.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import React, { Component } from "react";
import { Alert, Button } from "react-bootstrap";
import glyphs from "./glyphs";
import blank from "./blank.png";
import knownAddresses from "./addressBook";
let scrollbox = {
overflowY: "scroll",
height: "500px"
};
const headerCaps = {
fontVariant: "small-caps"
};
export class AddressList extends Component {
glyphLookup(v) {
if (v === 0) {
return blank;
} else {
return glyphs()[v].src;
}
}
glyphNameLookup(v) {
return glyphs()[v].description;
}
render() {
return (
<Alert variant='dark'>
<Alert.Heading>
<div style={headerCaps}>Address List</div>
<hr />
</Alert.Heading>
<div style={scrollbox}>
{knownAddresses.map(({ value, label }) => {
return (
<Button variant='outline-dark' key={label} block>
<div className='d-flex justify-content-between'>
<div>
<b>{label}</b>
</div>
<div>
{value.map(e => {
return (
<img
src={this.glyphLookup(e)}
key={label + "-g" + value.indexOf(e)} //need to figure how this can be non-duplicating
alt={e}
width={20}
height={20}
/>
);
})}
</div>
</div>
</Button>
);
})}
</div>
</Alert>
);
}
}
export default AddressList;
// { glyphs.map(({id, src, description}) => {
// return <GlyphButton
// click={this.handleClick}
// gVal={id}
// key={id}
// imgSrc={src}
// glyphName={description}
// disabled={this.state.address.includes(id)}
// />
// })}