Skip to content

Commit

Permalink
change ladning page
Browse files Browse the repository at this point in the history
  • Loading branch information
vwh committed Jul 24, 2024
1 parent 8329e2f commit e029dca
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 29 deletions.
42 changes: 20 additions & 22 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,26 @@ function App() {

return (
<>
<div className="flex flex-col gap-3">
{!db && <Logo />}
<UploadFile />
{isLoading ? (
<Loading>Loading SQLite file</Loading>
) : isFetching ? (
<Loading>Fetching SQLite file</Loading>
) : null}
{fetchError && !db && <ErrorMessage>{fetchError}</ErrorMessage>}
{!isLoading &&
db &&
(tables.length > 0 ? (
<DBTable />
) : (
<ErrorMessage>Your database is empty, no tables found</ErrorMessage>
))}
<Dialog
showDialog={showDialog}
setShowDialog={setShowDialog}
fn={handleRetryWithProxy}
/>
</div>
{!db && <Logo />}
<UploadFile />
{isLoading ? (
<Loading>Loading SQLite file</Loading>
) : isFetching ? (
<Loading>Fetching SQLite file</Loading>
) : null}
{fetchError && !db && <ErrorMessage>{fetchError}</ErrorMessage>}
{!isLoading &&
db &&
(tables.length > 0 ? (
<DBTable />
) : (
<ErrorMessage>Your database is empty, no tables found</ErrorMessage>
))}
<Dialog
showDialog={showDialog}
setShowDialog={setShowDialog}
fn={handleRetryWithProxy}
/>
{!db && <Footer />}
</>
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export default function UploadFile() {
});

const renderDropzoneContent = (hasDatabase: boolean) => (
<div className="flex items-center gap-2 justify-center">
<div className="flex items-center gap-2 justify-center h-full">
<div
{...getRootProps()}
className={`grow h-[85px] border p-6 rounded cursor-pointer text-center flex flex-col items-center justify-center ${
className={`grow h-full border p-6 rounded cursor-pointer text-center flex flex-col items-center justify-center ${
hasDatabase ? "" : "py-32"
}`}
>
Expand Down Expand Up @@ -87,7 +87,7 @@ export default function UploadFile() {
);

return (
<section>
<section className={db ? "" : "h-full"}>
{renderDropzoneContent(Boolean(db))}
<div>
{/* {file && <FileData file={file} />} */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Github } from "lucide-react";

export default function Footer() {
return (
<footer className="flex items-center justify-between my-1 p-4 border rounded mt-3">
<footer className="flex items-center justify-between p-4 border rounded">
<div>
<p className="hidden sm:block text-xs">
No file will be uploaded to server. using JavaScript, sql.js
Expand Down
4 changes: 2 additions & 2 deletions src/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function DBTable() {
}

return (
<div className="flex flex-col gap-3 mb-2">
<>
<section className="flex flex-col gap-2 p-3 border rounded pb-2">
<TableSelect />
<div className="flex gap-1">
Expand Down Expand Up @@ -192,6 +192,6 @@ export function DBTable() {
rowCount={rowCount}
/>
)}
</div>
</>
);
}
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "./index.css";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<main className="container mx-auto p-4">
<main className="container mx-auto p-4 h-screen flex flex-col gap-3">
<App />
</main>
</React.StrictMode>,
Expand Down

0 comments on commit e029dca

Please sign in to comment.