Skip to content

Commit

Permalink
Merge pull request #42 from burnt-labs/chore/optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntNerve authored Jan 17, 2024
2 parents e3518f2 + 7b2d8fd commit 495fede
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 109 deletions.
6 changes: 6 additions & 0 deletions .changeset/clever-vans-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@burnt-labs/abstraxion": minor
"@burnt-labs/ui": minor
---

remove unnecessary packages from abstraxion and optimize modal backdrop
65 changes: 8 additions & 57 deletions apps/abstraxion-dashboard/components/AbstraxionSignin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";
import { MouseEvent, useContext, useEffect, useState } from "react";
import { WalletType, useSuggestChainAndConnect } from "graz";
import { useContext, useEffect, useState } from "react";
import { useStytch } from "@stytch/nextjs";
import { Button, Input, ModalSection } from "@burnt-labs/ui";
import {
Expand All @@ -23,17 +22,6 @@ export const AbstraxionSignin = () => {
AbstraxionContext,
) as AbstraxionContextProps;

const { suggestAndConnect } = useSuggestChainAndConnect({
onError(error) {
setConnectionType("none");
if ((error as Error).message.includes("is not defined")) {
alert(
"Wallet not found. Make sure you download the wallet extension before trying again.",
);
}
},
});

const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setEmailError("");
setEmail(e.target.value.toLowerCase());
Expand Down Expand Up @@ -85,17 +73,6 @@ export const AbstraxionSignin = () => {
}
};

async function handleWebauthnAuthenticate() {
try {
await stytchClient.webauthn.authenticate({
domain: window.location.hostname,
session_duration_minutes: 60,
});
} catch (error) {
console.log(error);
}
}

// For the "resend otp" countdown
useEffect(() => {
if (timeLeft === 0) {
Expand Down Expand Up @@ -157,39 +134,13 @@ export const AbstraxionSignin = () => {
error={emailError}
onBlur={validateEmail}
/>
<div className="ui-flex ui-w-full ui-gap-1">
<Button
fullWidth={true}
onClick={handleEmail}
disabled={!!emailError}
>
Log in / Sign up
</Button>
<Button structure="outlined" onClick={handleWebauthnAuthenticate}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="ui-w-4 ui-h-4"
>
<path d="M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4" />
<path d="M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2" />
<path d="M17.29 21.02c.12-.6.43-2.3.5-3.02" />
<path d="M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4" />
<path d="M8.65 22c.21-.66.45-1.32.57-2" />
<path d="M14 13.12c0 2.38 0 6.38-1 8.88" />
<path d="M2 16h.01" />
<path d="M21.8 16c.2-2 .131-5.354 0-6" />
<path d="M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2" />
</svg>
</Button>
</div>
<Button
fullWidth={true}
onClick={handleEmail}
disabled={!!emailError}
>
Log in / Sign up
</Button>
<p className="ui-text-xs ui-text-neutral-500">
By continuing, you agree to Burnt&apos;s{" "}
<a
Expand Down
3 changes: 0 additions & 3 deletions packages/abstraxion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@apollo/client": "^3.8.8",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
Expand All @@ -47,8 +46,6 @@
"@burnt-labs/constants": "workspace:*",
"@burnt-labs/signers": "workspace:*",
"@burnt-labs/ui": "workspace:*",
"@stytch/nextjs": "^14.0.0",
"@stytch/vanilla-js": "^3.2.1",
"@types/react-dom": "^18.2.18",
"graz": "^0.0.51",
"jose": "^5.1.3"
Expand Down
4 changes: 0 additions & 4 deletions packages/abstraxion/src/components/Abstraxion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
"use client";
import { useContext, useEffect } from "react";
import { GrazProvider } from "graz";
import { StytchProvider } from "@stytch/nextjs";
import { ApolloProvider } from "@apollo/client";
import { Dialog, DialogContent } from "@burnt-labs/ui";
import {
AbstraxionContext,
AbstraxionContextProvider,
} from "../AbstraxionContext";
import { apolloClient, stytchClient } from "../../lib";
import { AbstraxionSignin } from "../AbstraxionSignin";
import { Loading } from "../Loading";
import { ErrorDisplay } from "../ErrorDisplay";
Expand Down
15 changes: 0 additions & 15 deletions packages/abstraxion/src/lib.ts

This file was deleted.

Binary file modified packages/ui/src/assets/xion-bg-blur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 21 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 495fede

@vercel
Copy link

@vercel vercel bot commented on 495fede Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.