Skip to content

Commit

Permalink
fix: loader pass custom src
Browse files Browse the repository at this point in the history
  • Loading branch information
nahoc committed Sep 17, 2024
1 parent e500861 commit 5f03964
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ https://www.npmjs.com/package/@risc0/ui

| Statements | Branches | Functions | Lines |
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
| ![Statements](https://img.shields.io/badge/statements-37.25%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-73.75%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-60.46%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-37.25%25-red.svg?style=flat) |
| ![Statements](https://img.shields.io/badge/statements-37.37%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-73.75%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-60.46%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-37.37%25-red.svg?style=flat) |
7 changes: 5 additions & 2 deletions loader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export function Loader({ loadingText = "Loading…" }: { loadingText?: string }) {
export function Loader({
loadingSrc = "/loading.gif",
loadingText = "Loading…",
}: { loadingText?: string; loadingSrc?: string }) {
return (
<div className="mx-auto flex animate-fade-in-up flex-col items-center justify-center gap-3">
<img height={120} width={128} src="/loading.gif" alt="Loading" />
<img height={120} width={128} src={loadingSrc} alt="Loading" />
<p className="text-sm">{loadingText}</p>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@risc0/ui",
"version": "0.0.167",
"version": "0.0.168",
"private": false,
"sideEffects": false,
"type": "module",
Expand Down Expand Up @@ -44,18 +44,18 @@
"sonner": "1.5.0",
"string-ts": "2.2.0",
"tailwind-merge": "2.5.2",
"tailwindcss": "3.4.11",
"tailwindcss": "3.4.12",
"tailwindcss-animate": "1.0.7",
"typescript": "5.7.0-dev.20240912",
"vaul": "0.9.2"
},
"devDependencies": {
"@biomejs/biome": "1.9.0",
"@biomejs/biome": "1.9.1",
"@ladle/react": "4.1.1",
"@testing-library/jest-dom": "6.5.0",
"@testing-library/react": "16.0.1",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.12",
"@types/jest": "29.5.13",
"@vitejs/plugin-react-swc": "3.7.0",
"@vitest/coverage-v8": "2.0.5",
"deepmerge": "4.3.1",
Expand Down

0 comments on commit 5f03964

Please sign in to comment.