explore
@@ -72,20 +72,21 @@
+
+
\ No newline at end of file
diff --git a/src/components/app/Tabs/Explore/themesTemplate.vue b/src/components/app/Tabs/Explore/themesTemplate.vue
new file mode 100644
index 0000000..ec88dcd
--- /dev/null
+++ b/src/components/app/Tabs/Explore/themesTemplate.vue
@@ -0,0 +1,238 @@
+
+
+
+
+
+
+ {{theme.theme.name}}
+
+
+
{{theme.description}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/services/exploreService.js b/src/services/exploreService.js
index ecf78eb..8cd7b2a 100644
--- a/src/services/exploreService.js
+++ b/src/services/exploreService.js
@@ -1,6 +1,7 @@
import {instance, wrapper} from './Api';
export default {
+ // servers
getServersList (params) {
return wrapper(instance().get(`explore/servers${params || ''}`))
},
@@ -17,4 +18,22 @@ export default {
return wrapper(instance().post(`explore/servers`, data))
},
+ // themes
+ getThemes() {
+ return wrapper(instance().get(`explore/themes`));
+ },
+ getTheme(id) {
+ return wrapper(instance().get(`explore/themes/${id}`));
+ },
+ addTheme(id, data) {
+ return wrapper(instance().post(`explore/themes/${id}`, data))
+ },
+ updateTheme(id, data) {
+ return wrapper(instance().patch(`explore/themes/${id}`, data))
+ },
+ applyTheme(id) {
+ return wrapper(instance().get(`explore/themes/${id}/apply`));
+ }
+
+
}
\ No newline at end of file
diff --git a/src/utils/changelog.js b/src/utils/changelog.js
index 1d31542..c590a56 100644
--- a/src/utils/changelog.js
+++ b/src/utils/changelog.js
@@ -9,12 +9,22 @@ const prototype = {
};
const config = [
+ {
+ version: 8.9,
+ title: "Public Themes!",
+ shortTitle: "",
+ date: "7/21/2019",
+ headColor: "#007792",
+ new: [
+ "You can now make your themes public! Note: Making your theme public will require reviewing which may take few hours or days.",
+ ],
+
+ },
{
version: 8.8,
title: "Themes!",
shortTitle: "",
date: "29/11/2019",
- headColor: "#007792",
new: [
"You can now create your own themes in the settings popout using css! (You cannot share themes for now, that feature is coming soon though!)",
],
diff --git a/src/views/App.vue b/src/views/App.vue
index be6bc94..f920742 100644
--- a/src/views/App.vue
+++ b/src/views/App.vue
@@ -32,6 +32,7 @@ import ConnectingScreen from "./../components/app/ConnectingScreen.vue";
import Spinner from "./../components/Spinner.vue";
import MainNav from "./../components/app/MainNav.vue";
import ThemeService from '../services/ThemeService';
+import ExploreService from '../services/exploreService';
const ElectronFrameButtons = () =>
import("@/components/ElectronJS/FrameButtons.vue");
@@ -128,12 +129,26 @@ export default {
if (!themeAppliedID) {return;}
- const {ok, result, error} = await ThemeService.getTheme(themeAppliedID);
- if (!ok) { return; }
+ let exploreThemes = await ExploreService.applyTheme(themeAppliedID);
+ let privateThemes;
+ if (!exploreThemes.ok) {
+ privateThemes = await ThemeService.getTheme(themeAppliedID);
+ }
+ let id;
+ let css;
+ if (exploreThemes.ok) {
+ css = exploreThemes.result.data.css;
+ id = exploreThemes.result.data.id;
+ }
+ if (privateThemes) {
+ css = privateThemes.result.data.css;
+ id = privateThemes.result.data.id;
+ }
+ if (!id && !css) {return}
const styleEl = document.createElement('style');
styleEl.id = "theme"
- styleEl.classList.add('theme-' + result.data.id)
- styleEl.innerHTML = result.data.css
+ styleEl.classList.add('theme-' + id)
+ styleEl.innerHTML = css
document.head.innerHTML += styleEl.outerHTML;
}
},