Skip to content

Commit

Permalink
fix: remove @import who is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
batleforc committed Jan 17, 2025
1 parent bbe7b34 commit c6ff8b4
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 71 deletions.
48 changes: 24 additions & 24 deletions apps/front/src/component/Doc/DocSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,48 @@ const docStore = useDocStore();
let path = ref(Array.isArray(route.params.page) ? route.params.page : [route.params.page]);
watch(() => route.params.page, (newValue, oldValue) => {
if (newValue !== oldValue) {
path.value = Array.isArray(newValue) ? newValue : [newValue];
}
if (newValue !== oldValue) {
path.value = Array.isArray(newValue) ? newValue : [newValue];
}
});
let showMobileSidebar = ref(false);
</script>

<template>
<aside class="docSidebar" :class="showMobileSidebar ? 'docSidebarShowMobile' : ''">
<RouterLink :to="{ name: 'doc' }">Doc Home</RouterLink>
<DocSidebarItem :path="path" v-for="categorie in docStore.docContent.sub_categories" v-bind:key="categorie.name"
:docContent="categorie" />
</aside>
<div class="docSidebarMobile">
<button @click="showMobileSidebar = !showMobileSidebar">
<IcoMoonSVG icon="burger" />
</button>
</div>
<aside class="docSidebar" :class="showMobileSidebar ? 'docSidebarShowMobile' : ''">
<RouterLink :to="{ name: 'doc' }">Doc Home</RouterLink>
<DocSidebarItem :path="path" v-for="categorie in docStore.docContent.sub_categories" v-bind:key="categorie.name"
:docContent="categorie" />
</aside>
<div class="docSidebarMobile">
<button @click="showMobileSidebar = !showMobileSidebar">
<IcoMoonSVG icon="burger" />
</button>
</div>
</template>

<style lang="scss">
@import "../../var.scss";
@use "../../var.scss" as *;
.docSidebar {
@apply border-r-2 min-w-48 px-4 py-2 hidden md:flex flex-col sticky;
background-color: $color-bgCover;
color: $color-textCover;
@apply border-r-2 min-w-48 px-4 py-2 hidden md:flex flex-col sticky;
background-color: $color-bgCover;
color: $color-textCover;
}
.docSidebarShowMobile {
@apply flex;
@apply flex;
}
.docSidebarMobile {
@apply md:hidden fixed bottom-0 right-0 p-2 m-2;
background-color: $color-bgCover;
color: $color-textCover;
@apply md:hidden fixed bottom-0 right-0 p-2 m-2;
background-color: $color-bgCover;
color: $color-textCover;
.ico-burger {
@apply text-2xl;
}
.ico-burger {
@apply text-2xl;
}
}
</style>
2 changes: 1 addition & 1 deletion apps/front/src/component/Doc/DocSidebarItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const sidebarOpen = ref(fromOpen.value);
</template>

<style lang="scss">
@import "../../var.scss";
@use "../../var.scss" as *;
.docSidebarTitle {
@apply cursor-pointer flex justify-between;
Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/component/Page/PageMetadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ defineProps<{
</template>

<style lang="scss">
@import '../../var.scss';
@use '../../var.scss' as *;
.pageHeaderTechno,
.pageHeaderTag,
Expand Down
2 changes: 1 addition & 1 deletion apps/front/src/styles/DocView.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../var.scss";
@use "../var.scss" as *;

.docContainer {
@apply flex grow h-full absolute top-0 w-full pt-16;
Expand Down
42 changes: 21 additions & 21 deletions apps/front/src/views/DocHomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@ import { usePageStore } from '../stores/page';
const docStore = useDocStore();
const pageStore = usePageStore();
if (!docStore.inited && !docStore.docLoading) {
docStore.init().then((data) => {
if (data && data.has_index) {
pageStore.fetchPage("index");
}
});
docStore.init().then((data) => {
if (data && data.has_index) {
pageStore.fetchPage("index");
}
});
}
if (docStore.inited && docStore.docContent.has_index && pageStore.pageLoading === false && pageStore.pagePath !== "index") {
pageStore.fetchPage("index");
pageStore.fetchPage("index");
}
</script>

<template>
<div id="title" class="docContainer" v-if="docStore.inited">
<DocSidebar />
<div class="docContent">
<div class="docRealContent" v-if="docStore.docContent.has_index && pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
<div v-if="!docStore.docContent.has_index">
<h1>Doc home page</h1>
<p>There is no index page for this documentation</p>
</div>
<footer class="docFooter">
<p>Made with love and too much coffee @Batleforc - {{ new Date().getFullYear() }}</p>
</footer>
</div>
<div id="title" class="docContainer" v-if="docStore.inited">
<DocSidebar />
<div class="docContent">
<div class="docRealContent" v-if="docStore.docContent.has_index && pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
<div v-if="!docStore.docContent.has_index">
<h1>Doc home page</h1>
<p>There is no index page for this documentation</p>
</div>
<footer class="docFooter">
<p>Made with love and too much coffee @Batleforc - {{ new Date().getFullYear() }}</p>
</footer>
</div>
</div>
</template>

<style lang="scss">
@import "../styles/DocView.scss";
@use "../styles/DocView.scss";
</style>
46 changes: 23 additions & 23 deletions apps/front/src/views/DocView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,47 @@ import PageRender from '../component/Page/PageRender.vue';
const route = useRoute();
let pathReactive = computed(() => {
return (Array.isArray(route.params.page) ? route.params.page : [route.params.page]).join('/');
return (Array.isArray(route.params.page) ? route.params.page : [route.params.page]).join('/');
});
const docStore = useDocStore();
const pageStore = usePageStore();
if (!docStore.inited && !docStore.docLoading) {
docStore.init().then(() => {
pageStore.fetchPage(pathReactive.value);
});
docStore.init().then(() => {
pageStore.fetchPage(pathReactive.value);
});
}
else if (pageStore.pageLoading === false && pageStore.pagePath !== pathReactive.value) {
pageStore.fetchPage(pathReactive.value);
pageStore.fetchPage(pathReactive.value);
}
watch(pathReactive, (newVal) => {
if (pageStore.pageLoading === false && pageStore.pagePath !== newVal) {
pageStore.fetchPage(newVal);
}
if (pageStore.pageLoading === false && pageStore.pagePath !== newVal) {
pageStore.fetchPage(newVal);
}
});
</script>

<template>
<div id="title" class="docContainer" v-if="docStore.inited">
<DocSidebar />
<div class="docContent">
<div class="docRealContent" v-if="pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
<div v-if="!pageStore.pageLoading && pageStore.page === undefined">
<h1>Doc home page</h1>
<p>There is no index page for this documentation</p>
</div>
<footer class="docFooter">
<p>Made with love and too much coffee @Batleforc - {{ new Date().getFullYear() }}</p>
</footer>
</div>
<div id="title" class="docContainer" v-if="docStore.inited">
<DocSidebar />
<div class="docContent">
<div class="docRealContent" v-if="pageStore.page !== undefined">
<PageRender :page="pageStore.page" />
</div>
<div v-if="!pageStore.pageLoading && pageStore.page === undefined">
<h1>Doc home page</h1>
<p>There is no index page for this documentation</p>
</div>
<footer class="docFooter">
<p>Made with love and too much coffee @Batleforc - {{ new Date().getFullYear() }}</p>
</footer>
</div>
</div>

</template>

<style lang="scss">
@import "../styles/DocView.scss";
@use "../styles/DocView.scss";
</style>

0 comments on commit c6ff8b4

Please sign in to comment.