This commit is contained in:
Gilbert 2024-04-11 21:59:33 -05:00
parent 6316aa852b
commit baadc507e7
5 changed files with 85 additions and 2024 deletions

View File

@ -21,14 +21,7 @@
"@radix-ui/react-tabs": "^1.0.4", "@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5", "@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-tooltip": "^1.0.7", "@radix-ui/react-tooltip": "^1.0.7",
"@snowballtools/auth": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/auth",
"@snowballtools/auth-lit": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/auth-lit",
"@snowballtools/js-sdk": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/js-sdk",
"@snowballtools/link-lit-alchemy-light": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/link-lit-alchemy-light",
"@snowballtools/material-tailwind-react-fork": "^2.1.10", "@snowballtools/material-tailwind-react-fork": "^2.1.10",
"@snowballtools/smartwallet-alchemy-light": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/smartwallet-alchemy-light",
"@snowballtools/types": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/types",
"@snowballtools/utils": "/Users/rabbit-m2/p/snowball/snowball-ts-sdk/packages/utils",
"@tanstack/react-query": "^5.22.2", "@tanstack/react-query": "^5.22.2",
"@testing-library/jest-dom": "^5.17.0", "@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0", "@testing-library/react": "^13.4.0",

View File

@ -1,17 +1,17 @@
import { useSnowball } from 'utils/use-snowball'; // import { useSnowball } from 'utils/use-snowball';
export const SnowballLogin = () => { // export const SnowballLogin = () => {
const snowball = useSnowball(); // const snowball = useSnowball();
console.log(snowball); // console.log(snowball);
return ( // return (
<div className="flex items-center justify-center h-screen bg-snowball-900 snow"> // <div className="flex items-center justify-center h-screen bg-snowball-900 snow">
<div className="flex flex-col items-center justify-center"> // <div className="flex flex-col items-center justify-center">
<img // <img
src="/logo.svg" // src="/logo.svg"
alt="snowball logo" // alt="snowball logo"
className="w-32 h-32 rounded-full mb-4" // className="w-32 h-32 rounded-full mb-4"
/> // />
</div> // </div>
</div> // </div>
); // );
}; // };

View File

@ -1,19 +1,19 @@
import { LitGoogleAuth } from '@snowballtools/auth-lit'; // import { LitGoogleAuth } from '@snowballtools/auth-lit';
import { Snowball, SnowballChain } from '@snowballtools/js-sdk'; // import { Snowball, SnowballChain } from '@snowballtools/js-sdk';
// import { LinkLitAlchemyLight } from '@snowballtools/link-lit-alchemy-light'; // // import { LinkLitAlchemyLight } from '@snowballtools/link-lit-alchemy-light';
export const DOMAIN = import.meta.env.VITE_DOMAIN || 'localhost'; // export const DOMAIN = import.meta.env.VITE_DOMAIN || 'localhost';
export const ORIGIN = // export const ORIGIN =
import.meta.env.VITE_VERCEL_ENV === 'production' // import.meta.env.VITE_VERCEL_ENV === 'production'
? `https://${DOMAIN}` // ? `https://${DOMAIN}`
: `http://${DOMAIN}:3000`; // : `http://${DOMAIN}:3000`;
// prettier-ignore // // prettier-ignore
export const snowball = Snowball.withAuth( // export const snowball = Snowball.withAuth(
LitGoogleAuth.configure({ // LitGoogleAuth.configure({
litReplayApiKey: import.meta.env.VITE_LIT_RELAY_API_KEY!, // litReplayApiKey: import.meta.env.VITE_LIT_RELAY_API_KEY!,
}), // }),
).create({ // ).create({
initialChain: SnowballChain.sepolia, // initialChain: SnowballChain.sepolia,
}); // });

View File

@ -1,13 +1,13 @@
import { useEffect, useState } from 'react'; // import { useEffect, useState } from 'react';
import { snowball } from './snowball'; // import { snowball } from './snowball';
export function useSnowball() { // export function useSnowball() {
const [state, setState] = useState(100); // const [state, setState] = useState(100);
useEffect(() => { // useEffect(() => {
// Subscribe and directly return the unsubscribe function // // Subscribe and directly return the unsubscribe function
return snowball.subscribe(() => setState(state + 1)); // return snowball.subscribe(() => setState(state + 1));
}, [snowball]); // }, [snowball]);
return snowball; // return snowball;
} // }

2016
yarn.lock

File diff suppressed because it is too large Load Diff