Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: leverage jsx for settings (#866)
- Loading branch information
Showing
17 changed files
with
3,632 additions
and
1,691 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { mapGetters } from 'vuex'; | ||
import baseComponents from '@/static/json/components.json'; | ||
|
||
export default { | ||
computed: { | ||
...mapGetters('worldstate', { | ||
rawCS: 'componentState', | ||
}), | ||
activeComponents: { | ||
get() { | ||
return Object.keys(this.rawCS) | ||
.map((component) => this.rawCS[component]) | ||
.filter( | ||
(component) => | ||
component.display && (!baseComponents[component.key] || baseComponents[component.key].displayable) | ||
) | ||
.map((component) => component.key); | ||
}, | ||
set(enabledComponents) { | ||
Object.keys(this.rawCS).forEach((component) => { | ||
this.$store.commit('worldstate/commitComponentDisplayMode', [ | ||
component, | ||
enabledComponents.includes(component), | ||
]); | ||
}); | ||
}, | ||
}, | ||
componentStates() { | ||
return Object.keys(this.rawCS) | ||
.map((component) => { | ||
if (!baseComponents[component] || !baseComponents[component].displayable) { | ||
return false; | ||
} | ||
return { | ||
text: this.rawCS[component].displayName, | ||
value: this.rawCS[component].key, | ||
}; | ||
}) | ||
.filter((c) => c); | ||
}, | ||
}, | ||
render() { | ||
return ( | ||
<b-tab title="Components"> | ||
<b-form-group label="Components"> | ||
<b-form-checkbox-group | ||
id="components-checks" | ||
v-model={this.activeComponents} | ||
options={this.componentStates} | ||
switches | ||
stacked | ||
class="settings-group" | ||
></b-form-checkbox-group> | ||
</b-form-group> | ||
</b-tab> | ||
); | ||
}, | ||
}; |
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,51 @@ | ||
import { mapGetters } from 'vuex'; | ||
|
||
export default { | ||
name: 'FissureFilters', | ||
data() { | ||
return {}; | ||
}, | ||
computed: { | ||
...mapGetters('worldstate', { | ||
fissureStates: 'fissurePlanetStates', | ||
}), | ||
activeFissures: { | ||
get() { | ||
const planets = Object.keys(this.fissureStates).map((planet) => this.fissureStates[planet]); | ||
|
||
return planets.filter((planet) => planet.state).map((planet) => planet.value); | ||
}, | ||
set() {}, | ||
}, | ||
}, | ||
methods: { | ||
updateFissureStates(enabledFissures) { | ||
Object.keys(this.fissureStates).forEach((planet) => { | ||
this.$store.commit('worldstate/commitFissurePlanetState', [planet, enabledFissures.includes(planet)]); | ||
}); | ||
}, | ||
}, | ||
render() { | ||
return ( | ||
<b-tab title="Fissure Filters"> | ||
<div id="fissureTabBody"> | ||
Checking the checkbox next to a planet below will disable it from being shown in the fissures list. | ||
<div class="tab-wrap fit-height pt-3"> | ||
<b-form-group label="Fissure Filters"> | ||
<b-form-checkbox-group | ||
id="fissure-checks" | ||
v-model={this.activeFissures} | ||
name="Fissure Filters" | ||
options={this.fissureStates} | ||
switches | ||
stacked | ||
class="settings-group fissure-setting-group" | ||
input={(vals) => this.updateFissureStates(vals)} | ||
></b-form-checkbox-group> | ||
</b-form-group> | ||
</div> | ||
</div> | ||
</b-tab> | ||
); | ||
}, | ||
}; |
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.
41c65b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
warframe-hub – ./
hub.warframestat.us
warframe-hub-git-dev-wfcd.vercel.app
warframe-hub-wfcd.vercel.app