Skip to content

Commit

Permalink
fix: move UI assets and add path aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
gmallios committed Mar 9, 2024
1 parent 959feea commit 4bad35f
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 12 deletions.
3 changes: 2 additions & 1 deletion manager-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"eslint-plugin-react": "^7.33.2",
"prettier": "^3.2.5",
"typescript": "^5.0.4",
"vite": "^5.1.5"
"vite": "^5.1.5",
"vite-tsconfig-paths": "^4.3.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 6 additions & 0 deletions manager-ui/src/assets/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module '*.jpg';
declare module '*.png';
declare module '*.svg';
declare module '*.gif';
declare module '*.jpeg';
declare module '*.webp';
16 changes: 8 additions & 8 deletions manager-ui/src/components/OverviewCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Box, Grid, Paper, Typography } from '@mui/material';
import A3951ImgLeft from './../assets/a3951_img_device_left.webp';
import A3951ImgRight from './../assets/a3951_img_device_right_edited.webp';
import A3027Img from './../assets/a3027_img_device.webp';
import A3028Img from './../assets/a3028_img_device.webp';
import A3029Img from './../assets/a3029_img_device.webp';
import A3040Img from './../assets/a3040_img_device.webp';
import A3935Img from './../assets/a3935_img_device.webp';
import A3951ImgLeft from '@assets/a3951_img_device_left.webp';
import A3951ImgRight from '@assets/a3951_img_device_right_edited.webp';
import A3027Img from '@assets/a3027_img_device.webp';
import A3028Img from '@assets/a3028_img_device.webp';
import A3029Img from '@assets/a3029_img_device.webp';
import A3040Img from '@assets/a3040_img_device.webp';
import A3935Img from '@assets/a3935_img_device.webp';

import BatteryAlertIcon from '@mui/icons-material/BatteryAlert';
import Battery20Icon from '@mui/icons-material/Battery20';
Expand All @@ -19,7 +19,7 @@ import BatteryCharging80Icon from '@mui/icons-material/BatteryCharging80';
import BatteryFullIcon from '@mui/icons-material/BatteryFull';
import BatteryChargingFullIcon from '@mui/icons-material/BatteryChargingFull';
import BatteryUnknownIcon from '@mui/icons-material/BatteryUnknown';
import { useBatteryLevel, useCharging, useDeviceModel } from '../hooks/useSoundcoreDevice';
import { useBatteryLevel, useCharging, useDeviceModel } from '@hooks/useSoundcoreDevice';

export default function OverviewCard() {
// if(levelQuery.isLoading || chargingQuery.isLoading) {
Expand Down
11 changes: 10 additions & 1 deletion manager-ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
"baseUrl": "./src",
"paths": {
"@assets/*": ["./assets/*"],
"@components/*": ["./components/*"],
"@screens/*": ["./screens/*"],
"@hooks/*": ["./hooks/*"],
"@stores/*": ["./stores/*"],
"@types/*": ["./types/*"]
}
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
3 changes: 2 additions & 1 deletion manager-ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [tsconfigPaths(), react()],

// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
// prevent vite from obscuring rust errors
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"private": true,
"scripts": {
"dev": "yarn workspace manager-ui dev",
"build": "yarn workspace manager-ui build",
"lint": "yarn workspace manager-ui lint",
"format": "yarn workspace manager-ui format",
"tauri": "tauri"
},
"devDependencies": {
Expand Down
21 changes: 20 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ d3-selection@3, d3-selection@^3.0.0:
resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-3.0.0.tgz#c25338207efa72cc5b9bd1458a1a41901f1e1b31"
integrity sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==

debug@^4.1.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4:
debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
Expand Down Expand Up @@ -1924,6 +1924,11 @@ globby@^11.1.0:
merge2 "^1.4.1"
slash "^3.0.0"

globrex@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==

gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
Expand Down Expand Up @@ -2930,6 +2935,11 @@ ts-api-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1"
integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==

tsconfck@^3.0.1:
version "3.0.3"
resolved "https://registry.yarnpkg.com/tsconfck/-/tsconfck-3.0.3.tgz#d9bda0e87d05b1c360e996c9050473c7e6f8084f"
integrity sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA==

tslib@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
Expand Down Expand Up @@ -3031,6 +3041,15 @@ use-sync-external-store@1.2.0, use-sync-external-store@^1.2.0:
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==

vite-tsconfig-paths@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.1.tgz#28762938151e7c80aec9d70c57e65ddce43a576f"
integrity sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==
dependencies:
debug "^4.1.1"
globrex "^0.1.2"
tsconfck "^3.0.1"

vite@^5.1.5:
version "5.1.5"
resolved "https://registry.yarnpkg.com/vite/-/vite-5.1.5.tgz#bdbc2b15e8000d9cc5172f059201178f9c9de5fb"
Expand Down

0 comments on commit 4bad35f

Please sign in to comment.