Skip to content

Instantly share code, notes, and snippets.

@Iheanacho-ai
Last active March 27, 2022 20:25
Show Gist options
  • Save Iheanacho-ai/0e0d68b6f8d17cfeddccbfc4b25c5f72 to your computer and use it in GitHub Desktop.
Save Iheanacho-ai/0e0d68b6f8d17cfeddccbfc4b25c5f72 to your computer and use it in GitHub Desktop.
import {Appwrite} from "appwrite";
import {useEffect, useState } from "react";
const Home = () => {
// Init your Web SDK
const sdk = new Appwrite();
sdk
.setEndpoint('http://localhost/v1') // our API Endpoint
.setProject(projectID) // our project ID
;
return(
<div className='product-catalog'>
<div className="product-container mt-5 md:mt-0 md:col-span-2">
<form action="#" method="POST">
<div className="shadow sm:rounded-md sm:overflow-hidden">
<div className="px-4 py-5 bg-white space-y-6 sm:p-6">
<div>
<label htmlFor="about" className="block text-sm font-medium text-gray-700">
Product Name
</label>
<div className="mt-1">
<textarea
id="about"
name="about"
rows={1}
className="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 mt-1 block w-full sm:text-sm border border-gray-300 rounded-md"
defaultValue={''} />
</div>
</div>
<div className="grid grid-cols-3 gap-6">
<div className="col-span-3 sm:col-span-2">
<label htmlFor="company-website" className="block text-sm font-medium text-gray-700">
Link to Product Image
</label>
<div className="mt-1 flex rounded-md shadow-sm">
<input
type="text"
name="company-website"
id="company-website"
className="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-r-md sm:text-sm border-gray-300"
placeholder="www.example.com" />
</div>
</div>
</div>
<div>
<label htmlFor="price" className="block text-sm font-medium text-gray-700">
Price
</label>
<div className="mt-1 relative rounded-md shadow-sm">
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span className="text-gray-500 sm:text-sm">$</span>
</div>
<input
type="text"
name="price"
id="price"
className="focus:ring-indigo-500 focus:border-indigo-500 block w-full pl-7 pr-12 sm:text-sm border-gray-300 rounded-md"
placeholder="0.00"
/>
</div>
</div>
<div className="px-4 py-3 bg-gray-50 text-right sm:px-6">
<button
type="button"
className="cursor inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
Save
</button>
</div>
</div>
</div>
</form>
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment