Ng/connect fixes - #257
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issues in the Connect module by merging public spaces data into the authenticate view and refactoring the CreateSpaceCard component to support both private and public space creation.
- Merges publicSpacesData with privateSpacesData in the authenticate route
- Splits the space creation logic into separate functions for public and private spaces and introduces a new select input
- Adds a new dependency (@graphprotocol/grc-20) to support public space creation
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/connect/src/routes/authenticate.tsx | Merges private and public spaces data for display |
| apps/connect/src/components/CreateSpaceCard.tsx | Refactors space creation functionality and UI |
| apps/connect/package.json | Adds dependency for public space creation |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| <div className="relative min-h-80 lg:col-2"> | ||
| <SpacesCard | ||
| spaces={privateSpacesData ?? []} | ||
| spaces={[...(privateSpacesData ?? []), ...(publicSpacesData ?? [])]} |
There was a problem hiding this comment.
When merging privateSpacesData and publicSpacesData, consider whether duplicate entries could be introduced if a space appears in both arrays. If duplicates are possible, add filtering logic to ensure data consistency.
| spaces={[...(privateSpacesData ?? []), ...(publicSpacesData ?? [])]} | |
| spaces={[ | |
| ...new Map( | |
| [...(privateSpacesData ?? []), ...(publicSpacesData ?? [])].map(space => [space.id, space]) | |
| ).values() | |
| ]} |
| const createSpace = async () => { | ||
| const createPublicSpace = async () => { | ||
| if (!accountAddress) { | ||
| alert('Missing account address'); |
There was a problem hiding this comment.
Error notifications are handled differently between createPublicSpace (using alerts) and createPrivateSpace (logging to console). Consider using a consistent error messaging strategy to enhance user experience and maintain consistency.
| alert('Missing account address'); | |
| setErrorMessage('Missing account address'); |
No description provided.