This repository was archived by the owner on Jun 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): create the subscriptions sub-section
- Loading branch information
Showing
24 changed files
with
311 additions
and
56 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
110 changes: 110 additions & 0 deletions
110
packages/@statusfy/core/client/components/Subscribe.vue
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,110 @@ | ||
<template> | ||
<div> | ||
<button | ||
class="btn" | ||
@click="toggleModal">{{ $t('notifications.subscribe') }}</button> | ||
|
||
<div | ||
v-show="isModalActive" | ||
class="modal-container" | ||
@click.self="toggleModal"> | ||
<div class="modal-body"> | ||
<div class="tabs-header"> | ||
<span | ||
v-for="(tab, key) in tabs" | ||
:key="key" | ||
:class="{'active': selectedTab === key}" | ||
@click="switchTab(key)"> | ||
{{ $t(`notifications.items.${key}.title`) }} | ||
</span> | ||
<span @click="toggleModal">{{ $t('notifications.close') }}</span> | ||
</div> | ||
|
||
<div class="tabs-container"> | ||
<div | ||
v-if="tabs.twitter" | ||
v-show="selectedTab === 'twitter'"> | ||
<a | ||
:href="`https://twitter.com/${$statusfy.notifications.twitter[$i18n.locale]}?ref_src=twsrc%5Etfw`" | ||
:data-lang="$i18n.locale" | ||
data-size="large" | ||
class="twitter-follow-button" | ||
data-show-count="false">Follow @{{ $statusfy.notifications.twitter[$i18n.locale] }}</a> | ||
<script | ||
async | ||
src="https://platform.twitter.com/widgets.js" | ||
charset="utf-8"/> | ||
| ||
<span v-html="$t('notifications.items.twitter.description', { username: tabs.twitter[$i18n.locale] })"/> | ||
</div> | ||
<div | ||
v-if="tabs.support" | ||
v-show="selectedTab === 'support'"> | ||
<span v-html="$t('notifications.items.support.description', { url: tabs.support[$i18n.locale] })"/> | ||
</div> | ||
<div | ||
v-if="tabs.icalendar && icalendarUrl" | ||
v-show="selectedTab === 'icalendar'"> | ||
<span v-html="$t('notifications.items.icalendar.description', { url: icalendarUrl })"/> | ||
</div> | ||
<div | ||
v-if="tabs.feeds" | ||
v-show="selectedTab === 'feeds'"> | ||
<span v-html="$t('notifications.items.feeds.description', { atom_url: feedsUrls.atom, rss_url: feedsUrls.rss })"/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
data () { | ||
return { | ||
isModalActive: false, | ||
selectedTab: null | ||
} | ||
}, | ||
computed: { | ||
tabs () { | ||
const results = {} | ||
const keys = Object.keys(this.$statusfy.notifications) | ||
keys.forEach(key => { | ||
if (this.$statusfy.notifications[key]) { | ||
results[key] = this.$statusfy.notifications[key] | ||
} | ||
}) | ||
this.switchTab(Object.keys(results)[0]) | ||
return results | ||
}, | ||
icalendarUrl () { | ||
if (process.client) { | ||
return `webcal://${window.location.hostname}/calendars/scheduled.${this.$i18n.locale}.ics` | ||
} else { | ||
return null | ||
} | ||
}, | ||
feedsUrls () { | ||
const atom = `//${window.location.hostname}/feeds/incidents.${this.$i18n.locale}.atom` | ||
const rss = `//${window.location.hostname}/feeds/incidents.${this.$i18n.locale}.xml` | ||
return { | ||
atom, | ||
rss | ||
} | ||
} | ||
}, | ||
methods: { | ||
toggleModal () { | ||
this.isModalActive = !this.isModalActive | ||
}, | ||
switchTab (key) { | ||
this.selectedTab = key | ||
} | ||
} | ||
} | ||
</script> |
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/check-circle-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/chevron-left-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/chevron-right-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/clock-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/exclamation-circle-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/external-link-alt-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/minus-circle-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/question-circle-regular.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/times-circle-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
1 change: 0 additions & 1 deletion
1
packages/@statusfy/core/client/components/icons/fortawesome/unlink-solid.js
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/* eslint-disable */ | ||
/* tslint:disable */ | ||
// @ts-ignore | ||
|
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.