Skip to content

Commit 1a1a3f4

Browse files
committed
refactor
1 parent 35ca353 commit 1a1a3f4

9 files changed

+177
-164
lines changed

package-lock.json

+109-95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createApp } from 'nativescript-vue';
22
import { useColorMode, useColorPalette } from "@vallemar/nativescript-vueuse";
3-
import Home from './components/Home.vue';
3+
import Home from './views/Home.vue';
44
import { PALETTES, THEMES } from "~/data";
55

66
/* Init Color mode and Palette */

src/components/Home.vue

-57
This file was deleted.

src/components/ColorModeView.vue renamed to src/views/ColorModeView.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script lang="ts" setup>
2+
import CustomPage from "@/components/CustomPage.vue";
23
import { ListItem } from "nativescript-vue";
34
import { useColorMode, useColorPalette } from "@vallemar/nativescript-vueuse";
45
import { Patelle, THEMES } from "~/data";
5-
import CustomPage from "./CustomPage.vue";
66
77
const { schema } = useColorMode({
88
onChanged: (mode) => {

src/components/ElementSizeView.vue renamed to src/views/ElementSizeView.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts" setup>
2+
import CustomPage from "@/components/CustomPage.vue";
23
import { ref } from "nativescript-vue";
34
import { useElementSize, unrefView } from "@vallemar/nativescript-vueuse";
4-
import CustomPage from "./CustomPage.vue";
55
66
const refView = ref()
77
const { width, height } = useElementSize(refView);

src/components/EventListenerComponent.vue renamed to src/views/EventListenerComponent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script lang="ts" setup>
2+
import CustomPage from "@/components/CustomPage.vue";
23
import { ref } from "nativescript-vue";
34
import { alert, StackLayout } from "@nativescript/core";
45
import { useEventListener } from "@vallemar/nativescript-vueuse";
5-
import CustomPage from "./CustomPage.vue";
66
77
const el = ref()
88

src/views/Home.vue

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<script lang="ts" setup>
2+
import {
3+
$navigateTo
4+
} from 'nativescript-vue';
5+
import ElementSizeView from "./ElementSizeView.vue";
6+
import ColorModeView from "./ColorModeView.vue";
7+
import EventListenerComponent from "./EventListenerComponent.vue";
8+
import RootLayoutView from './RootLayoutView.vue';
9+
import ScreenOrientationComponent from './ScreenOrientationComponent.vue';
10+
import CustomPage from '@/components/CustomPage.vue';
11+
import { useColorPalette } from '@vallemar/nativescript-vueuse';
12+
import { Patelle } from '~/data';
13+
14+
const { palette } = useColorPalette<string, Patelle>()
15+
16+
function onUseElementSize() {
17+
$navigateTo(ElementSizeView)
18+
}
19+
function onUseColorMode() {
20+
$navigateTo(ColorModeView)
21+
}
22+
23+
function onUseEventListener() {
24+
$navigateTo(EventListenerComponent)
25+
}
26+
27+
function onUseRootLayout() {
28+
$navigateTo(RootLayoutView)
29+
}
30+
31+
function onUseScreenOrientation() {
32+
$navigateTo(ScreenOrientationComponent)
33+
}
34+
35+
</script>
36+
37+
<template>
38+
<Frame :backgroundColor="palette?.colors.bg">
39+
<CustomPage>
40+
<ScrollView>
41+
<StackLayout ref="test" class="px-4">
42+
<Label text="NativeScript-VueUse APP" class="text-2xl font-bold mt-3" />
43+
<Button @tap="onUseElementSize" text="Use Element Size" class="mt-12 m-1"></Button>
44+
<Button @tap="onUseColorMode" text="Use Color Mode" class="mt-8 m-1"></Button>
45+
<Button @tap="onUseEventListener" text="Use Event Listener" class="mt-8 m-1"></Button>
46+
<Button @tap="onUseRootLayout" text="Use Root Layout" class="mt-8 m-1"></Button>
47+
<Button @tap="onUseScreenOrientation" text="Use Screen Orientation" class="mt-8 m-1"></Button>
48+
</StackLayout>
49+
</ScrollView>
50+
</CustomPage>
51+
</Frame>
52+
</template>
53+
54+
<style>
55+
/* .info {
56+
font-size: 20;
57+
} */
58+
</style>

src/components/rootLayout/RootLayoutView.vue renamed to src/views/RootLayoutView.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<script lang="ts" setup>
2-
import { ref, onMounted } from 'nativescript-vue'
2+
import BottomSheet from "@/components/rootLayout/BottomSheet.vue";
3+
import Modal from '@/components/rootLayout/Modal.vue';
4+
import SideBar from '@/components/rootLayout/SideBar.vue';
5+
import SnackBar from '@/components/rootLayout/SnackBar.vue';
6+
import CustomPage from "@/components/CustomPage.vue";
37
import { useRootLayout } from '@vallemar/nativescript-vueuse'
4-
import BottomSheet from "./BottomSheet.vue";
5-
import Modal from './Modal.vue';
6-
import SideBar from './SideBar.vue';
7-
import SnackBar from './SnackBar.vue';
8-
import CustomPage from '../CustomPage.vue';
9-
108
119
const { show: showBottomSheet } = useRootLayout(BottomSheet, {
1210
rootLayoutOption: {

src/components/ScreenOrientationComponent.vue renamed to src/views/ScreenOrientationComponent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" setup>
2+
import CustomPage from "@/components/CustomPage.vue";
23
import { useScreenOrientation } from '@vallemar/nativescript-vueuse';
3-
import CustomPage from './CustomPage.vue';
44
55
const {
66
orientation,

0 commit comments

Comments
 (0)