mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 10:23:41 +00:00
Merge pull request #26 from jhbruhn/fix/skeleton-fixes
Some checks failed
Build, Test, and Lint / Build, Test, and Lint (push) Has been cancelled
Draft Release / Draft Release (push) Has been cancelled
Draft Release / Build Web App (push) Has been cancelled
Draft Release / Build Release - macos-latest (push) Has been cancelled
Draft Release / Build Release - ubuntu-latest (push) Has been cancelled
Draft Release / Build Release - windows-latest (push) Has been cancelled
Draft Release / Upload to GitHub Release (push) Has been cancelled
Some checks failed
Build, Test, and Lint / Build, Test, and Lint (push) Has been cancelled
Draft Release / Draft Release (push) Has been cancelled
Draft Release / Build Web App (push) Has been cancelled
Draft Release / Build Release - macos-latest (push) Has been cancelled
Draft Release / Build Release - ubuntu-latest (push) Has been cancelled
Draft Release / Build Release - windows-latest (push) Has been cancelled
Draft Release / Upload to GitHub Release (push) Has been cancelled
Fix: skeleton fixes and upload button disable logic
This commit is contained in:
commit
ea879640a2
5 changed files with 65 additions and 16 deletions
|
|
@ -256,16 +256,34 @@ export function FileUpload() {
|
||||||
onChange={handleFileChange}
|
onChange={handleFileChange}
|
||||||
id="file-input"
|
id="file-input"
|
||||||
className="hidden"
|
className="hidden"
|
||||||
disabled={isLoading || patternUploaded || isUploading}
|
disabled={
|
||||||
|
isLoading ||
|
||||||
|
patternUploaded ||
|
||||||
|
isUploading ||
|
||||||
|
(uploadProgress > 0 && !patternUploaded)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
asChild={!fileService.hasNativeDialogs()}
|
asChild={
|
||||||
|
!fileService.hasNativeDialogs() &&
|
||||||
|
!(
|
||||||
|
isLoading ||
|
||||||
|
patternUploaded ||
|
||||||
|
isUploading ||
|
||||||
|
(uploadProgress > 0 && !patternUploaded)
|
||||||
|
)
|
||||||
|
}
|
||||||
onClick={
|
onClick={
|
||||||
fileService.hasNativeDialogs()
|
fileService.hasNativeDialogs()
|
||||||
? () => handleFileChange()
|
? () => handleFileChange()
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
disabled={isLoading || patternUploaded || isUploading}
|
disabled={
|
||||||
|
isLoading ||
|
||||||
|
patternUploaded ||
|
||||||
|
isUploading ||
|
||||||
|
(uploadProgress > 0 && !patternUploaded)
|
||||||
|
}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="flex-[2]"
|
className="flex-[2]"
|
||||||
>
|
>
|
||||||
|
|
@ -289,7 +307,10 @@ export function FileUpload() {
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<label htmlFor="file-input" className="flex items-center gap-2">
|
<label
|
||||||
|
htmlFor="file-input"
|
||||||
|
className="flex items-center gap-2 cursor-pointer"
|
||||||
|
>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<>
|
<>
|
||||||
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,13 @@ export function PatternInfo({
|
||||||
.join(" ");
|
.join(" ");
|
||||||
|
|
||||||
// Secondary metadata: chart and description
|
// Secondary metadata: chart and description
|
||||||
const secondaryMetadata = [color.chart, color.description]
|
// Only show chart if it's different from catalogNumber
|
||||||
|
const secondaryMetadata = [
|
||||||
|
color.chart && color.chart !== color.catalogNumber
|
||||||
|
? color.chart
|
||||||
|
: null,
|
||||||
|
color.description,
|
||||||
|
]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(" ");
|
.join(" ");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -281,8 +281,13 @@ export function ProgressMonitor() {
|
||||||
.join(" ");
|
.join(" ");
|
||||||
|
|
||||||
// Secondary metadata: chart and description
|
// Secondary metadata: chart and description
|
||||||
|
// Only show chart if it's different from catalogNumber
|
||||||
const secondaryMetadata = [
|
const secondaryMetadata = [
|
||||||
block.threadChart,
|
block.threadChart &&
|
||||||
|
block.threadChart !==
|
||||||
|
block.threadCatalogNumber
|
||||||
|
? block.threadChart
|
||||||
|
: null,
|
||||||
block.threadDescription,
|
block.threadDescription,
|
||||||
]
|
]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
|
|
|
||||||
|
|
@ -65,16 +65,33 @@ export function PatternCanvasSkeleton() {
|
||||||
|
|
||||||
export function PatternInfoSkeleton() {
|
export function PatternInfoSkeleton() {
|
||||||
return (
|
return (
|
||||||
<div className="mt-4">
|
<div className="mb-3">
|
||||||
<SkeletonLoader className="h-6 w-40 mb-4" variant="text" />
|
{/* Three column grid matching PatternInfo stats */}
|
||||||
<div className="bg-gray-200 dark:bg-gray-900 p-4 rounded-lg space-y-3">
|
<div className="grid grid-cols-3 gap-2 text-xs mb-2">
|
||||||
{[1, 2, 3, 4].map((i) => (
|
{[1, 2, 3].map((i) => (
|
||||||
<div key={i} className="flex justify-between">
|
<div key={i} className="bg-gray-200 dark:bg-gray-700/50 p-2 rounded">
|
||||||
<SkeletonLoader className="h-4 w-24" variant="text" />
|
<SkeletonLoader className="h-3 w-12 mb-1" variant="text" />
|
||||||
<SkeletonLoader className="h-4 w-32" variant="text" />
|
<SkeletonLoader className="h-4 w-16" variant="text" />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Separator */}
|
||||||
|
<div className="h-px bg-gray-200 dark:bg-gray-700 mb-3" />
|
||||||
|
|
||||||
|
{/* Color swatches row */}
|
||||||
|
<div className="flex items-center gap-2 mb-2">
|
||||||
|
<SkeletonLoader className="h-3 w-12" variant="text" />
|
||||||
|
<div className="flex gap-1">
|
||||||
|
{[1, 2, 3, 4, 5].map((i) => (
|
||||||
|
<SkeletonLoader
|
||||||
|
key={i}
|
||||||
|
className="w-3 h-3 rounded-full"
|
||||||
|
variant="circle"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { clsx, type ClassValue } from "clsx"
|
import { clsx, type ClassValue } from "clsx";
|
||||||
import { twMerge } from "tailwind-merge"
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue