Feature/adding gig board#9
Conversation
|
@pranav-singhal is attempting to deploy a commit to the TalentLayer Team on Vercel. A member of the Team first needs to authorize it. |
src/components/GigBoard/index.tsx
Outdated
| import { ServiceStatusEnum } from '../../types'; | ||
| import ServiceItem from '../ServiceItem'; | ||
|
|
||
| interface IGigBoardProps { |
There was a problem hiding this comment.
The semantics used for the end user and the one used in the code is different. In the code, we use a more global term used also in smart contract: Service
Also I think Board is not as clear for the code and can be confusing as we also have a page which list services.
So globally, pages and components may be named: ServicesEmbed, ServicesEmbedSettings, create-services-embed
| onSuccess={navigateToGigBoardSettings} | ||
| onChange={(event: ILiveServiceContent) => { | ||
| // TODO: move this to an async function expression | ||
| if (event.rateAmount) { |
There was a problem hiding this comment.
Best practices and perf improvement:
here a new instance of your function is created on every rerender, better to use useCallback
| import StarterKitContext from '../../../context/starterKit'; | ||
| import { ServiceStatusEnum } from '../../../types'; | ||
|
|
||
| const BASE_URL = 'http://localhost:3000'; |
There was a problem hiding this comment.
Not really a good practice to have that here.
- Solution 1: get the base URL dynamically with window.location
- Solution 2: put this in a .env
Sol 1 seems good to me here
| ))} | ||
| </Field> | ||
| </label> | ||
| </div> |
There was a problem hiding this comment.
We gonna add two new fields here please. Two colors picker, for primary and secondary colors
| btoa(process.env.NEXT_PUBLIC_INFURA_ID + ':' + process.env.NEXT_PUBLIC_INFURA_SECRET); | ||
| ipfs = create({ | ||
| url: 'https://infura-ipfs.io:5001/api/v0', | ||
| url: process.env.NEXT_PUBLIC_IPFS_BASE_URL, |
There was a problem hiding this comment.
this will prevent IPFS to work, the public URL to read is not the same as the one to write
There was a problem hiding this comment.
I see
But when I was running it locally, I was able to write/read successfully
src/components/GigBoard/index.tsx
Outdated
| return <div>Loading</div>; | ||
| } | ||
| if (services.length === 0) { | ||
| return <div>You have no services</div>; |
| return `<iframe src="${gigboardUrl}" width="600" height="400"></iframe>`; | ||
| }; | ||
|
|
||
| const GigBoardSettings = () => { |
There was a problem hiding this comment.
the name of the file and main component must be similar
No description provided.