From c395d684f5e990f4407dec0ec06b1a09cf54fa1d Mon Sep 17 00:00:00 2001 From: Liangdi Date: Wed, 25 Dec 2024 14:50:28 +1100 Subject: [PATCH] refactor: optimize asset handling following Vite best practices - Move images from public/ to src/assets/ - Update image imports to use Vite's asset handling - Add decoding="async" for better performance - Changes based on https://vite.dev/guide/assets --- {public => src/assets}/img/save-dialog.png | Bin {public => src/assets}/img/select-results.png | Bin {public => src/assets}/img/spreadsheet-view.png | Bin src/components/csv/csv-information-dialog.tsx | 12 +++++++++--- 4 files changed, 9 insertions(+), 3 deletions(-) rename {public => src/assets}/img/save-dialog.png (100%) rename {public => src/assets}/img/select-results.png (100%) rename {public => src/assets}/img/spreadsheet-view.png (100%) diff --git a/public/img/save-dialog.png b/src/assets/img/save-dialog.png similarity index 100% rename from public/img/save-dialog.png rename to src/assets/img/save-dialog.png diff --git a/public/img/select-results.png b/src/assets/img/select-results.png similarity index 100% rename from public/img/select-results.png rename to src/assets/img/select-results.png diff --git a/public/img/spreadsheet-view.png b/src/assets/img/spreadsheet-view.png similarity index 100% rename from public/img/spreadsheet-view.png rename to src/assets/img/spreadsheet-view.png diff --git a/src/components/csv/csv-information-dialog.tsx b/src/components/csv/csv-information-dialog.tsx index c4da241..855fc2b 100644 --- a/src/components/csv/csv-information-dialog.tsx +++ b/src/components/csv/csv-information-dialog.tsx @@ -10,6 +10,9 @@ import { DialogTrigger, } from "@/components/ui/dialog" import { ScrollArea } from "@/components/ui/scroll-area" +import resultsImage from '@/assets/img/select-results.png' +import spreadsheetImage from '@/assets/img/spreadsheet-view.png' +import saveFileImage from '@/assets/img/save-dialog.png' export function CSVInformationDialog() { return ( @@ -47,9 +50,10 @@ export function CSVInformationDialog() { Highlight the entire results table with including the headers

Selecting academic results table in WES @@ -59,9 +63,10 @@ export function CSVInformationDialog() { Copy and paste into Google Sheets or Microsoft Excel

Pasted data in Google Sheets @@ -71,9 +76,10 @@ export function CSVInformationDialog() { File → Download → Comma-separated values (.csv)

Saving as CSV in Google Sheets