├── .DS_Store
├── .dependabot
└── config.yml
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── RELEASE-NOTES.md
├── dist
├── reactBundle.js
└── widget.js
├── example
├── .DS_Store
├── index.html
├── profile-hover.gif
├── react
│ ├── app.js
│ ├── bundle.js
│ └── index.html
└── server.js
├── package-lock.json
├── package.json
├── src
├── CopyButton.jsx
├── CopyButton_react.jsx
├── ProfileHover.jsx
├── html.jsx
├── style.less
├── utils.js
└── widget.js
├── webpack.config.js
└── webpack.example.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/3box/profile-hover/64ccb0880023ae72289741dca54a308d9fcabcbf/.DS_Store
--------------------------------------------------------------------------------
/.dependabot/config.yml:
--------------------------------------------------------------------------------
1 | version: 1
2 | update_configs:
3 | - package_manager: "javascript"
4 | target_branch: "develop"
5 | directory: "/"
6 | update_schedule: "weekly"
7 | default_reviewers:
8 | - "zachferland"
9 | default_assignees:
10 | - "zachferland"
11 | allowed_updates:
12 | - match:
13 | dependency_type: "production"
14 | update_type: "all"
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
3 | .idea
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | /example
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 3Box
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ⚠️ ⚠️ This project is no longer supported ⚠️ ⚠️
2 | > 3box.js and related tools built by 3Box Labs are deprecated and no loger supported. Developers are encurraged to build with https://ceramic.network which is a more secure and decentralized protocol for sovereign data.
3 |
4 | # Profile Hover
5 |
6 | `profile-hover` is a drop-in component that displays profile metadata for any ethereum address. Available in React and HTML/CSS versions.
7 |
8 | 
9 |
10 |
11 | ## Component Overview
12 | The Profile Hover consists of two components: the `Tile`, which is displayed on the page, and the `Hover`, which is displayed when the Tile is hovered. Profile Hover is available for React and HTML/CSS apps.
13 |
14 | ## Getting Started
15 |
16 | ### React Component
17 | Installation:
18 |
19 | ```shell
20 | npm i -S profile-hover
21 | ```
22 |
23 | Usage:
24 |
25 | ```jsx
26 | import ProfileHover from 'profile-hover';
27 |
28 | const MyComponent = () => ();
29 | ```
30 |
31 | ### HTML Element
32 |
33 | First add the script at the end of your page.
34 |
35 | ```html
36 |
37 | ```
38 |
39 | Then add the following tag where ever you display an address.
40 |
41 | ```html
42 |
43 | ```
44 |
45 | Additional Options:
46 |
47 | Add `data-display='full'` to show the entire address instead of the shorten display.
48 |
49 | ```html
50 |
51 | ```
52 |
53 | Add `data-theme='none'` to not use any of our address bar styling. Allows you to wrap any existing elements in an address hover.
54 |
55 | ```html
56 |
57 | ... your own html and styling
58 |
59 | ```
60 |
61 | ## How to Customize
62 | Here are the ways you can customize the profile hover to better suit your app's needs.
63 |
64 | ### Prop Types
65 |
66 | | Property | Type | Default | Component | Description |
67 | | :-------------------------------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68 | | `address` | String | | | `Address` property value is **required** to work. Provide an Ethereum address to this property to fetch profile information. |
69 | | `showName` | Boolean | False | Tile | Provide property `showName` to show the user's name from their 3Box profile instead of their Ethereum address.|
70 | | `url` | String | | Tile | Provide property `url` with url string to set where clicking on the Tile will redirect the user.|
71 | | `displayFull` | Boolean | False | Tile | Add `displayFull` property to show the entire address instead of the shortened display.|
72 | | `tileStyle` | Boolean | False | Tile | Add `tileStyle` property to render the tile component as a tile. |
73 | | `noTheme` | Boolean | False | Tile | Add `noTheme` property to not use any of our Tile styling. Allows you to wrap any existing elements in a Hover component. |
74 | | `noImgs` | Boolean | False | Hover | Add `noImgs` property to prevent displaying of profile image and cover image in the Hover. |
75 | | `noProfileImg` | Boolean | False | Hover | Add `noProfileImg` property to prevent displaying of just the profile image in the Hover. |
76 | | `noCoverImg` | Boolean | False | Hover | Add `noCoverImg` property to prevent displaying of just the cover image in the Hover. |
77 | | `orientation` | String | `'right'` | Hover | Provide property `orientation` with string `'top'`, `'bottom'`, `'right'` or `'left'` to set which way the Hover will pop up from the Tile.|
78 |
79 | #### Prop Types example
80 | ```jsx
81 |
87 | ```
88 | ```jsx
89 |
93 | ... your own html and styling
94 |
95 | ```
96 |
97 | ## Differences Between Desktop and Mobile
98 | Given the current state of Web3 mobile dapp browsers and their lack of browser tab support, the behavior of the profile-hover React component has minor differences depending on device context. On desktop web and web2 mobile browsers, out-bound links within the hover element work as usual and open a new tab. However on Web3 mobile dapp browsers, since tabs do not exist, clicking on a link within the hover component will, instead, copy that URL to a users clipboard.
99 |
100 | ## Maintainers
101 | [@zachferland](https://github.com/zachferland)
102 |
--------------------------------------------------------------------------------
/RELEASE-NOTES.md:
--------------------------------------------------------------------------------
1 | # Release Notes
2 |
3 | ## v1.1.2 - 2020-03-09
4 |
5 | * chore: update to 3box@1.17.1
6 |
7 | ## v1.1.1 - 2019-09-13
8 |
9 | * fix: return null for cover image if there isn't one
10 | * fix: more css rules for varying edge cases
11 |
12 | ## v1.0.2 - 2019-05-31
13 |
14 | * fix: align hover arrow
15 | * feat: adds option to display name instead of addess in tile
16 | * feat: additional tile style option and changes default
17 | * fix: catch missing cover img error
18 |
19 | ## v1.0.1 - 2019-05-30
20 | * Fix(CSS): tile sizing in mobile
21 |
22 | ## v1.0.0 - 2019-05-29
23 | * Support in React with a React component :tada: :zap: Huge thanks to @raksooo for making this happen!
24 | * A new redesigned hover and address bar. Along with much improved mobile support and new configuration options. Nice work by @oznekenzo :fire:
25 |
26 | ## v0.2.3 - 2019-04-26
27 | * Fix: Handle undefined website field
28 |
--------------------------------------------------------------------------------
/example/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/3box/profile-hover/64ccb0880023ae72289741dca54a308d9fcabcbf/example/.DS_Store
--------------------------------------------------------------------------------
/example/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |