Skip to content

Commit

Permalink
Merge pull request #1456 from hypersign-protocol/feature/customTheme
Browse files Browse the repository at this point in the history
implemented custom theme
  • Loading branch information
Vishwas1 authored Jul 14, 2022
2 parents caf03eb + f478e20 commit 45de44e
Show file tree
Hide file tree
Showing 41 changed files with 251 additions and 95 deletions.
11 changes: 10 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="app">
<NavBar :title="name" :show="showUserNav" />
<NavBar :title="name" :show="showUserNav" :themeData="themeData" />
<!-- <NavBar title="Fyre" :show="showUserNav" /> -->

<!-- <div :class="[
Expand Down Expand Up @@ -59,6 +59,10 @@ export default {
},
data() {
return {
themeData: {
themeColor: "",
logoPath: ""
},
name: config.appName,
hover: false,
authToken: localStorage.getItem("authToken"),
Expand Down Expand Up @@ -159,6 +163,11 @@ export default {
this.isSubscribed = isSubscribed;
})
eventBus.$on("UpdateThemeEvent", (themeData) => {
Object.assign(this.themeData, { ...themeData })
})
if(this.$route.meta.admin){
this.showNavbar =
window.location.pathname.includes("/admin/participants") ||
Expand Down
8 changes: 6 additions & 2 deletions src/components/participant/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<template v-for="(actionItem, index) in ActionSchema">
<component v-if="actionItem.type==='INFO_TEXT'" :is="CapitaliseString(actionItem.type)" :key="index"
:idValue="index" :data="actionItem" :done="actionItem.isDone" :authToken="authToken"
@input="updateUserInfo(actionItem, $event)">
@input="updateUserInfo(actionItem, $event)" :themeData="themeData">
</component>
</template>

Expand All @@ -16,7 +16,7 @@

<component v-if="actionItem.type!=='INFO_TEXT'" :is="CapitaliseString(actionItem.type)" :key="index"
:idValue="index" :data="actionItem" :authToken="authToken" :done="actionItem.isDone"
@input="updateUserInfo(actionItem, $event)">
@input="updateUserInfo(actionItem, $event)" :themeData="themeData">
</component>
</template>
</div>
Expand Down Expand Up @@ -92,6 +92,10 @@ export default {
required: true,
type: Array,
},
themeData:{
required: true,
type: Object,
}
},
components: {
BinanceNetwork,
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BinanceErc20.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
components: {
Expand All @@ -94,8 +97,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BinanceErc721.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
components: {
Expand All @@ -95,8 +98,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BinanceNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
components: {
Expand All @@ -108,8 +111,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainAvax.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainBsc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainCardano.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainEth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainMatic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainOne.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainReef.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/BlockchainTez.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/DiscordJoin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/EthereumErc20.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
components: {
Expand All @@ -109,8 +112,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/EthereumErc721.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
components: {
Expand All @@ -93,8 +96,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/EthereumNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
components: {
Expand All @@ -100,8 +103,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/HyperlinkUrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,15 @@ export default {
done: {
required: true,
},
themeData: {
required: true,
}
},
computed: {
buttonThemeCss() {
return {
"--button-bg-color": config.app.buttonBgColor,
"--button-text-color": config.app.buttonTextColor,
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
};
},
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/participant/ActionInputs/InputDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ export default {
},
done: {
required: true,
},
themeData: {
required: true,
}
},
computed:{
buttonThemeCss() {
return {
'--button-bg-color': config.app.buttonBgColor,
'--button-text-color':config.app.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
}
}
},
Expand Down
Loading

0 comments on commit 45de44e

Please sign in to comment.