mirror of
https://github.com/codex-storage/codex-marketplace-ui.git
synced 2025-02-24 05:38:18 +00:00
Bump dependencies and invalidate query on upload success
This commit is contained in:
parent
a58bae9d30
commit
ed57e61703
9
package-lock.json
generated
9
package-lock.json
generated
@ -9,7 +9,7 @@
|
|||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codex-storage/marketplace-ui-components": "0.0.11",
|
"@codex-storage/marketplace-ui-components": "0.0.12",
|
||||||
"@codex-storage/sdk-js": "0.0.6",
|
"@codex-storage/sdk-js": "0.0.6",
|
||||||
"@sentry/browser": "^8.32.0",
|
"@sentry/browser": "^8.32.0",
|
||||||
"@sentry/react": "^8.31.0",
|
"@sentry/react": "^8.31.0",
|
||||||
@ -342,9 +342,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@codex-storage/marketplace-ui-components": {
|
"node_modules/@codex-storage/marketplace-ui-components": {
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.12.tgz",
|
||||||
"integrity": "sha512-io1VVsSIeO3TYTyEvaeeY7eLXQNxBmYixMeWn3NnV3PQNd2VLivobd8oYpwQ6o9vRDGNDJ2ZEdftS4Bwe+eD2w==",
|
"integrity": "sha512-XwyyV8kaS+AEIwqzw2BP28qXww1VlH6aRLQsGOTwyjZJiXJEJXjoYLF+CoQmpU0P9rMwSaHFIJdEZK+t4nY9qg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-react": "^0.441.0"
|
"lucide-react": "^0.441.0"
|
||||||
},
|
},
|
||||||
@ -353,7 +353,6 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@codex-storage/sdk-js": "0.0.6",
|
"@codex-storage/sdk-js": "0.0.6",
|
||||||
"@tanstack/react-query": "^5.51.24",
|
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"React"
|
"React"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codex-storage/marketplace-ui-components": "0.0.11",
|
"@codex-storage/marketplace-ui-components": "0.0.12",
|
||||||
"@codex-storage/sdk-js": "0.0.6",
|
"@codex-storage/sdk-js": "0.0.6",
|
||||||
"@sentry/browser": "^8.32.0",
|
"@sentry/browser": "^8.32.0",
|
||||||
"@sentry/react": "^8.31.0",
|
"@sentry/react": "^8.31.0",
|
||||||
|
@ -10,12 +10,14 @@ import {
|
|||||||
} from "@codex-storage/marketplace-ui-components";
|
} from "@codex-storage/marketplace-ui-components";
|
||||||
import { useData } from "../../hooks/useData";
|
import { useData } from "../../hooks/useData";
|
||||||
import { StorageRequestComponentProps } from "./types";
|
import { StorageRequestComponentProps } from "./types";
|
||||||
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
export function StorageRequestFileChooser({
|
export function StorageRequestFileChooser({
|
||||||
storageRequest,
|
storageRequest,
|
||||||
dispatch,
|
dispatch,
|
||||||
onStorageRequestChange,
|
onStorageRequestChange,
|
||||||
}: StorageRequestComponentProps) {
|
}: StorageRequestComponentProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
const files = useData();
|
const files = useData();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -36,6 +38,7 @@ export function StorageRequestFileChooser({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onSuccess = (data: string) => {
|
const onSuccess = (data: string) => {
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["cids"] });
|
||||||
onStorageRequestChange({ cid: data });
|
onStorageRequestChange({ cid: data });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,23 +3,21 @@ import { Files } from "../../components/Files/Files.tsx";
|
|||||||
import { Card, Upload } from "@codex-storage/marketplace-ui-components";
|
import { Card, Upload } from "@codex-storage/marketplace-ui-components";
|
||||||
import { CodexSdk } from "../../sdk/codex";
|
import { CodexSdk } from "../../sdk/codex";
|
||||||
import { Welcome } from "../../components/Welcome/Welcome.tsx";
|
import { Welcome } from "../../components/Welcome/Welcome.tsx";
|
||||||
import { FilesStorage } from "../../utils/file-storage";
|
|
||||||
import { ErrorPlaceholder } from "../../components/ErrorPlaceholder/ErrorPlaceholder.tsx";
|
import { ErrorPlaceholder } from "../../components/ErrorPlaceholder/ErrorPlaceholder.tsx";
|
||||||
import { ErrorBoundary } from "@sentry/react";
|
import { ErrorBoundary } from "@sentry/react";
|
||||||
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
export const Route = createFileRoute("/dashboard/")({
|
export const Route = createFileRoute("/dashboard/")({
|
||||||
component: About,
|
component: About,
|
||||||
});
|
});
|
||||||
|
|
||||||
const onSuccess = (cid: string, file: File) => {
|
|
||||||
FilesStorage.set(cid, {
|
|
||||||
name: file.name,
|
|
||||||
mimetype: file.type,
|
|
||||||
uploadedAt: new Date().toJSON(),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function About() {
|
function About() {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
const onSuccess = () => {
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["cids"] });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="dashboard">
|
<div className="dashboard">
|
||||||
@ -49,10 +47,12 @@ function About() {
|
|||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
fallback={({ error }) => (
|
fallback={({ error }) => (
|
||||||
|
<Card title="Error">
|
||||||
<ErrorPlaceholder
|
<ErrorPlaceholder
|
||||||
error={error}
|
error={error}
|
||||||
subtitle="Cannot retrieve the data."
|
subtitle="Cannot retrieve the data."
|
||||||
/>
|
/>
|
||||||
|
</Card>
|
||||||
)}>
|
)}>
|
||||||
<Files />
|
<Files />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user