This repository was archived by the owner on Sep 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add message about running generator online.
Showing
5 changed files
with
88 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from "react"; | ||
|
||
import pkg from "../../../package.json"; | ||
|
||
export default class LiveSiteChecker extends React.Component { | ||
state = { | ||
dismissed: false | ||
}; | ||
|
||
handleDismiss = () => { | ||
this.setState({dismissed: true}); | ||
}; | ||
|
||
render() { | ||
const {dismissed} = this.state; | ||
const runningLive = !!location.protocol.match(/^https?:/); | ||
const url = `https://github.com/fnando/stellar-paperwallet/releases/download/v${pkg.version}/stellar-paperwallet.zip`; | ||
const skipRendering = dismissed || !runningLive; | ||
|
||
if (skipRendering) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="live-site center"> | ||
<div> | ||
<div> | ||
You're running this paper wallet generator off of a live website. | ||
Even though all code runs on the client-side, is recommended that | ||
you <a href={url}>download the zip file</a> and run it locally from your machine. | ||
</div> | ||
<p className="mb0"> | ||
<button onClick={this.handleDismiss}>Dismiss</button> | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
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,23 @@ | ||
.live-site { | ||
background: rgba(#08b5e5, .2); | ||
padding: 20px; | ||
margin-bottom: 125px; | ||
} | ||
|
||
.live-site > div { | ||
max-width: 800px; | ||
margin: 0 auto; | ||
} | ||
|
||
.live-site button { | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
font-family: inherit; | ||
font-size: 12px; | ||
padding: 5px 20px; | ||
cursor: pointer; | ||
border: 2px solid #08b5e5; | ||
background: #fff; | ||
color: #08b5e5; | ||
box-shadow: 4px 4px rgba(#08b5e5, .4); | ||
} |
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