Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #878 from swarmcity/S01E05-live
Browse files Browse the repository at this point in the history
New hashtag
  • Loading branch information
xardass authored Dec 5, 2018
2 parents 025609d + 97c66e2 commit cdc5dbe
Show file tree
Hide file tree
Showing 11 changed files with 2,011 additions and 10 deletions.
858 changes: 858 additions & 0 deletions src/data/data-simpledeal.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/displays/display-hashtagadd-btn.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

</style>

<div tabindex="5" class="hashtaggadd" on-tap="_newHashtag" on-KeyPress="_newHashtag">
<div tabindex="5" class="hashtaggadd">
<div class="icon"></div>
</div>

Expand Down
31 changes: 30 additions & 1 deletion src/displays/display-success.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,24 @@
text-align: left;
}


.container .linkbox {
margin-top: 10px;
text-align: center;
}

.container[wide-layout] .linkbox {
margin-top: 0px;
text-align: left;
}

.link {
@apply --small-bold;
border-bottom: 2px dotted var(--sc-grey3);
color: var(--sc-grey3);
cursor: pointer;
}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-resolution: 240dpi) {
Expand All @@ -267,6 +285,10 @@
<div class="container" wide-layout$="{{wide}}">
<div class="top">
<div class="title">{{successTitle}}</div>

<div class="linkbox">
<span class="link"on-tap="_toEtherscan">show on etherscan</span>
</div>
<div class="dividerbox"></div>
<div class="statusbox">
<div class="bar">
Expand Down Expand Up @@ -304,6 +326,7 @@
type: String,
statePath: 'language',
},
successTxHash: String,
};
}

Expand All @@ -315,9 +338,15 @@
/**
* takes the user back to my-wallet page
*/
_next() {
_next() {
this.dispatchEvent(new CustomEvent('close'));
}
/**
* takes the user to the selected user balance on etherscan
*/
_toEtherscan() {
window.open(`https://kovan.etherscan.io/tx/${this.successTxHash}`, '_blank');
}

}
window.customElements
Expand Down
24 changes: 22 additions & 2 deletions src/pages/hashtag-list/hashtag-list-router.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<hashtag-list-item item="[[item]]" on-hashtag="_handleOnHashtag"></hashtag-list-item>
<display-divider></display-divider>
</template>
<display-hashtagadd-btn on-tap="_newHashtag">
<display-hashtagadd-btn on-down="_newHashtagDown" on-up="_newHashtagUp">
</display-hashtagadd-btn>
</div>
</template>
Expand All @@ -88,15 +88,35 @@
path: {
type: String,
observer: '_path',
}
},
timeout: Object,
};
}
_handleOnBack() {
this.set('route.path', 'welcome');
}
_newHashtag() {
clearTimeout(this.timeout);
this.set('route.path', 'new-hashtag');
}

_newHashtagOld() {
this.set('route.path', 'new-hashtag-old');
}

_newHashtagDown() {
this.timeout = setTimeout(() => {
this._newHashtag();
}, 1000)
}

_newHashtagUp() {
clearTimeout(this.timeout);
if (this.route.path == '/hashtag-list/'
|| this.route.path == '/hashtag-list') {
this._newHashtagOld();
}
}
_showHashtag(hashtag) {
return hashtag.hashtagShown;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/hashtag/hashtag-simpledeal-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
[[_formatDate(item)]]
</div>
</div>
<div class="replycount">[[item.status]]</div>
<div class="replycount">[[_replycount(item)]]</div>
<div class="replyicon"></div>
<template is="dom-if" if="[[_hasProvider(item)]]">
<iron-image class="item-avatar-topright" sizing="cover" preload src="https://scapiweb3-c.swarm.city/img/[[item.providerAvatarHash]]"
Expand Down
190 changes: 190 additions & 0 deletions src/pages/new-hashtag/new-hashtag-confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<!--
@license
Copyright (c) 2018 Swarm City
This code may only be used under the license found at https://github.com/swarmcity/license
-->
<link rel="import" href="../../../bower_components/polymer/polymer-element.html">
<link rel="import" href="../../shared-styles.html">
<!--
Example:
### Styling
Style the button with CSS as you would a normal DOM element.
The following custom properties and mixins are available for styling:
| Custom property | Description | Default |
| --- | --- | --- |
| `--new-hashtag-confirm` | Mixin applied to the deal button | `{}` |
-->
<dom-module id="new-hashtag-confirm">
<template>
<style include="shared-styles">
:host {
background-color: var(--sc-blue);
height: 100vh;
width: 100vw;
display: block;
}

.container {
background-color: var(--sc-blue);
@apply --titlepage-closed-container;
}

.container .top {
@apply --titlepage-closed-container-top;
}

.container .bottom {
@apply --titlepage-closed-container-bottom;
}

.container .title {
@apply --titlepage-title;
color: var(--sc-white);
}

.container .subtitle {
@apply --titlepage-subtitle;
color: var(--sc-white);
}

.container[wide-layout] {
@apply --titlepage-closed-wide-container;
}

.container[wide-layout] .top {
@apply --titlepage-closed-wide-container-top;
}

.container[wide-layout] .bottom {
@apply --titlepage-closed-wide-container-bottom;
}

.container[wide-layout] .title {
@apply --titlepage-title-wide;
}

.container[wide-layout] .subtitle {
@apply --titlepage-subtitle-wide;
}

.container .confirmers {
@apply --titlepage-confirmers;
}

.container[wide-layout] .confirmers {
@apply --titlepage-confirmers-wide;
}

.container .confirmers>div:nth-child(1) {
@apply --confirmers-x;
@apply --xmark-grey4-normal;
}

.container .confirmers>div:nth-child(1):active {
@apply --button-active;
}

.container .confirmers>div:nth-child(2) {
@apply --icon-button-big;
}

.container .confirmers>div:nth-child(2):active {
@apply --button-active;
}

.container .confirmers>div:nth-child(2)>div:nth-child(1) {
@apply --vmark-blue-normal;
}

.flexer {
@apply --titlepage-flexer;
}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-resolution: 240dpi) {

.container .confirmers>div:nth-child(1),
.container .confirmers>div:nth-child(2)>div:nth-child(1) {
@apply --retina
}
}
</style>
<div id="container" class="container" wide-layout$="{{wide}}">
<div class="top">
<div class="title" id="title">{{localize('Post this request for')}} [[totalSum]] SWT?</div>
<div class="subtitle" id="subtitle">{{localize('This can not be undone.')}} [[hashtagFee]] SWT
{{localize('hashtagfee is included')}}.</div>
</div>
<div class="flexer">
</div>
<div class="bottom">
<div class="confirmers" id="buttons">
<div on-click="_reject"></div>
<div on-click="_confirm">
<div></div>
</div>
</div>
</div>
</div>
</template>
<script>
class MyNewHashtagConfirm extends new ReduxMixin(Polymer.mixinBehaviors([
Polymer.AppLocalizeBehavior,
],
Polymer.Element
)) {
static get is() {
return 'new-hashtag-confirm';
}
static get properties() {
return {
/**
* Language is the user selected language
* @type {String}
*/
language: {
type: String,
statePath: 'language',
},
totalSum: {
type: String,
},
hashtagFee: {
type: String,
},
unlock: {
type: Boolean,
value: false,
}
};
}
/**
* Fired when the component is connected
*/
connectedCallback() {
super.connectedCallback();
this.loadResources(this.resolveUrl('../../text-translations.json'));
}
/**
* Takes the user to the previous page
*/
_reject() {
this.dispatchEvent(new CustomEvent('reject'));
}
/**
* Takes the user to the previous page
*/
_confirm() {
this.dispatchEvent(new CustomEvent('confirm'));
}


} window.customElements.define(MyNewHashtagConfirm.is, MyNewHashtagConfirm);
</script>
</dom-module>
Loading

0 comments on commit cdc5dbe

Please sign in to comment.