Skip to content

Commit

Permalink
workspace linking/hoisting issues with build (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka authored Feb 14, 2024
1 parent f8d1be7 commit b4bd3f5
Show file tree
Hide file tree
Showing 5 changed files with 1,563 additions and 3,195 deletions.
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ access = public
package-lock = true
resolve-peers-from-workspace-root = true
strict-peer-dependencies = false
package-import-method = clone
shamefully-hoist = false
link-workspace-packages = true
link-workspace-packages = false
hoist-workspace-packages = true
8 changes: 4 additions & 4 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"dependencies": {
"0xsequence": "^1.8.2",
"@0xsequence/design-system": "^1.1.0",
"@0xsequence/kit": "workspace:*",
"@0xsequence/kit-checkout": "workspace:*",
"@0xsequence/kit-connectors": "workspace:*",
"@0xsequence/kit-wallet": "workspace:*",
"@0xsequence/kit": "^2.0.0",
"@0xsequence/kit-checkout": "^2.0.0",
"@0xsequence/kit-connectors": "^2.0.0",
"@0xsequence/kit-wallet": "^2.0.0",
"@tanstack/react-query": "^4.36.1",
"@vanilla-extract/css": "^1.9.3",
"ethers": "^5.7.2",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "kit",
"private": true,
"license": "Apache-2.0",
"sideEffects": false,
"scripts": {
"build": "pnpm dev && pnpm typecheck && preconstruct build",
"watch": "preconstruct watch",
Expand Down
21 changes: 11 additions & 10 deletions packages/kit/src/components/KitProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface EthAuthSettings {
nonce?: number
}


export interface KitConfig {
disableAnalytics?: boolean,
defaultTheme?: Theme,
Expand Down Expand Up @@ -92,23 +93,23 @@ export const KitProvider = (props: KitConnectProviderProps) => {
const [modalPosition, setModalPosition] = useState<ModalPosition>(position)
const [displayedAssets, setDisplayedAssets] = useState<DisplayedAsset[]>(displayedAssetsSetting)
const [analytics, setAnalytics] = useState<SequenceClient["analytics"]>()
// const { address, isConnected } = useAccount()
const { address, isConnected } = useAccount()

const setupAnalytics = (projectAccessKey: string) => {
const s = sequence.initWallet(projectAccessKey)
const sequenceAnalytics = s.client.analytics
setAnalytics(sequenceAnalytics)
}

// useEffect(() => {
// if (!isConnected) {
// analytics?.reset()
// return
// }
// if (address) {
// analytics?.identify(address.toLowerCase())
// }
// },[analytics, address, isConnected])
useEffect(() => {
if (!isConnected) {
analytics?.reset()
return
}
if (address) {
analytics?.identify(address.toLowerCase())
}
},[analytics, address, isConnected])

const poweredBySequenceOnClick = () => {
window.open('https://sequence.xyz')
Expand Down
Loading

0 comments on commit b4bd3f5

Please sign in to comment.