diff --git a/ui/js/component/auth.js b/ui/js/component/auth.js index aa3937e63..a42d3cc06 100644 --- a/ui/js/component/auth.js +++ b/ui/js/component/auth.js @@ -104,21 +104,45 @@ const ConfirmEmailStage = React.createClass({ }); const WelcomeStage = React.createClass({ + propTypes: { + endAuth: React.PropTypes.func, + }, + getInitialState: function() { + return { + hasReward: false, + rewardAmount: null, + } + }, + onRewardClaim: function(reward) { + this.setState({ + hasReward: true, + rewardAmount: reward + }) + }, render: function() { - //
Thank you
return (
- LBRY is kind of like a centaur. Totally normal up top, and way different underneath. On the upper level, LBRY is like other popular video and media sites. Below, LBRY is like nothing else. Through blockchain and decentralization, LBRY is controlled by it's users -- that is, you. Here is a reward for reading our weird centaur metaphor: This reward earned you LBC. LBC is used to watch stuff and to have say in how the network works. But no need to understand it all just yet! Try watching something next. LBRY is kind of like a centaur. Totally normal up top, and way different underneath. On the upper level, LBRY is like other popular video and media sites. Below, LBRY is like nothing else. Using blockchain and decentralization, LBRY is controlled by its users -- that is, you -- and no one else. Thanks for being a part of it! Here's a nickel, kid. You earned a reward of 5 LBRY credits, or LBC. This reward will show in your Wallet momentarily, likely while you are reading this message. LBC is used to compensate creators, to publish, and to have say in how the network works. No need to understand it all just yet! Try watching or downloading something next.Welcome to LBRY.
- Welcome to LBRY.
+ About Your Reward
+ LBRY Early Access
Run on Startup
+ Run on Startup
- Download Directory
diff --git a/ui/js/rewards.js b/ui/js/rewards.js
index 29f43058c..a42ed1637 100644
--- a/ui/js/rewards.js
+++ b/ui/js/rewards.js
@@ -3,23 +3,44 @@ import lbryio from './lbryio.js';
function rewardMessage(type, amount) {
return {
- new_developer: "Your reward has been confirmed for registering as a new developer.",
+ new_developer: "You received ${amount} for registering as a new developer.",
new_user: `You received ${amount} LBC new user reward.`,
- confirm_email: "Your reward has been confirmed for verifying your email address.",
- first_publish: "Your reward has been confirmed for making your first publication.",
+ confirm_email: "You received ${amount} LBC for verifying your email address.",
+ first_channel: "You received ${amount} LBC for creating a publisher identity.",
+ first_purchase: "You received ${amount} LBC for making your first purchase.",
+ first_publish: "You received ${amount} LBC for making your first publication.",
}[type];
}
const rewards = {};
-rewards.claimReward = function(type) {
+rewards.TYPE_NEW_DEVELOPER = "new_developer",
+ rewards.TYPE_NEW_USER = "new_user",
+ rewards.TYPE_CONFIRM_EMAIL = "confirm_email",
+ rewards.TYPE_FIRST_CHANNEL = "first_channel",
+ rewards.TYPE_FIRST_PURCHASE = "first_purchase",
+ rewards.TYPE_FIRST_PUBLISH = "first_publish";
+
+rewards.claimReward = function (type) {
return new Promise((resolve, reject) => {
- console.log('top of promise body')
lbry.get_new_address().then((address) => {
const params = {
reward_type: type,
wallet_address: address,
};
+ switch (type) {
+ case 'first_channel':
+ //params.transaction_id = RelevantTransactionID;
+ break;
+
+ case 'first_purchase':
+ //params.transaction_id = RelevantTransactionID;
+ break;
+
+ case 'first_channel':
+ //params.transaction_id = RelevantTransactionID;
+ break;
+ }
lbryio.call('reward', 'new', params, 'post').then(({RewardAmount}) => {
const
message = rewardMessage(type, RewardAmount),
diff --git a/ui/scss/_gui.scss b/ui/scss/_gui.scss
index 15246c7f6..da32d3ac5 100644
--- a/ui/scss/_gui.scss
+++ b/ui/scss/_gui.scss
@@ -147,79 +147,3 @@ p
font-size: 0.85em;
color: $color-help;
}
-
-.modal-overlay {
- position: fixed;
- display: flex;
- justify-content: center;
- align-items: center;
-
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- background-color: rgba(255, 255, 255, 0.74902);
- z-index: 9999;
-}
-
-.modal {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-
- border: 1px solid rgb(204, 204, 204);
- background: rgb(255, 255, 255);
- overflow: auto;
- border-radius: 4px;
- padding: $spacing-vertical;
- box-shadow: $default-box-shadow;
- max-width: 400px;
-}
-
-.modal__header {
- margin-bottom: 5px;
- text-align: center;
-}
-
-.modal__buttons {
- display: flex;
- flex-direction: row;
- justify-content: center;
- margin-top: 15px;
-}
-
-.modal__button {
- margin: 0px 6px;
-}
-
-.error-modal-overlay {
- background: rgba(#000, .88);
-}
-
-.error-modal__content {
- display: flex;
- padding: 0px 8px 10px 10px;
-}
-
-.error-modal__warning-symbol {
- margin-top: 6px;
- margin-right: 7px;
-}
-
-.download-started-modal__file-path {
- word-break: break-all;
-}
-
-.error-modal {
- max-width: none;
- width: 400px;
-}
-.error-modal__error-list { /*shitty hack/temp fix for long errors making modals unusable*/
- border: 1px solid #eee;
- padding: 8px;
- list-style: none;
- max-height: 400px;
- max-width: 400px;
- overflow-y: hidden;
-}
diff --git a/ui/scss/all.scss b/ui/scss/all.scss
index 18a9ec720..dcb81cb98 100644
--- a/ui/scss/all.scss
+++ b/ui/scss/all.scss
@@ -15,6 +15,7 @@
@import "component/_load-screen.scss";
@import "component/_channel-indicator.scss";
@import "component/_notice.scss";
+@import "component/_modal.scss";
@import "component/_modal-page.scss";
@import "component/_snack-bar.scss";
@import "page/_developer.scss";
diff --git a/ui/scss/component/_modal-page.scss b/ui/scss/component/_modal-page.scss
index 2b86c5cad..d9bd0d8d5 100644
--- a/ui/scss/component/_modal-page.scss
+++ b/ui/scss/component/_modal-page.scss
@@ -1,16 +1,4 @@
-.modal-page-overlay {
- position: fixed;
- display: flex;
- justify-content: center;
- align-items: center;
-
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- background-color: rgba(255, 255, 255, 0.74902);
- z-index: 9999;
-}
+@import "../global";
.modal-page {
position: fixed;
diff --git a/ui/scss/component/_modal.scss b/ui/scss/component/_modal.scss
new file mode 100644
index 000000000..13284c7ff
--- /dev/null
+++ b/ui/scss/component/_modal.scss
@@ -0,0 +1,81 @@
+@import "../global";
+
+.modal-overlay {
+ position: fixed;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ bottom: 0px;
+ background-color: rgba(255, 255, 255, 0.74902);
+ z-index: 9999;
+}
+
+.modal-overlay--clear {
+ background-color: transparent;
+}
+
+.modal {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+
+ border: 1px solid rgb(204, 204, 204);
+ background: rgb(255, 255, 255);
+ overflow: auto;
+ border-radius: 4px;
+ padding: $spacing-vertical;
+ box-shadow: $default-box-shadow;
+ max-width: 400px;
+}
+
+.modal__header {
+ margin-bottom: 5px;
+ text-align: center;
+}
+
+.modal__buttons {
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ margin-top: 15px;
+}
+
+.modal__button {
+ margin: 0px 6px;
+}
+
+.error-modal-overlay {
+ background: rgba(#000, .88);
+}
+
+.error-modal__content {
+ display: flex;
+ padding: 0px 8px 10px 10px;
+}
+
+.error-modal__warning-symbol {
+ margin-top: 6px;
+ margin-right: 7px;
+}
+
+.download-started-modal__file-path {
+ word-break: break-all;
+}
+
+.error-modal {
+ max-width: none;
+ width: 400px;
+}
+.error-modal__error-list { /*shitty hack/temp fix for long errors making modals unusable*/
+ border: 1px solid #eee;
+ padding: 8px;
+ list-style: none;
+ max-height: 400px;
+ max-width: 400px;
+ overflow-y: hidden;
+}
\ No newline at end of file