-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from golemfactory/feature/JST-664/standalone-p…
…ayment-module Manually set app-key. Invoice searching. Remove debit notes hooks.
- Loading branch information
Showing
34 changed files
with
843 additions
and
716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,8 @@ node_modules/ | |
.vscode/ | ||
.idea/ | ||
|
||
# Ignore vercel files | ||
.vercel/ | ||
|
||
# Ignore build directory | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en" data-theme="light"> | ||
<html lang="en" data-theme="light" class="3xl:text-[24px]"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Golem + React + Vite demo</title> | ||
</head> | ||
<body class="bg-base-200 flex h-screen"> | ||
<div id="root" class="flex-grow flex flex-col"></div> | ||
<body class="bg-base-200 flex h-screen overflow-hidden"> | ||
<div id="root" class="flex-grow flex flex-col overflow-hidden"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 46 additions & 7 deletions
53
examples/react-with-vite/src/connection/ConnectToYagna.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
examples/react-with-vite/src/connection/SetYagnaOptionsButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useState } from "react"; | ||
import SetYagnaOptionsDropdown from "./SetYagnaOptionsDropdown"; | ||
|
||
export default function SetYagnaOptionsButton() { | ||
const [isDropdownOpen, setIsDropdownOpen] = useState(false); | ||
|
||
return ( | ||
<div className="flex"> | ||
<button className="btn btn-ghost" onClick={() => setIsDropdownOpen(true)}> | ||
Change yagna options | ||
</button> | ||
<div className="flex self-end"> | ||
{isDropdownOpen && ( | ||
<SetYagnaOptionsDropdown onClose={() => setIsDropdownOpen(false)} /> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} |
56 changes: 56 additions & 0 deletions
56
examples/react-with-vite/src/connection/SetYagnaOptionsDropdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { useYagna } from "@golem-sdk/react"; | ||
import { useRef } from "react"; | ||
|
||
interface SetYagnaOptionsDropdownProps { | ||
onClose?: () => void; | ||
} | ||
|
||
export default function SetYagnaOptionsDropdown({ | ||
onClose, | ||
}: SetYagnaOptionsDropdownProps) { | ||
const { appKey, basePath, setYagnaOptions } = useYagna(); | ||
const appKeyInputRef = useRef<HTMLInputElement>(null); | ||
const basePathInputRef = useRef<HTMLInputElement>(null); | ||
|
||
return ( | ||
<> | ||
<div | ||
className="fixed h-screen w-screen top-0 left-0 z-10 bg-[#00000010]" | ||
onClick={() => onClose?.()} | ||
></div> | ||
<div className="dropdown dropdown-end dropdown-open"> | ||
<div className="card compact dropdown-content z-20 shadow bg-base-100 rounded-box"> | ||
<div className="card-body"> | ||
<div className="flex flex-col items-end gap-1"> | ||
<input | ||
className="input input-bordered input-sm" | ||
placeholder="App key" | ||
defaultValue={appKey || ""} | ||
ref={appKeyInputRef} | ||
/> | ||
<input | ||
className="input input-bordered input-sm" | ||
placeholder="Yagna url" | ||
defaultValue={basePath || "http://127.0.0.1:7465"} | ||
ref={basePathInputRef} | ||
/> | ||
<button | ||
className="btn btn-primary btn-sm min-w-0" | ||
onClick={() => { | ||
const newAppKey = appKeyInputRef.current?.value || null; | ||
const newBasePath = basePathInputRef.current?.value || ""; | ||
setYagnaOptions({ | ||
apiKey: newAppKey, | ||
basePath: newBasePath, | ||
}); | ||
}} | ||
> | ||
Save | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
56 changes: 0 additions & 56 deletions
56
examples/react-with-vite/src/debit-notes/DebitNoteTableRow.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.