Skip to content

Commit

Permalink
refactor: optimize asset handling following Vite best practices
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ligsnf committed Dec 25, 2024
1 parent 5130ced commit c395d68
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 9 additions & 3 deletions src/components/csv/csv-information-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -47,9 +50,10 @@ export function CSVInformationDialog() {
Highlight the entire results table <span className="sm:hidden">with</span> <span className="hidden sm:inline">including the</span> headers
</p>
<img
src={`${siteConfig.basePath}img/select-results.png`}
src={resultsImage}
alt="Selecting academic results table in WES"
className="rounded-md border w-full aspect-[26/9] object-cover object-bottom"
decoding="async"
/>
</section>

Expand All @@ -59,9 +63,10 @@ export function CSVInformationDialog() {
Copy and paste into <a href="https://docs.google.com/spreadsheets/" className="underline hover:text-primary" target="_blank" rel="noreferrer">Google Sheets</a> or <span className="hidden sm:inline">Microsoft</span> Excel
</p>
<img
src={`${siteConfig.basePath}img/spreadsheet-view.png`}
src={spreadsheetImage}
alt="Pasted data in Google Sheets"
className="hidden sm:block rounded-md border w-full h-auto object-cover"
decoding="async"
/>
</section>

Expand All @@ -71,9 +76,10 @@ export function CSVInformationDialog() {
File → Download → <span className="hidden sm:inline">Comma-separated values</span> (.csv)
</p>
<img
src={`${siteConfig.basePath}img/save-dialog.png`}
src={saveFileImage}
alt="Saving as CSV in Google Sheets"
className="rounded-md border w-full aspect-video object-cover"
decoding="async"
/>
</section>

Expand Down

0 comments on commit c395d68

Please sign in to comment.