diff --git a/README.md b/README.md
index 8a8897a..3e9799f 100644
--- a/README.md
+++ b/README.md
@@ -30,4 +30,47 @@ You will need to register and sign up, the first account on the appwrite instanc
1) Open your terminal and navigate to the root folder of the git repository.
2) Run the command `npm update`.
3) Once the depedencies are pulled and installed you can run the command `npm run dev` to run the application in development mode.
-4) Open http://localhost:3000/
\ No newline at end of file
+4) Open http://localhost:3000/
+
+### React Components
+
+##### Gallery Component
+The `Gallery` component is a React component used to display a gallery of images. It fetches images from an API and displays them in a Masonry layout.
+###### Props
+- `id` (number): The ID of the gallery to fetch images from.
+- `closeMenu` (function): A function to close the menu.
+###### State
+- `isSingle` (boolean): A state to check if only a single image is to be displayed.
+- `loaded` (object): A state to keep track of loaded images.
+- `selectedImage` (string | null): A state to keep track of the selected image.
+- `images` (string[]): A state to store the fetched images.
+- `galleryId` (number): A state to store the gallery ID.
+###### Functions
+- `getData`: An async function to fetch images from the API.
+- `generateRandomString`: A function to generate a random string of a given length.
+- `handleDownload`: A function to handle the download of an image.
+###### Usage
+The example below will load the images of the the gallery with an ID of `58201557-b392-471e-ac55-dcf6171cd18d` and will call the function for `setIsOpen(false)` when the back button is clicked.
+```tsx
+ setIsOpen(false)}>
+```
+##### GalleryThumbnail Component
+The `GalleryThumbnail` component is a React component used to display a thumbnail of a gallery. It fetches the thumbnail image from an API and displays it. When clicked, it triggers a callback function with the gallery ID.
+###### Props
+
+- `id` (string): The ID of the gallery to fetch the thumbnail for.
+- `onSelect` (function): A function to be called when the thumbnail is clicked. The gallery ID is passed as an argument.
+###### State
+
+- `galleryId` (string): A state to store the gallery ID.
+- `thumbnailUrl` (string): A state to store the fetched thumbnail URL.
+- `isLoading` (boolean): A state to keep track of the loading status.
+###### Functions
+
+- `openGallery`: A function to call the `onSelect` prop with the gallery ID.
+- `getData`: An async function to fetch the thumbnail from the API.
+###### Usage
+This will render a thumbnail for the gallery with the ID of "1". When the thumbnail is clicked, it will log the gallery ID to the console.
+```tsx
+ console.log(id)} />
+```
diff --git a/app/gallery/page.tsx b/app/gallery/page.tsx
index a06d985..573b4c2 100644
--- a/app/gallery/page.tsx
+++ b/app/gallery/page.tsx
@@ -18,7 +18,7 @@ function PageComponent() {
const [galleries, setGalleries] = useState([]); // replace any with your gallery type
const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true);
- const [selectedGallery, setSelectedGallery] = useState(null);
+ const [selectedGallery, setSelectedGallery] = useState(null);
const generateRandomString = function (length:number) {
let result = '';
let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
@@ -29,7 +29,7 @@ function PageComponent() {
return result;
}
- const selectGallery = (gallery:number) => {
+ const selectGallery = (gallery:string) => {
setRandomIds([generateRandomString(3), generateRandomString(3), generateRandomString(3), generateRandomString(3)]);
setSelectedGallery(gallery);
setIsOpen(true);
@@ -71,7 +71,7 @@ function PageComponent() {