This repository has been archived by the owner on May 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #870 from swarmcity/Cancel
Cancel
- Loading branch information
Showing
8 changed files
with
283 additions
and
101 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
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,84 @@ | ||
<!-- | ||
@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="../../../bower_components/app-localize-behavior/app-localize-behavior.html"> | ||
<link rel="import" href="../../../bower_components/iron-media-query/iron-media-query.html"> | ||
<!-- | ||
Example: | ||
``` | ||
<detail-button-cancel></detail-button-cancel> | ||
``` | ||
### 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 | | ||
| --- | --- | --- | | ||
| `--detail-button-cancel` | Mixin applied to the deal button | `{}` | | ||
--> | ||
<dom-module id="detail-button-cancel"> | ||
<template> | ||
<style include="shared-styles"> | ||
:host { | ||
display: block; | ||
} | ||
|
||
.container { | ||
max-width: 175px; | ||
text-align: center; | ||
margin: 40px auto; | ||
} | ||
|
||
.button { | ||
@apply --text-button-small; | ||
color: var(--sc-red); | ||
cursor: pointer; | ||
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.35); | ||
-webkit-box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.35); | ||
-moz-box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.35); | ||
-o-box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.35); | ||
} | ||
|
||
.container[wide-layout] .button { | ||
box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.5); | ||
-webkit-box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.5); | ||
-moz-box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.5); | ||
-o-box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.button:active { | ||
@apply --button-active; | ||
} | ||
</style> | ||
<iron-media-query query="(min-width: 600px)" query-matches="{{wide}}"></iron-media-query> | ||
<div class="container" wide-layout$="{{wide}}"> | ||
<div class="button" on-tap="_cancel"> | ||
cancel this request | ||
</div> | ||
</div> | ||
|
||
</template> | ||
<script> | ||
class MyDetailButtonCancel extends new ReduxMixin(Polymer.mixinBehaviors([ | ||
Polymer.AppLocalizeBehavior, | ||
], | ||
Polymer.Element | ||
)) { | ||
static get is() { | ||
return 'detail-button-cancel'; | ||
} | ||
_cancel() { | ||
this.dispatchEvent(new CustomEvent('cancel')); | ||
} | ||
|
||
} | ||
window.customElements.define(MyDetailButtonCancel.is, MyDetailButtonCancel); | ||
</script> | ||
</dom-module> |
Oops, something went wrong.