-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/adding gig board #9
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We gonna add two new fields here please. Two colors picker, for primary and secondary colors
@@ -9,7 +12,7 @@ export const postToIPFS = async (data: any): Promise<string> => { | |||
'Basic ' + | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no gigs
return `<iframe src="${gigboardUrl}" width="600" height="400"></iframe>`; | ||
}; | ||
|
||
const GigBoardSettings = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name of the file and main component must be similar
No description provided.