Skip to content

Commit 0471e45

Browse files
committed
fix(frontend): fix broken styles
1 parent 260d35e commit 0471e45

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

packages/frontend-shared/js/const.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,6 @@ export const ROLE_POLICIES = [
109109
'canImportUserLists',
110110
] as const;
111111

112-
// なんか動かない
113-
//export const CURRENT_STICKY_TOP = Symbol('CURRENT_STICKY_TOP');
114-
//export const CURRENT_STICKY_BOTTOM = Symbol('CURRENT_STICKY_BOTTOM');
115-
export const CURRENT_STICKY_TOP = 'CURRENT_STICKY_TOP';
116-
export const CURRENT_STICKY_BOTTOM = 'CURRENT_STICKY_BOTTOM';
117-
118112
export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://xn--931a.moe/assets/error.jpg';
119113
export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://xn--931a.moe/assets/not-found.jpg';
120114
export const DEFAULT_INFO_IMAGE_URL = 'https://xn--931a.moe/assets/info.jpg';

packages/frontend/src/components/global/MkStickyContainer.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@ SPDX-License-Identifier: AGPL-3.0-only
2323

2424
<script lang="ts" setup>
2525
import { onMounted, onUnmounted, provide, inject, ref, watch, useTemplateRef } from 'vue';
26-
import { CURRENT_STICKY_BOTTOM, CURRENT_STICKY_TOP } from '@@/js/const.js';
27-
import type { Ref } from 'vue';
26+
import { DI } from '@/di.js';
2827
2928
const rootEl = useTemplateRef('rootEl');
3029
const headerEl = useTemplateRef('headerEl');
3130
const footerEl = useTemplateRef('footerEl');
3231
3332
const headerHeight = ref<string | undefined>();
3433
const childStickyTop = ref(0);
35-
const parentStickyTop = inject<Ref<number>>(CURRENT_STICKY_TOP, ref(0));
36-
provide(CURRENT_STICKY_TOP, childStickyTop);
34+
const parentStickyTop = inject(DI.currentStickyTop, ref(0));
35+
provide(DI.currentStickyTop, childStickyTop);
3736
3837
const footerHeight = ref<string | undefined>();
3938
const childStickyBottom = ref(0);
40-
const parentStickyBottom = inject<Ref<number>>(CURRENT_STICKY_BOTTOM, ref(0));
41-
provide(CURRENT_STICKY_BOTTOM, childStickyBottom);
39+
const parentStickyBottom = inject(DI.currentStickyBottom, ref(0));
40+
provide(DI.currentStickyBottom, childStickyBottom);
4241
4342
const calc = () => {
4443
// コンポーネントが表示されてないけどKeepAliveで残ってる場合などは null になる

packages/frontend/src/di.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ export const DI = {
1212
mock: Symbol() as InjectionKey<boolean>,
1313
pageMetadata: Symbol() as InjectionKey<Ref<Record<string, any>>>,
1414
viewId: Symbol() as InjectionKey<string>,
15+
currentStickyTop: Symbol() as InjectionKey<Ref<number>>,
16+
currentStickyBottom: Symbol() as InjectionKey<Ref<number>>,
1517
};

packages/frontend/src/style.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ rt {
179179

180180
._pageScrollable {
181181
height: 100%;
182-
overflow: auto;
182+
overflow: clip;
183183
overflow-y: scroll;
184184
overscroll-behavior: contain;
185185
}
186186

187187
._pageScrollableReversed {
188188
height: 100%;
189-
overflow: auto;
189+
overflow: clip;
190190
overflow-y: scroll;
191191
overscroll-behavior: contain;
192192
display: flex;

packages/frontend/src/ui/universal.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ SPDX-License-Identifier: AGPL-3.0-only
9797
<script lang="ts" setup>
9898
import { defineAsyncComponent, provide, onMounted, computed, ref, watch, useTemplateRef } from 'vue';
9999
import { instanceName } from '@@/js/config.js';
100-
import { CURRENT_STICKY_BOTTOM } from '@@/js/const.js';
101100
import { isLink } from '@@/js/is-link.js';
102101
import XCommon from './_common_/common.vue';
103102
import type { Ref } from 'vue';
@@ -200,16 +199,13 @@ const onContextmenu = (ev) => {
200199
};
201200
202201
const navFooterHeight = ref(0);
203-
provide<Ref<number>>(CURRENT_STICKY_BOTTOM, navFooterHeight);
204202
205203
watch(navFooter, () => {
206204
if (navFooter.value) {
207205
navFooterHeight.value = navFooter.value.offsetHeight;
208-
window.document.body.style.setProperty('--MI-stickyBottom', `${navFooterHeight.value}px`);
209206
window.document.body.style.setProperty('--MI-minBottomSpacing', 'var(--MI-minBottomSpacingMobile)');
210207
} else {
211208
navFooterHeight.value = 0;
212-
window.document.body.style.setProperty('--MI-stickyBottom', '0px');
213209
window.document.body.style.setProperty('--MI-minBottomSpacing', '0px');
214210
}
215211
}, {

0 commit comments

Comments
 (0)