mirror of https://github.com/Lissy93/dashy.git
👷 Injects visible component object, making it available to sub-components
This commit is contained in:
parent
3de9beee41
commit
b214785c8a
24
src/App.vue
24
src/App.vue
|
@ -11,8 +11,17 @@
|
||||||
import Header from '@/components/PageStrcture/Header.vue';
|
import Header from '@/components/PageStrcture/Header.vue';
|
||||||
import Footer from '@/components/PageStrcture/Footer.vue';
|
import Footer from '@/components/PageStrcture/Footer.vue';
|
||||||
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
|
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
|
||||||
import Defaults, { localStorageKeys, splashScreenTime } from '@/utils/defaults';
|
import { componentVisibility } from '@/utils/ConfigHelpers';
|
||||||
import { config, appConfig, pageInfo } from '@/utils/ConfigAccumalator';
|
import ConfigAccumulator from '@/utils/ConfigAccumalator';
|
||||||
|
import {
|
||||||
|
localStorageKeys,
|
||||||
|
splashScreenTime,
|
||||||
|
visibleComponents as defaultVisibleComponents,
|
||||||
|
} from '@/utils/defaults';
|
||||||
|
|
||||||
|
const Accumulator = new ConfigAccumulator();
|
||||||
|
const config = Accumulator.config();
|
||||||
|
const visibleComponents = componentVisibility(config.appConfig) || defaultVisibleComponents;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
|
@ -23,13 +32,15 @@ export default {
|
||||||
},
|
},
|
||||||
provide: {
|
provide: {
|
||||||
config,
|
config,
|
||||||
|
visibleComponents,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showFooter: Defaults.visibleComponents.footer,
|
showFooter: visibleComponents.footer,
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
appConfig,
|
appConfig: Accumulator.appConfig(),
|
||||||
pageInfo,
|
pageInfo: Accumulator.pageInfo(),
|
||||||
|
visibleComponents,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -45,7 +56,8 @@ export default {
|
||||||
document.head.append(style);
|
document.head.append(style);
|
||||||
},
|
},
|
||||||
shouldShowSplash() {
|
shouldShowSplash() {
|
||||||
return this.appConfig.showSplashScreen || !localStorage[localStorageKeys.HIDE_WELCOME_BANNER];
|
return (this.visibleComponents || defaultVisibleComponents).splashScreen
|
||||||
|
|| !localStorage[localStorageKeys.HIDE_WELCOME_BANNER];
|
||||||
},
|
},
|
||||||
hideSplash() {
|
hideSplash() {
|
||||||
if (this.shouldShowSplash() && !this.shouldHidePageComponents()) {
|
if (this.shouldShowSplash() && !this.shouldHidePageComponents()) {
|
||||||
|
|
Loading…
Reference in New Issue