Skip to content
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

Feat/chatbot front end #11

Merged
merged 6 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,43 @@ This project is licensed under the Unlicense - see the LICENSE file for details.
### Acknowledgments:
- **Font**: Inter by Google Fonts
- **Icons**: Heroicons

## Eco-Advice Page Configuration

### Google Docs Integration

The eco-advice articles are dynamically rendered from Google Docs. To set up new articles:

1. Create your article in Google Docs
2. Set sharing permissions:
- Click 'Share' in the top right
- Select 'Publish to web'
- Enable auto-republish option
- Copy the published URL

### Article Component Setup

Each article is rendered using the `parseDoc` function. To add or modify articles:

1. Locate the article component in the codebase
2. Find the `parseDoc` function
3. Insert the published Google Docs URL:
```javascript
parseDoc('YOUR_PUBLISHED_GOOGLE_DOC_URL_HERE')
```

### OpenAI Configuration

The eco-advice page interfaces with OpenAI's API for additional functionality:

1. Navigate to `utils/openai.js`
2. On line 11, update the OpenAI endpoint URL:
```javascript
const OPENAI_API_ENDPOINT = 'YOUR_OPENAI_ENDPOINT_URL'
```

### Important Notes

- Ensure all Google Docs are set to auto-publish to maintain current content
- Only use published sharing links from authorised product owners
```
185 changes: 178 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"@headlessui/react": "^2.2.0",
"@heroicons/react": "^2.1.5",
"@react-aria/interactions": "^3.22.5",
"dotenv": "^16.4.7",
"emailjs-com": "^3.2.0",
"native-base": "^3.4.0",
"openai": "^4.76.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.1.2",
Expand All @@ -33,6 +35,7 @@
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@eslint/js": "^9.11.1",
"@types/node": "^22.10.2",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.2",
Expand Down
9 changes: 1 addition & 8 deletions src/components/CategoryMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { Box, Text, Pressable, Image, ScrollView, VStack, HStack } from "native-base";
import { useState } from "react";
import { categories } from "../data/categories";

interface ClothingItem {
name: string;
image: string;
category: string;
subcategory: string;
}
import { ClothingItem } from "../utils/types";

interface CategoryMenuProps {
categories: typeof categories;
Expand Down Expand Up @@ -121,7 +115,6 @@ export default function CategoryMenu({ categories, onSelectItem }: CategoryMenuP
borderColor="primary.100"
borderRadius="md"
bg="primary.200"
_hover={{ opacity: 0.8 }}
>
<Image
source={{ uri: item.image }}
Expand Down
Loading
Loading