|
1 | 1 | <template>
|
2 | 2 | <Header />
|
3 | 3 | <HeroSection />
|
4 |
| - <Roadmap /> |
| 4 | + <client-only> |
| 5 | + <Roadmap /> |
| 6 | + </client-only> |
5 | 7 | <Teleport to="body">
|
6 | 8 | <div v-if="content" :class="['fixed top-0 h-screen', sidebarClass]">
|
7 | 9 | <div
|
|
17 | 19 | : 'border-gray-300 dark:border-white mb-2 py-2 dark:backdrop-blur-2xl',
|
18 | 20 | ]"
|
19 | 21 | >
|
20 |
| - <Dropdown |
21 |
| - ref="statusDropDown" |
22 |
| - :customTriggerClass=" |
23 |
| - 'px-3 py-1 hover:bg-orange-100 dark:hover:bg-black dark:border-white border' + status.toLowerCase()" |
24 |
| - :border="false" |
25 |
| - > |
26 |
| - <!-- trigger element --> |
27 |
| - <template #trigger> |
28 |
| - <button type="button" v-text="status" /> |
29 |
| - </template> |
30 |
| - |
31 |
| - <!-- contents display in dropdown --> |
32 |
| - <ul class="flex flex-col bg-orange-100 dark:bg-[#131313]"> |
33 |
| - <li |
34 |
| - v-for="(s, i) in allStatus" |
35 |
| - :key="'status-' + i" |
36 |
| - @click="changeStatus(s)" |
37 |
| - :class="[ |
38 |
| - 'px-4 py-2 hover:cursor-pointer border-b border-orange-200 dark:border-gray-500 hover:bg-orange-50 dark:hover:bg-black', |
39 |
| - s.toLowerCase(), |
40 |
| - ]" |
41 |
| - v-text="s" |
42 |
| - ></li> |
43 |
| - </ul> |
44 |
| - </Dropdown> |
| 22 | + <client-only> |
| 23 | + <ReadStatus :name="nodeId" /> |
| 24 | + </client-only> |
45 | 25 | <span
|
46 | 26 | class="hover:cursor-pointer dark:text-white"
|
47 | 27 | @click="closeSidebar"
|
@@ -100,18 +80,13 @@ import { useRoute, useRouter } from "vue-router";
|
100 | 80 | import { ref, onMounted } from "vue";
|
101 | 81 | import Roadmap from "@/components/Roadmap.vue";
|
102 | 82 | import HeroSection from "@/layouts/hero.vue";
|
103 |
| -import Dropdown from "v-dropdown"; |
104 |
| -
|
105 |
| -const { $locally } = useNuxtApp(); |
| 83 | +import ReadStatus from "@/components/sidebar/ReadStatus.vue"; |
106 | 84 |
|
107 |
| -const allStatus = ["Pendiente", "Leyendo", "Completado", "Omitir"]; |
108 | 85 | const { push } = useRouter();
|
109 | 86 | const route = useRoute();
|
110 | 87 | const nodeId = route.params.slug;
|
111 | 88 | const showSidebar = ref(true);
|
112 | 89 | const content = ref(null);
|
113 |
| -const statusDropDown = ref(null); |
114 |
| -const status = ref($locally.get(nodeId) ?? "Pendiente"); |
115 | 90 | const isScrolled = ref(false);
|
116 | 91 |
|
117 | 92 | useSeoMeta({
|
@@ -145,41 +120,10 @@ const onScroll = (e) => {
|
145 | 120 | const sidebarClass = computed(() =>
|
146 | 121 | showSidebar.value ? "right-0 w-screen lg:w-2/4" : "w-screen"
|
147 | 122 | );
|
148 |
| -
|
149 |
| -function changeStatus(val) { |
150 |
| - if (val == status.value) return; |
151 |
| - if (!statusDropDown.value) return; |
152 |
| - status.value = val; |
153 |
| - $locally.set(nodeId, val); |
154 |
| - statusDropDown.value.close(); |
155 |
| -} |
156 | 123 | </script>
|
157 | 124 |
|
158 | 125 | <style>
|
159 |
| -.pendiente::before, |
160 |
| -.leyendo::before, |
161 |
| -.completado::before, |
162 |
| -.omitir::before { |
163 |
| - content: "•"; |
164 |
| - margin-right: 5px; |
165 |
| -} |
166 |
| -
|
167 |
| -.pendiente::before { |
168 |
| - color: var(--tw-text-gray-950); |
169 |
| -} |
170 |
| -.leyendo::before { |
171 |
| - color: var(--tw-text-orange-500); |
172 |
| -} |
173 |
| -.completado::before { |
174 |
| - color: var(--tw-text-green-600); |
175 |
| -} |
176 |
| -.omitir::before { |
177 |
| - color: var(--tw-text-slate-500); |
178 |
| -} |
179 | 126 | article [id] {
|
180 | 127 | scroll-margin-top: 3.5rem;
|
181 | 128 | }
|
182 |
| -.v-dropdown-container.v-dropdown-no-border { |
183 |
| - border-radius: 0px !important; |
184 |
| -} |
185 | 129 | </style>
|
0 commit comments