diff --git a/app/assets/v2/css/base.css b/app/assets/v2/css/base.css index a2fbd2c0125..82c57049124 100644 --- a/app/assets/v2/css/base.css +++ b/app/assets/v2/css/base.css @@ -124,6 +124,10 @@ span { border-radius: 4px !important; } +.font-weight-semibold { + font-weight: 600; +} + #tutorials li{ list-style: none; } diff --git a/app/assets/v2/css/buttons.css b/app/assets/v2/css/buttons.css index 7743323242e..1d9456091eb 100644 --- a/app/assets/v2/css/buttons.css +++ b/app/assets/v2/css/buttons.css @@ -192,5 +192,5 @@ button:focus { background: none; color: white; border: 2px solid white; - border-radius: 10px; + border-radius: 4px; } diff --git a/app/assets/v2/css/forms/input.css b/app/assets/v2/css/forms/input.css index 63b2cc24ed1..1775032bdba 100644 --- a/app/assets/v2/css/forms/input.css +++ b/app/assets/v2/css/forms/input.css @@ -1,6 +1,6 @@ .form__input { background-color: #FFF; - border-radius: 3px; + border-radius: 2px; border: 1px solid #D3D3D3; font-size: 14px; padding: 5px 7px; diff --git a/app/assets/v2/css/grants/fund.css b/app/assets/v2/css/grants/fund.css index df2687351b7..634d7dc5ed6 100644 --- a/app/assets/v2/css/grants/fund.css +++ b/app/assets/v2/css/grants/fund.css @@ -2,11 +2,52 @@ color: #43484D; } -#frequency_count { - height: 40px !important; +#grants_form input { + height: 2.5rem !important; } -.grant-banner-img { +.select2-container--default .select2-selection--single, +#grants_form input { + border-color: #0D0764 !important; +} + +.grant-banner img { max-height: 20rem; + width: 100%; overflow-y: hidden; -} \ No newline at end of file +} + +.grant-banner { + background-color: #F2F6F9; + width: 100%; +} + +.grant-banner .grant-title { + font-weight: 600; +} + +.grant-banner .grant-title a { + color: #000; +} + +.summary p { + margin: 0 0 4px; +} + +.summary i { + font-size: 6px; + position: relative; + bottom: 2px; +} + +@media (max-width: 767.98px) { + + .banner-img { + text-align: center; + } + + .banner-img img { + width: auto; + max-width: 100%; + } +} diff --git a/app/assets/v2/js/grants/fund.js b/app/assets/v2/js/grants/fund.js index 3a7ce486954..2f7f6976a48 100644 --- a/app/assets/v2/js/grants/fund.js +++ b/app/assets/v2/js/grants/fund.js @@ -1,12 +1,16 @@ /* eslint-disable no-console */ $(document).ready(function() { - $('#period').select2(); - $('.js-select2').each(function() { $(this).select2(); }); + $('.select2-selection__rendered').hover(function() { + $(this).removeAttr('title'); + }); + + updateSummary(); + // alert("Just so you know, you will perform two actions in MetaMask on this page!") $('#js-fundGrant').validate({ @@ -37,11 +41,12 @@ $(document).ready(function() { } let deployedSubscription = new web3.eth.Contract(compiledSubscription.abi, data.contract_address); + let deployedToken; if (data.token_address != '0x0000000000000000000000000000000000000000') { - let deployedToken = new web3.eth.Contract(compiledToken.abi, data.token_address); + deployedToken = new web3.eth.Contract(compiledToken.abi, data.token_address); } else { - let deployedToken = new web3.eth.Contract(compiledToken.abi, data.denomination); + deployedToken = new web3.eth.Contract(compiledToken.abi, data.denomination); } deployedToken.methods.decimals().call(function(err, decimals) { @@ -169,3 +174,31 @@ $(document).ready(function() { $('#js-token').select2(); }); }); + +const updateSummary = (element) => { + + $('#summary-period').html($('input#frequency_count').val()); + $('#summary-amount').html($('input#amount').val() ? $('input#amount').val() : 0); + $('#summary-frequency').html($('input#period').val() ? $('input#period').val() : 0); + $('#summary-frequency-unit').html($('#frequency_unit').val()); + + $('#js-token').on('select2:select', event => { + $('#summary-token').html(event.params.data.text); + }); + + $('#frequency_unit').on('select2:select', event => { + $('#summary-frequency-unit').html(event.params.data.text); + }); + + $('input#frequency_count').on('input', () => { + $('#summary-period').html($('input#frequency_count').val()); + }); + + $('input#amount').on('input', () => { + $('#summary-amount').html($('input#amount').val()); + }); + + $('input#period').on('input', () => { + $('#summary-frequency').html($('input#period').val()); + }); +}; diff --git a/app/assets/v2/js/grants/shared.js b/app/assets/v2/js/grants/shared.js index 8754755274b..605e7755a61 100644 --- a/app/assets/v2/js/grants/shared.js +++ b/app/assets/v2/js/grants/shared.js @@ -19,7 +19,7 @@ $(document).ready(function() { }); }; - setInterval(listen_web3_1_changes, 300); + setInterval(listen_web3_1_changes, 1000); const show_error_banner = (result) => { if ($('#grants_form').length) { @@ -32,10 +32,22 @@ $(document).ready(function() { $('#grants_form').addClass('hidden'); $('.submit_bounty .newsletter').addClass('hidden'); $('#unlock_metamask_error').css('display', 'none'); + $('#connect_metamask_error').css('display', 'none'); $('#no_issue_error').css('display', 'none'); mixpanel_track_once('No Metamask Error', params); + } else if (is_metamask_unlocked && !is_metamask_approved) { + $('#connect_metamask_error').css('display', 'block'); + $('#unlock_metamask_error').css('display', 'none'); + $('#zero_balance_error').css('display', 'none'); + $('#no_metamask_error').css('display', 'none'); + $('#robot_error').removeClass('hidden'); + $('#grants_form').addClass('hidden'); + $('.submit_bounty .newsletter').addClass('hidden'); + $('#no_issue_error').css('display', 'none'); + mixpanel_track_once('Unlock Metamask Error', params); } else if (!result) { $('#unlock_metamask_error').css('display', 'block'); + $('#connect_metamask_error').css('display', 'none'); $('#zero_balance_error').css('display', 'none'); $('#no_metamask_error').css('display', 'none'); $('#robot_error').removeClass('hidden'); @@ -49,6 +61,7 @@ $(document).ready(function() { $('#grants_form').addClass('hidden'); $('.submit_bounty .newsletter').addClass('hidden'); $('#unlock_metamask_error').css('display', 'none'); + $('#connect_metamask_error').css('display', 'none'); $('#no_metamask_error').css('display', 'none'); $('#no_issue_error').css('display', 'none'); mixpanel_track_once('Zero Balance Metamask Error', params); @@ -56,6 +69,7 @@ $(document).ready(function() { $('#zero_balance_error').css('display', 'none'); $('#unlock_metamask_error').css('display', 'none'); $('#no_metamask_error').css('display', 'none'); + $('#connect_metamask_error').css('display', 'none'); $('#no_issue_error').css('display', 'block'); $('#robot_error').addClass('hidden'); $('#grants_form').removeClass('hidden'); diff --git a/app/assets/v2/js/metamask-approval.js b/app/assets/v2/js/metamask-approval.js index c4577d4c170..15ef58dc5b8 100644 --- a/app/assets/v2/js/metamask-approval.js +++ b/app/assets/v2/js/metamask-approval.js @@ -51,7 +51,7 @@ function ask_metamask_connection() { shown_on = [ '/tip/send/2', '/kudos/send', '/ens' ]; var len = page_url.length - 1; - + if (page_url.lastIndexOf('/') === len) { page_url = page_url.substring(0, len); } diff --git a/app/assets/v2/js/shared.js b/app/assets/v2/js/shared.js index 3844cccfb4d..86d2a5e4f7f 100644 --- a/app/assets/v2/js/shared.js +++ b/app/assets/v2/js/shared.js @@ -938,22 +938,22 @@ var listen_for_web3_changes = async function() { document.listen_for_web3_iterations += 1; } - if (typeof web3 == 'undefined') { - currentNetwork(); - trigger_form_hooks(); - } else if (typeof web3 == 'undefined' || typeof web3.eth == 'undefined' || typeof web3.eth.coinbase == 'undefined' || !web3.eth.coinbase) { - currentNetwork('locked'); - trigger_form_hooks(); - } else { - is_metamask_unlocked = true; - web3.eth.getBalance(web3.eth.coinbase, function(errors, result) { - if (errors) { - return; - } - if (typeof result != 'undefined') { - document.balance = result.toNumber(); - } - }); + if (typeof web3 == 'undefined') { + currentNetwork(); + trigger_form_hooks(); + } else if (typeof web3 == 'undefined' || typeof web3.eth == 'undefined' || typeof web3.eth.coinbase == 'undefined' || !web3.eth.coinbase) { + currentNetwork('locked'); + trigger_form_hooks(); + } else { + is_metamask_unlocked = true; + web3.eth.getBalance(web3.eth.coinbase, function(errors, result) { + if (errors) { + return; + } + if (typeof result != 'undefined') { + document.balance = result.toNumber(); + } + }); web3.version.getNetwork(function(error, netId) { if (error) { diff --git a/app/dashboard/templates/shared/connect_metamask.html b/app/dashboard/templates/shared/connect_metamask.html index 04c3cd0a4ac..02e741b13ff 100644 --- a/app/dashboard/templates/shared/connect_metamask.html +++ b/app/dashboard/templates/shared/connect_metamask.html @@ -24,7 +24,7 @@
{% trans "Please connect to Metamask and refresh the page." %} - +