diff options
| author | Shpuld Shpludson <shp@cock.li> | 2020-07-05 06:53:29 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2020-07-05 06:53:29 +0000 |
| commit | af4a26b5882807d834c8fcfdf5d10121f63d18d5 (patch) | |
| tree | 6b56d027f3231c0a7c5a18cee1ebd6d010cd7e66 /src/components | |
| parent | acc3b083aa46aa9c165578380b16ef86e6fb596b (diff) | |
| parent | 9cac5d94dd78ea331254307871e876da7e266a6f (diff) | |
Merge branch 'feat/allow-use-without-cookies' into 'develop'
Fix #815: Allow use without cookies, Add a global notice popup system
Closes #815
See merge request pleroma/pleroma-fe!1166
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/global_notice_list/global_notice_list.js | 15 | ||||
| -rw-r--r-- | src/components/global_notice_list/global_notice_list.vue | 77 |
2 files changed, 92 insertions, 0 deletions
diff --git a/src/components/global_notice_list/global_notice_list.js b/src/components/global_notice_list/global_notice_list.js new file mode 100644 index 00000000..3af29c23 --- /dev/null +++ b/src/components/global_notice_list/global_notice_list.js @@ -0,0 +1,15 @@ + +const GlobalNoticeList = { + computed: { + notices () { + return this.$store.state.interface.globalNotices + } + }, + methods: { + closeNotice (notice) { + this.$store.dispatch('removeGlobalNotice', notice) + } + } +} + +export default GlobalNoticeList diff --git a/src/components/global_notice_list/global_notice_list.vue b/src/components/global_notice_list/global_notice_list.vue new file mode 100644 index 00000000..0e4285cc --- /dev/null +++ b/src/components/global_notice_list/global_notice_list.vue @@ -0,0 +1,77 @@ +<template> + <div class="global-notice-list"> + <div + v-for="(notice, index) in notices" + :key="index" + class="alert global-notice" + :class="{ ['global-' + notice.level]: true }" + > + <div class="notice-message"> + {{ $t(notice.messageKey, notice.messageArgs) }} + </div> + <i + class="button-icon icon-cancel" + @click="closeNotice(notice)" + /> + </div> + </div> +</template> + +<script src="./global_notice_list.js"></script> + +<style lang="scss"> +@import '../../_variables.scss'; + +.global-notice-list { + position: fixed; + top: 50px; + width: 100%; + pointer-events: none; + z-index: 1001; + display: flex; + flex-direction: column; + align-items: center; + + .global-notice { + pointer-events: auto; + text-align: center; + width: 40em; + max-width: calc(100% - 3em); + display: flex; + padding-left: 1.5em; + line-height: 2em; + .notice-message { + flex: 1 1 100%; + } + i { + flex: 0 0; + width: 1.5em; + cursor: pointer; + } + } + + .global-error { + background-color: var(--alertPopupError, $fallback--cRed); + color: var(--alertPopupErrorText, $fallback--text); + i { + color: var(--alertPopupErrorText, $fallback--text); + } + } + + .global-warning { + background-color: var(--alertPopupWarning, $fallback--cOrange); + color: var(--alertPopupWarningText, $fallback--text); + i { + color: var(--alertPopupWarningText, $fallback--text); + } + } + + .global-info { + background-color: var(--alertPopupNeutral, $fallback--fg); + color: var(--alertPopupNeutralText, $fallback--text); + i { + color: var(--alertPopupNeutralText, $fallback--text); + } + } +} +</style> |
