Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wallet #185

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 2 additions & 37 deletions client/components/playground/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import Link from "next/link";
import { Button } from "@/components/ui/button";
import Compile from "../Modal/Compile";
import { connect, disconnect } from "starknetkit";
import { Dialog, DialogContent, DialogHeader } from "@/components/ui/dialog";
import Argent from "@/public/img/Argent Wallet.png";
import Bravoos from "@/public/img/bravoos wallet.jpeg";


interface HeaderProps {
showClearButton: boolean;
Expand Down Expand Up @@ -37,7 +35,6 @@ export default function Header({
const [isEditing, setIsEditing] = useState(false);
const [projectName, setProjectName] = useState("DevXStark");
const [isCompileModalOpen, setIsCompileModalOpen] = useState(false);
const [isWalletModalOpen, setIsWalletModalOpen] = useState(false);

// Wallet connection state
const [connection, setConnection] = useState<StarknetConnection | null>(null);
Expand Down Expand Up @@ -104,7 +101,6 @@ export default function Header({
const address = await getWalletAddress(result.wallet);
setWalletAddress(address);
localStorage.setItem("starknetConnection", "true");
setIsWalletModalOpen(false);
}
} catch (error) {
console.error("Error connecting wallet:", error);
Expand Down Expand Up @@ -198,7 +194,7 @@ export default function Header({
</Button>
</div>
) : (
<Button variant="primary" onClick={() => setIsWalletModalOpen(true)}>
<Button variant="primary" onClick={() => handleConnectWallet()}>
Connect wallet
</Button>
)}
Expand Down Expand Up @@ -231,37 +227,6 @@ export default function Header({
</div>
</div>

{/* Wallet Connection Modal */}
<Dialog open={isWalletModalOpen} onOpenChange={setIsWalletModalOpen}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<h2>Connect your Starknet wallet</h2>
</DialogHeader>
<div className="grid gap-4 py-4">
<Button
onClick={handleConnectWallet}
className="flex items-center justify-center gap-2"
>
<img src={Argent.src} alt="Argent" className="w-10 h-10" />
Connect with Argent
</Button>
<Button
onClick={handleConnectWallet}
className="flex items-center justify-center gap-2"
>
<img src={Bravoos.src} alt="Braavos" className="w-9 h-9 rounded-md" />
Connect with Braavos
</Button>
<Button
onClick={handleConnectWallet}
variant="outline"
className="flex items-center justify-center gap-2"
>
Other Starknet Wallet
</Button>
</div>
</DialogContent>
</Dialog>
</>
);
}
33 changes: 0 additions & 33 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,6 @@
dependencies:
"@edge-runtime/primitives" "4.1.0"


"@esbuild/win32-x64@0.21.5":
version "0.21.5"
resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz"
integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==

"@esbuild/win32-x64@0.24.2":
version "0.24.2"
resolved "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz"
integrity sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==

"@esbuild/linux-x64@0.21.5":
version "0.21.5"
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz"
Expand Down Expand Up @@ -1035,11 +1024,6 @@
extend "3.0.2"
ibm-cloud-sdk-core "^5.0.2"

"@img/sharp-win32-x64@0.33.5":
version "0.33.5"
resolved "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz"
integrity sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==

"@img/sharp-libvips-linux-x64@1.0.4":
version "1.0.4"
resolved "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz"
Expand All @@ -1050,7 +1034,6 @@
resolved "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz"
integrity sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==


"@img/sharp-linux-x64@0.33.5":
version "0.33.5"
resolved "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz"
Expand All @@ -1065,7 +1048,6 @@
optionalDependencies:
"@img/sharp-libvips-linuxmusl-x64" "1.0.4"


"@isaacs/cliui@^8.0.2":
version "8.0.2"
resolved "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz"
Expand Down Expand Up @@ -1352,11 +1334,6 @@
dependencies:
glob "10.3.10"

"@next/swc-win32-x64-msvc@14.2.17":
version "14.2.17"
resolved "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.17.tgz"
integrity sha512-vkQfN1+4V4KqDibkW2q0sJ6CxQuXq5l2ma3z0BRcfIqkAMZiiW67T9yCpwqJKP68QghBtPEFjPAlaqe38O6frw==

"@next/swc-linux-x64-gnu@14.2.17":
version "14.2.17"
resolved "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.17.tgz"
Expand Down Expand Up @@ -2255,11 +2232,6 @@
estree-walker "^2.0.2"
picomatch "^4.0.2"

"@rollup/rollup-win32-x64-msvc@4.30.1":
version "4.30.1"
resolved "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.30.1.tgz"
integrity sha512-D6qjsXGcvhTjv0kI4fU8tUuBDF/Ueee4SVX79VfNDXZa64TfCW1Slkb6Z7O1p7vflqZjcmOVdZlqf8gvJxc6og==

"@rollup/rollup-linux-x64-gnu@4.30.1":
version "4.30.1"
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.1.tgz"
Expand Down Expand Up @@ -6933,11 +6905,6 @@ es6-promisify@^5.0.0:
dependencies:
es6-promise "^4.0.3"

esbuild-windows-64@0.14.47:
version "0.14.47"
resolved "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz"
integrity sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==

esbuild-linux-64@0.14.47:
version "0.14.47"
resolved "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz"
Expand Down
Loading