Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
802
Issues
802
List
Boards
Labels
Service Desk
Milestones
Merge Requests
48
Merge Requests
48
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
639a433e
Commit
639a433e
authored
2 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): eth purchase modal
parent
2a627f99
epic/onchainImprovements
1 merge request
!282
Epic/onchain improvements
Pipeline
#62814687
failed with stage
in 6 minutes and 17 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
174 additions
and
7 deletions
+174
-7
eth-modal.component.html
...app/modules/blockchain/marketing/eth-modal.component.html
+43
-0
eth-modal.component.scss
...app/modules/blockchain/marketing/eth-modal.component.scss
+27
-0
eth-modal.component.ts
src/app/modules/blockchain/marketing/eth-modal.component.ts
+64
-0
marketing.module.ts
src/app/modules/blockchain/marketing/marketing.module.ts
+2
-0
purchase.component.html
src/app/modules/blockchain/marketing/purchase.component.html
+7
-0
purchase.component.ts
src/app/modules/blockchain/marketing/purchase.component.ts
+30
-5
balance.component.html
...app/modules/wallet/balances/tokens/balance.component.html
+1
-2
No files found.
src/app/modules/blockchain/marketing/eth-modal.component.html
0 → 100644
View file @
639a433e
<m-modal
open=
"true"
(
closed
)="
close
.
next
(
true
)"
>
<div
class=
"m-blockchain--marketing--modal"
>
<h2>
Buy ETH
</h2>
<div
class=
"m-layout__row m-blockchainEthModal__form"
>
<div
class=
"m-layout__cell"
>
<input
type=
"number"
class=
"m-input"
[(
ngModel
)]="
usd
"
max=
"50"
/>
<label>
USD
</label>
</div>
<div
class=
"m-layout__cell m-blockchainEthModal__eq"
>
<span>
=
</span>
</div>
<div
class=
"m-layout__cell"
>
<input
type=
"number"
class=
"m-input"
[
ngModel
]="
eth
"
(
ngModelChange
)="
setEth
($
event
)"
/>
<label>
ETH
</label>
</div>
</div>
<p>
ETH is estimated at 1 ETH =
<b>
$
</b>
{{ ethRate }}. The checkout process will produce a more accurate ETH value.
</p>
<p
class=
"m-error mdl-color-text--red"
*
ngIf=
"usd > 50"
>
You can not purchase more than $50 worth of ETH
</p>
<button
class=
"m-btn m-btn--slim m-btn--action"
(
click
)="
buy
()"
>
Buy with SendWyre
</button>
</div>
</m-modal>
This diff is collapsed.
Click to expand it.
src/app/modules/blockchain/marketing/eth-modal.component.scss
0 → 100644
View file @
639a433e
.m-blockchainEthModal__form
{
margin
:
36px
0
;
.m-input
{
padding
:
16px
;
font-size
:
24px
;
border-radius
:
24px
;
letter-spacing
:
2px
;
text-align
:
center
;
}
.m-layout__cell
{
display
:
inline-flex
;
flex-direction
:
row
;
align-items
:
center
;
}
label
{
padding
:
16px
;
font-weight
:
600
;
}
.m-blockchainEthModal__eq
{
flex
:
0
;
padding
:
0
16px
;
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/blockchain/marketing/eth-modal.component.ts
0 → 100644
View file @
639a433e
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
ElementRef
,
Input
,
OnDestroy
,
OnInit
,
ViewChild
,
Output
,
EventEmitter
,
}
from
'@angular/core'
;
import
{
Client
}
from
'../../../services/api/client'
;
import
{
MindsTitle
}
from
'../../../services/ux/title'
;
import
{
WireCreatorComponent
}
from
'../../wire/creator/creator.component'
;
import
{
OverlayModalService
}
from
'../../../services/ux/overlay-modal'
;
import
{
BlockchainTdeBuyComponent
}
from
'../tde-buy/tde-buy.component'
;
import
{
Session
}
from
'../../../services/session'
;
import
{
Web3WalletService
}
from
'../web3-wallet.service'
;
import
{
TokenDistributionEventService
}
from
'../contracts/token-distribution-event.service'
;
import
*
as
BN
from
'bn.js'
;
@
Component
({
selector
:
'm-blockchain__eth-modal'
,
templateUrl
:
'eth-modal.component.html'
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
BlockchainEthModalComponent
implements
OnInit
{
@
Input
()
rate
=
1
;
@
Output
()
close
:
EventEmitter
<
boolean
>
=
new
EventEmitter
(
true
);
error
:
string
=
''
;
usd
:
number
=
40
;
ngOnInit
()
{
// grab latest ETH rate
}
get
ethRate
():
number
{
const
tokenUsdRate
=
0.15
;
const
tokenUsd
=
1
/
tokenUsdRate
;
const
usd
=
this
.
rate
/
tokenUsd
;
return
usd
;
}
get
eth
():
number
{
return
this
.
usd
/
this
.
ethRate
;
}
setEth
(
eth
)
{
this
.
usd
=
eth
*
this
.
ethRate
;
}
buy
()
{
this
.
error
=
''
;
if
(
this
.
usd
>
40
)
{
this
.
usd
=
40
;
this
.
error
=
'You can not purchase more than $40'
;
}
let
win
=
window
.
open
(
'/checkout?usd='
+
this
.
usd
);
this
.
close
.
next
(
true
);
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/blockchain/marketing/marketing.module.ts
View file @
639a433e
...
...
@@ -14,6 +14,7 @@ import { BlockchainPurchaseComponent } from './purchase.component';
import
{
BlockchainMarketingOnboardComponent
}
from
'./onboard.component'
;
import
{
BlockchainMarketingBlogsComponent
}
from
'./blogs.component'
;
import
{
BlockchainMarketingCountdownComponent
}
from
'./countdown.component'
;
import
{
BlockchainEthModalComponent
}
from
'./eth-modal.component'
;
import
{
ModalsModule
}
from
'../../modals/modals.module'
;
const
routes
:
Routes
=
[
...
...
@@ -46,6 +47,7 @@ const routes: Routes = [
BlockchainPurchaseComponent
,
BlockchainMarketingBlogsComponent
,
BlockchainMarketingCountdownComponent
,
BlockchainEthModalComponent
,
],
exports
:
[
BlockchainMarketingComponent
,
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/blockchain/marketing/purchase.component.html
View file @
639a433e
...
...
@@ -166,3 +166,10 @@
</div>
</m-modal>
<m-blockchain
__eth-modal
*
ngIf=
"showEthModal"
[
rate
]="
rate
"
(
close
)="
closePurchaseEth
()"
>
</m-blockchain
__eth-modal
>
This diff is collapsed.
Click to expand it.
src/app/modules/blockchain/marketing/purchase.component.ts
View file @
639a433e
...
...
@@ -7,6 +7,9 @@ import {
OnInit
,
ViewChild
,
}
from
'@angular/core'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
Subscription
}
from
'rxjs'
;
import
{
Client
}
from
'../../../services/api/client'
;
import
{
MindsTitle
}
from
'../../../services/ux/title'
;
import
{
WireCreatorComponent
}
from
'../../wire/creator/creator.component'
;
...
...
@@ -44,6 +47,7 @@ export class BlockchainPurchaseComponent implements OnInit {
minds
=
window
.
Minds
;
showPledgeModal
:
boolean
=
false
;
showLoginModal
:
boolean
=
false
;
showEthModal
:
boolean
=
false
;
confirming
:
boolean
=
false
;
confirmed
:
boolean
=
false
;
error
:
string
;
...
...
@@ -52,6 +56,8 @@ export class BlockchainPurchaseComponent implements OnInit {
inProgress
:
boolean
=
false
;
rate
:
number
=
0
;
paramsSubscription
:
Subscription
;
constructor
(
protected
client
:
Client
,
protected
changeDetectorRef
:
ChangeDetectorRef
,
...
...
@@ -59,7 +65,8 @@ export class BlockchainPurchaseComponent implements OnInit {
protected
overlayModal
:
OverlayModalService
,
protected
web3Wallet
:
Web3WalletService
,
protected
tde
:
TokenDistributionEventService
,
public
session
:
Session
public
session
:
Session
,
private
route
:
ActivatedRoute
,
)
{
}
ngOnInit
()
{
...
...
@@ -67,6 +74,17 @@ export class BlockchainPurchaseComponent implements OnInit {
this
.
load
().
then
(()
=>
{
this
.
amount
=
0.25
;
});
this
.
paramsSubscription
=
this
.
route
.
params
.
subscribe
(
params
=>
{
if
(
params
.
purchaseEth
)
{
this
.
purchaseEth
();
}
});
}
ngOnDestroy
()
{
if
(
this
.
paramsSubscription
)
{
this
.
paramsSubscription
.
unsubscribe
();
}
}
get
amount
()
{
...
...
@@ -154,10 +172,17 @@ export class BlockchainPurchaseComponent implements OnInit {
}
purchaseEth
()
{
let
win
=
window
.
open
(
'/checkout'
);
win
.
onload
=
function
()
{
alert
(
'opened'
);
}
this
.
showEthModal
=
true
;
this
.
detectChanges
();
//let win = window.open('/checkout');
//win.onload = function() {
// alert('opened');
//}
}
closePurchaseEth
()
{
this
.
showEthModal
=
false
;
this
.
detectChanges
();
}
closeLoginModal
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/wallet/balances/tokens/balance.component.html
View file @
639a433e
...
...
@@ -98,9 +98,8 @@
>
Buy Tokens
</a>
<a
href=
"/checkout
"
<a
[
routerLink
]="['/
token
',
{
'
purchaseEth
'
:
'
open
'
}]
"
class=
"m-btn m-btn--slim m-btn--action"
target=
"_blank"
>
Buy ETH
</a>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment