Skip to content

Commit

Permalink
Use VueUse instead of Vue-MQ for screen size detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvonen committed Dec 22, 2023
1 parent bce6e77 commit a947024
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 133 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ module.exports = {
extends: ['plugin:cypress/recommended'],
},
],
rules: {
'vue/no-setup-props-destructure': 0,
},
parserOptions: {
ecmaVersion: 'latest',
},
Expand Down
155 changes: 134 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"@mdi/font": "^7.3.67",
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.3",
"@vueuse/core": "^10.7.0",
"pinia": "^2.1.6",
"ramda": "^0.29.1",
"uuid": "^9.0.1",
"vue": "^3.3.4",
"vue-i18n": "^9.5.0",
"vue-router": "^4.2.5",
"vue3-mq": "^3.1.3",
"vuedraggable": "^4.1.0",
"vuetify": "3.3.6"
},
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/screenSize.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {computed} from 'vue';
import {useMq} from 'vue3-mq';
import {useWindowSize} from '@vueuse/core';

export default function useScreenSize() {
const mq = useMq();
const isSmallScreen = computed(() => mq.current === 'xs');
const {width} = useWindowSize();
const isSmallScreen = computed(() => width.value < 600);
return {isSmallScreen};
}
99 changes: 0 additions & 99 deletions src/vue3-mq.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@ const dataTestIdPlugin = (wrapper: VueWrapper) => ({
});

config.plugins.VueWrapper.install(dataTestIdPlugin);

vi.mock('vue3-mq', () => ({
useMq: () => ({
current: 'lg',
}),
}));

0 comments on commit a947024

Please sign in to comment.