How to implement minting TalentLayer IDs?
Minting a TalentLayer ID is the first step that your users will need to do when registering for an account on your platform.
Good to Know
① Create a Form for Choosing a TalentLayer ID Handle
// Imports can be find in the full example at the end of the tutorial
interface IFormValues {
handle: string;
}
const initialValues: IFormValues = {
handle: '',
};
function TalentLayerIdForm() {
const validationSchema = Yup.object().shape({
handle: Yup.string()
.min(2)
.max(10)
.when('isConnected', {
is: account && account.isConnected,
then: schema => schema.required('handle is required'),
}),
});
const onSubmit = async (
submittedValues: IFormValues,
{ setSubmitting }: { setSubmitting: (isSubmitting: boolean) => void },
) => {
// We will handle submit here on the next step
};
return (
<Formik initialValues={initialValues} onSubmit={onSubmit} validationSchema={validationSchema}>
{({ isSubmitting }) => (
<Form>
<Field
type='text'
placeholder='Choose your handle'
id='handle'
name='handle'
required
/>
<button type='submit'>Submit</button>
</Form>
)}
</Formik>
);
}
export default TalentLayerIdForm;② Handle Submit and Post to the Blockchain
③ Get Your New User Information With Subgraph API
See the Full Code Implemented on Our Demo DAPP
Last updated