Skip to content

Commit

Permalink
feat(configuration): add dynamic explore banner (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenijesavic authored Sep 14, 2022
1 parent 3504910 commit 34ced1b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
22 changes: 20 additions & 2 deletions src/components/dao/settings-design.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export default {
isAdmin: {
type: Boolean,
default: false
},
isHypha: {
type: Boolean,
default: false
}
},
Expand Down Expand Up @@ -69,7 +74,20 @@ export default {
title: 'organisationTitle',
paragraph: 'organisationParagraph',
state: ''
}
},
...(this.isHypha
? [
{
key: 'EXPLORE',
label: 'Explore',
image: 'exploreBackgroundImage',
title: 'exploreTitle',
paragraph: 'exploreParagraph',
state: ''
}
]
: [])
],
logoBase64: null,
Expand Down Expand Up @@ -678,7 +696,7 @@ ${backgroundImage
color="accent"
dense
lazy-rules
maxlength="140"
maxlength="300"
outlined
placeholder="Max 140 characters"
ref="nickname"
Expand Down
12 changes: 10 additions & 2 deletions src/pages/dho/Configuration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const defaultSettings = {
organisationBackgroundImage: '',
organisationTitle: '',
organisationParagraph: ''
organisationParagraph: '',
exploreBackgroundImage: '',
exploreTitle: '',
exploreParagraph: ''
}
Expand Down Expand Up @@ -139,7 +143,11 @@ export default {
organisationBackgroundImage: this.daoSettings?.organisationBackgroundImage ? this.daoSettings?.organisationBackgroundImage : defaultSettings.organisationBackgroundImage,
organisationTitle: this.daoSettings?.organisationTitle ? this.daoSettings?.organisationTitle : defaultSettings.organisationTitle,
organisationParagraph: this.daoSettings?.organisationParagraph ? this.daoSettings?.organisationParagraph : defaultSettings.organisationParagraph
organisationParagraph: this.daoSettings?.organisationParagraph ? this.daoSettings?.organisationParagraph : defaultSettings.organisationParagraph,
exploreBackgroundImage: this.daoSettings?.exploreBackgroundImage ? this.daoSettings?.exploreBackgroundImage : defaultSettings.exploreBackgroundImage,
exploreTitle: this.daoSettings?.exploreTitle ? this.daoSettings?.exploreTitle : defaultSettings.exploreTitle,
exploreParagraph: this.daoSettings?.exploreParagraph ? this.daoSettings?.exploreParagraph : defaultSettings.exploreParagraph
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/dho/Explore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export default {
banner () {
return {
title: 'Discover the Hypha DAO network',
description: 'Welcome to the global DAO directory! Click on any card to open the DAO and to take a look under the hood. You can learn more about them, apply as a member or simply take a look around.',
background: ipfsy(this.daoSettings.dashboardBackgroundImage),
title: this.daoSettings.exploreTitle || 'Discover the Hypha DAO network',
description: this.daoSettings.exploreParagraph || 'Welcome to the global DAO directory! Click on any card to open the DAO and to take a look under the hood. You can learn more about them, apply as a member or simply take a look around.',
background: ipfsy(this.daoSettings.exploreBackgroundImage),
color: this.daoSettings.primaryColor,
pattern: this.daoSettings.pattern,
patternColor: this.daoSettings.patternColor,
Expand Down
4 changes: 4 additions & 0 deletions src/query/dao-active.gql
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ query activeDao($regexp: String!) {
settings_organisationBackgroundImage_s
settings_organisationTitle_s
settings_organisationParagraph_s

settings_exploreBackgroundImage_s
settings_exploreTitle_s
settings_exploreParagraph_s
}
}
}
5 changes: 4 additions & 1 deletion src/store/dao/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ export const switchDao = (state, daos) => {

organisationBackgroundImage: settings?.settings_organisationBackgroundImage_s,
organisationTitle: settings?.settings_organisationTitle_s,
organisationParagraph: settings?.settings_organisationParagraph_s
organisationParagraph: settings?.settings_organisationParagraph_s,

exploreBackgroundImage: settings?.settings_exploreBackgroundImage_s,
exploreTitle: settings?.settings_exploreTitle_s,
exploreParagraph: settings?.settings_exploreParagraph_s
}
}
}
Expand Down

0 comments on commit 34ced1b

Please sign in to comment.