Skip to content

Commit

Permalink
bounty: css refactor + fix
Browse files Browse the repository at this point in the history
- fixed waiting state loader
- re-indent + refactor
- added background color for code snippet
  • Loading branch information
Aditya Anand committed Jul 16, 2018
1 parent 2325aa7 commit c3e3e27
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
19 changes: 17 additions & 2 deletions app/assets/v2/css/bounty.css
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,14 @@ a.btn {
max-width: 100%;
width: 13rem;
z-index: 2;
top: 2rem;
padding-right: 1rem;
top: 50%;
transform: translateY(-50%);
}

.waiting-state img {
top: -2rem;
transform: none;
}

#btn-white img {
Expand Down Expand Up @@ -419,6 +425,12 @@ a.btn {
margin-bottom: 2em;
}

.code-snippet {
background-color: #F2F6F9;
padding-top: 1rem;
padding-bottom: 1rem;
}

#bounty_details #issue_description img {
max-height: 30rem;
max-width: 30rem;
Expand Down Expand Up @@ -489,6 +501,10 @@ a.btn {
text-align: center;
}

.loading_img img {
width: 10rem;
}

#bounty_details .tags {
margin-top: 10px;
float: none;
Expand Down Expand Up @@ -610,7 +626,6 @@ a.btn {
margin: 4rem auto;
font-weight: 700;
z-index: 2;
padding-top: 100px;
}

.bounty_details .quote_text {
Expand Down
25 changes: 16 additions & 9 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
/* eslint block-scoped-var: "warn" */
/* eslint no-redeclare: "warn" */


var _truthy = function(val) {
if (!val || val == '0x0000000000000000000000000000000000000000') {
return false;
}
return true;
};
var address_ize = function(key, val, result) {

var address_ize = function(key, val) {
if (!_truthy(val)) {
return [ null, null ];
}
return [ key, '<a href="https://etherscan.io/address/' + val + '" target="_blank" rel="noopener noreferrer">' + val + '</a>' ];
};
var gitcoin_ize = function(key, val, result) {

var gitcoin_ize = function(key, val) {
if (!_truthy(val)) {
return [ null, null ];
}
return [ key, '<a href="https://gitcoin.co/profile/' + val + '" target="_blank" rel="noopener noreferrer">@' + val.replace('@', '') + '</a>' ];
};
var email_ize = function(key, val, result) {

var email_ize = function(key, val) {
if (!_truthy(val)) {
return [ null, null ];
}
return [ key, '<a href="mailto:' + val + '">' + val + '</a>' ];
};
var hide_if_empty = function(key, val, result) {

var hide_if_empty = function(key, val) {
if (!_truthy(val)) {
return [ null, null ];
}
return [ key, val ];
};
var unknown_if_empty = function(key, val, result) {

var unknown_if_empty = function(key, val) {
if (!_truthy(val)) {
$('#' + key).parent().hide();
return [ key, 'Unknown' ];
}
return [ key, val ];
};
var link_ize = function(key, val, result) {

var link_ize = function(key, val) {
if (!_truthy(val)) {
return [ null, null ];
}
Expand Down Expand Up @@ -85,13 +90,15 @@ var rows = [
'fulfilled_owners_username',
'fulfillment_accepted_on'
];

var heads = {
'avatar_url': gettext('Issue'),
'value_in_token': gettext('Issue Funding Info'),
'bounty_owner_address': gettext('Funder'),
'fulfiller_address': gettext('Submitter'),
'experience_level': gettext('Meta')
};

var callbacks = {
'github_url': link_ize,
'value_in_token': function(key, val, result) {
Expand Down Expand Up @@ -513,7 +520,6 @@ var show_interest_modal = function() {
});
};


var build_detail_page = function(result) {

// setup
Expand Down Expand Up @@ -569,6 +575,8 @@ var build_detail_page = function(result) {
modalClass: 'modal magnify'
});
});

$('#bounty_details #issue_description code').parent().addClass('code-snippet');
};

const is_current_user_interested = function(result) {
Expand Down Expand Up @@ -1078,7 +1086,6 @@ var main = function() {
}, 100);
};


window.addEventListener('load', function() {
main();
});

0 comments on commit c3e3e27

Please sign in to comment.