-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Merge branch 'main' into deployment
- Loading branch information
Showing
8 changed files
with
200 additions
and
115 deletions.
There are no files selected for viewing
82 changes: 41 additions & 41 deletions
82
packages/examples/sdk-frontend/components/Spaces/useSpaceComponent.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 |
---|---|---|
@@ -1,47 +1,47 @@ | ||
import { | ||
ISpaceFeedProps, | ||
ISpaceBannerProps, | ||
ISpaceWidgetProps, | ||
ISpaceCreateWidgetProps, | ||
SpacesUI, | ||
ISpaceInvitesProps, | ||
} from '@pushprotocol/uiweb'; | ||
import { useAccount, useSigner } from 'wagmi'; | ||
import React, { useContext} from 'react'; | ||
import { ENV } from '@pushprotocol/restapi/src/lib/constants'; | ||
import * as PushAPI from '@pushprotocol/restapi'; | ||
import { AccountContext } from '../../contexts'; | ||
// import { | ||
// ISpaceFeedProps, | ||
// ISpaceBannerProps, | ||
// ISpaceWidgetProps, | ||
// ISpaceCreateWidgetProps, | ||
// SpacesUI, | ||
// ISpaceInvitesProps, | ||
// } from '@pushprotocol/uiweb'; | ||
// import { useAccount, useSigner } from 'wagmi'; | ||
// import React, { useContext} from 'react'; | ||
// import { ENV } from '@pushprotocol/restapi/src/lib/constants'; | ||
// import * as PushAPI from '@pushprotocol/restapi'; | ||
// import { AccountContext } from '../../contexts'; | ||
|
||
export interface IUseSpaceReturnValues { | ||
spaceUI: SpacesUI; | ||
SpaceInvitesComponent: React.FC<ISpaceInvitesProps>; | ||
SpaceWidgetComponent: React.FC<ISpaceWidgetProps>; | ||
SpaceFeedComponent: React.FC<ISpaceFeedProps>; | ||
SpaceBannerComponent: React.FC<ISpaceBannerProps>; | ||
CreateSpaceComponent: React.FC<ISpaceCreateWidgetProps>; | ||
} | ||
// export interface IUseSpaceReturnValues { | ||
// spaceUI: SpacesUI; | ||
// SpaceInvitesComponent: React.FC<ISpaceInvitesProps>; | ||
// SpaceWidgetComponent: React.FC<ISpaceWidgetProps>; | ||
// SpaceFeedComponent: React.FC<ISpaceFeedProps>; | ||
// SpaceBannerComponent: React.FC<ISpaceBannerProps>; | ||
// CreateSpaceComponent: React.FC<ISpaceCreateWidgetProps>; | ||
// } | ||
|
||
export const useSpaceComponents = (): IUseSpaceReturnValues => { | ||
const env = ENV.DEV; | ||
// export const useSpaceComponents = (): IUseSpaceReturnValues => { | ||
// const env = ENV.DEV; | ||
|
||
const { address } = useAccount(); | ||
const { data: signer } = useSigner(); | ||
// const { address } = useAccount(); | ||
// const { data: signer } = useSigner(); | ||
|
||
const { pgpPrivateKey } = useContext<any>(AccountContext); | ||
// const { pgpPrivateKey } = useContext<any>(AccountContext); | ||
|
||
const spaceUI = new SpacesUI({ | ||
account: address as string, | ||
signer: signer as PushAPI.SignerType, | ||
pgpPrivateKey: pgpPrivateKey, | ||
env: env, | ||
}); | ||
// const spaceUI = new SpacesUI({ | ||
// account: address as string, | ||
// signer: signer as PushAPI.SignerType, | ||
// pgpPrivateKey: pgpPrivateKey, | ||
// env: env, | ||
// }); | ||
|
||
return { | ||
spaceUI, | ||
SpaceInvitesComponent: spaceUI.SpaceInvites, | ||
SpaceWidgetComponent: spaceUI.SpaceWidget, | ||
SpaceBannerComponent: spaceUI.SpaceBanner, | ||
SpaceFeedComponent: spaceUI.SpaceFeed, | ||
CreateSpaceComponent: spaceUI.SpaceCreationButtonWidget, | ||
}; | ||
}; | ||
// return { | ||
// spaceUI, | ||
// SpaceInvitesComponent: spaceUI.SpaceInvites, | ||
// SpaceWidgetComponent: spaceUI.SpaceWidget, | ||
// SpaceBannerComponent: spaceUI.SpaceBanner, | ||
// SpaceFeedComponent: spaceUI.SpaceFeed, | ||
// CreateSpaceComponent: spaceUI.SpaceCreationButtonWidget, | ||
// }; | ||
// }; |
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
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
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
Oops, something went wrong.