-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1876 from daostack/release
Release 0.10.11
- Loading branch information
Showing
23 changed files
with
623 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Optional: please provide the following if you find it relevant:** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
contact_links: | ||
- name: Support request | ||
url: https://t.me/joinchat/AUo-qA7EQURSFhru0WqvVg | ||
about: Ask the community in the support channel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import axios from "axios"; | ||
|
||
const DEFAULT_ENDPOINT = "https://daostack.buidlhub.com/register"; | ||
|
||
export interface IBuidlhubClient { | ||
endpoint: string; | ||
register(props: any): any; | ||
} | ||
|
||
export default class BuidlhubClient implements IBuidlhubClient { | ||
endpoint: string; | ||
|
||
constructor(props: any = {}) { | ||
const endpoint: string = props.endpoint || DEFAULT_ENDPOINT; | ||
this.endpoint = endpoint; | ||
|
||
} | ||
|
||
async register(props: any = {}) { | ||
this._validatePropsExist(props, ["email", "walletAddress"]); | ||
|
||
const { email, walletAddress } = props; | ||
|
||
const r = await this._post( { | ||
walletAddress, | ||
email, | ||
}); | ||
return r; | ||
} | ||
|
||
private _validatePropsExist(props: any, requiredProps: any) { | ||
for (const propertyName of requiredProps) { | ||
const propertyValue = props[propertyName]; | ||
if (!propertyValue) { | ||
throw new Error(`${propertyName} is required`); | ||
} | ||
} | ||
} | ||
|
||
async _post(body: any) { | ||
const url: string = this.endpoint; | ||
|
||
const options = { | ||
method: "POST", | ||
headers: { | ||
"Accept": "application/json", | ||
"Content-Type": "application/json;charset=UTF-8", | ||
"x-referrer": window?.location?.hostname, | ||
}, | ||
data: JSON.stringify(body), | ||
}; | ||
|
||
const r = await this._fetchWithRetry(url, options); | ||
const data: any = r.data;//response.json(); | ||
|
||
if (data.error) { | ||
throw new Error(data.error); | ||
} | ||
|
||
return {data}; | ||
} | ||
|
||
async _fetchWithRetry(url: string, options: any, maxAttempts = 3) { | ||
let lastError = null; | ||
for (let i = 0; i < maxAttempts; i++) { | ||
try { | ||
return await axios(url, options); //fetch(url, options); | ||
} catch (error) { | ||
lastError = error; | ||
} | ||
|
||
// sleep before retry | ||
await new Promise(resolve => setTimeout(resolve, 250)); | ||
} | ||
throw lastError; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
.bhubRegContainer { | ||
width: 100% !important; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-content: flex-start; | ||
align-items: flex-start; | ||
padding: 10px; | ||
|
||
|
||
.bhubIcon { | ||
width: 100% !important; | ||
display: flex; | ||
text-align: left; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
padding: 0 !important; | ||
margin-left: -40px !important; | ||
} | ||
|
||
.inputWrapper { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
|
||
.emailInput { | ||
border-radius: 5px; | ||
height: 30px !important; | ||
padding: 5px; | ||
border: 1px solid #aaa; | ||
margin-right: 5px !important; | ||
} | ||
|
||
|
||
.sendButtonWrapper { | ||
height: 30px; | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
.sendButton { | ||
background-color: rgba(104, 155, 214, 1); | ||
border: 1px solid #333; | ||
border-radius: 5px; | ||
color: white; | ||
|
||
&:hover { | ||
background-color: rgba(3, 118, 255, 1); | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
.sendButtonDisabled { | ||
background-color: #ccc; | ||
border: 1px solid #aaa; | ||
border-radius: 5px; | ||
color: #aaa; | ||
&:hover { | ||
cursor: default; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.error { | ||
width: 100% !important; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
color: red; | ||
font-size: 1rem; | ||
} | ||
|
||
|
||
.success { | ||
width: 100% !important; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
color: green; | ||
font-size: 1.3rem; | ||
|
||
.message { | ||
color: #333; | ||
font-size: .9rem; | ||
font-weight: 100; | ||
padding-left: 20px; | ||
} | ||
} | ||
|
||
.description { | ||
|
||
font-size: 1rem !important; | ||
font-weight: 100 !important; | ||
padding-bottom: 10px; | ||
} | ||
} |
Oops, something went wrong.