Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Erasmus <jerasmus@gitlab.com>2020-01-31 09:18:34 +0300
committerJacques Erasmus <jerasmus@gitlab.com>2020-01-31 09:18:34 +0300
commit43d9da52c205f1641434e4ef61de87eb558b0086 (patch)
tree5160c8fde84ab68d07636941b976674c55bb790e /content/frontend/components/banner/banner.vue
parent8c375387971976ac7e82cc2f661e21f154bb31df (diff)
parent8fdfc355aca320ccb6faf187fc484ee0b953efc4 (diff)
Merge branch '223-redirect-offline-versions' into 'master'
Redirect offline versions to the archives page Closes #223 See merge request gitlab-org/gitlab-docs!689
Diffstat (limited to 'content/frontend/components/banner/banner.vue')
-rw-r--r--content/frontend/components/banner/banner.vue39
1 files changed, 39 insertions, 0 deletions
diff --git a/content/frontend/components/banner/banner.vue b/content/frontend/components/banner/banner.vue
new file mode 100644
index 00000000..530bc9f0
--- /dev/null
+++ b/content/frontend/components/banner/banner.vue
@@ -0,0 +1,39 @@
+<script>
+export default {
+ props: {
+ text: {
+ type: String,
+ required: false,
+ default: '',
+ },
+ show: {
+ type: Boolean,
+ required: false,
+ default: true,
+ },
+ },
+ data() {
+ return {
+ isVisible: this.show
+ }
+ },
+ mounted() {
+ this.toggleBanner(this.isVisible);
+ },
+ methods: {
+ toggleBanner(isVisible) {
+ this.$emit('toggle', isVisible);
+ this.isVisible = isVisible;
+ },
+ },
+};
+</script>
+
+<template>
+ <div v-if="isVisible" class="banner position-fixed w-100 text-center">
+ <span v-if="text">{{ text }}</span>
+ <slot></slot>
+ <!-- TODO: Replace the 'x' below with a gl-icon component once gitlab-ui becomes available in the docs -->
+ <button class="btn btn-close pull-right" @click="toggleBanner(false)">x</button>
+ </div>
+</template>