-
Notifications
You must be signed in to change notification settings - Fork 98
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 #1807 from cosmos/jordan/1754-forms
Jordan/1754 forms
- Loading branch information
Showing
83 changed files
with
3,996 additions
and
6,858 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ server_dev.key | |
server_dev.crt | ||
Cosmos_* | ||
app/networks/* | ||
app/package.json | ||
app/package.json |
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,154 @@ | ||
<template> | ||
<transition name="slide-fade"> | ||
<div v-click-outside="close" class="action-modal"> | ||
<div class="action-modal-header"> | ||
<img | ||
class="icon action-modal-atom" | ||
src="~assets/images/cosmos-logo.png" | ||
/><span class="action-modal-title">{{ title }}</span> | ||
<div | ||
id="closeBtn" | ||
class="action-modal-icon action-modal-close" | ||
@click="close" | ||
> | ||
<i class="material-icons">close</i> | ||
</div> | ||
</div> | ||
<div class="action-modal-form"><slot></slot></div> | ||
<div class="action-modal-footer"> | ||
<slot name="action-modal-footer"></slot> | ||
<p | ||
v-if="submissionError" | ||
class="tm-form-msg sm tm-form-msg--error submission-error" | ||
> | ||
{{ submissionError }} | ||
</p> | ||
</div> | ||
</div> | ||
</transition> | ||
</template> | ||
|
||
<script> | ||
import ClickOutside from "vue-click-outside" | ||
export default { | ||
name: `action-modal`, | ||
directives: { | ||
ClickOutside | ||
}, | ||
props: { | ||
title: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
data: () => ({ | ||
submissionError: null | ||
}), | ||
methods: { | ||
close() { | ||
this.$emit(`close-action-modal`) | ||
}, | ||
async submit(submitFn, submissionErrorPrefix = `Submitting data failed`) { | ||
try { | ||
await submitFn() | ||
this.close() | ||
} catch ({ message }) { | ||
this.submissionError = `${submissionErrorPrefix}: ${message}.` | ||
setTimeout(() => { | ||
this.submissionError = null | ||
}, 5000) | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.action-modal { | ||
background: var(--app-nav); | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
right: 2rem; | ||
padding: 3rem; | ||
position: fixed; | ||
bottom: 0; | ||
width: 100%; | ||
max-width: 664px; | ||
z-index: var(--z-modal); | ||
border-top-left-radius: 0.25rem; | ||
border-top-right-radius: 0.25rem; | ||
box-shadow: 0 2px 8px rgba(200, 200, 200, 0.1); | ||
} | ||
.action-modal-header { | ||
align-items: center; | ||
display: flex; | ||
padding-bottom: 2rem; | ||
} | ||
.action-modal-atom { | ||
height: 3rem; | ||
width: 3rem; | ||
} | ||
.action-modal-title { | ||
flex: 1; | ||
font-size: var(--h3); | ||
font-weight: 500; | ||
color: var(--bright); | ||
padding-left: 1rem; | ||
} | ||
.action-modal-icon { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.action-modal-icon i { | ||
font-size: var(--lg); | ||
} | ||
.action-modal-icon.action-modal-close { | ||
cursor: pointer; | ||
} | ||
.action-modal-icon.action-modal-close:hover i { | ||
color: var(--link); | ||
} | ||
.action-modal-form .tm-form-group { | ||
display: block; | ||
padding: 0.5rem 0 1rem; | ||
} | ||
.action-modal-footer { | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 2rem 0 0; | ||
} | ||
.submission-error { | ||
position: absolute; | ||
right: 3rem; | ||
bottom: 1rem; | ||
} | ||
/* Enter and leave animations can use different */ | ||
/* durations and timing functions. */ | ||
.slide-fade-enter-active { | ||
transition: all 0.1s ease; | ||
} | ||
.slide-fade-leave-active { | ||
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1); | ||
} | ||
.slide-fade-enter, .slide-fade-leave-to | ||
/* .slide-fade-leave-active below version 2.1.8 */ { | ||
transform: translateX(2rem); | ||
opacity: 0; | ||
} | ||
</style> |
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
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
Oops, something went wrong.