diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index b2b7de7..8f638a0 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -4,9 +4,10 @@ on: # Allows manual deployment workflow_dispatch: push: - # Triggers only when code is pushed to the development branch + # Triggers only when code is pushed to the deployment or development branches # that modifies files in the Frontend or docs/legal directories branches: + - deployment - development paths: @@ -29,6 +30,9 @@ jobs: - name: Install dependencies run: cd Frontend && npm install --force # This should install all dependencies, regardless of the workspace + - name: Write .env file + run: echo "${{ github.ref == 'refs/heads/deployment' && secrets.FRONTEND_PROD_ENV_FILE || secrets.FRONTEND_DEV_ENV_FILE }}" > Frontend/speedcart-react/.env + - name: Build front end env: CI: false @@ -39,6 +43,6 @@ jobs: with: apiToken: ${{ secrets.CF_PAGES_API_TOKEN }} accountId: ${{ secrets.CF_ACCOUNT_ID }} - projectName: "speedcart" + projectName: "${{ github.ref == 'refs/heads/deployment' && 'speedcart' || 'speedcart-dev' }}" directory: "Frontend/speedcart-react/build" - branch: "development" \ No newline at end of file + branch: "${{ github.ref == 'refs/heads/deployment' && 'deployment' || 'development' }}" \ No newline at end of file diff --git a/Frontend/speedcart-react/.env b/Frontend/speedcart-react/.env deleted file mode 100644 index f975c20..0000000 --- a/Frontend/speedcart-react/.env +++ /dev/null @@ -1 +0,0 @@ -VITE_APP_VERSION=0.8.0 \ No newline at end of file diff --git a/Frontend/speedcart-react/.gitignore b/Frontend/speedcart-react/.gitignore index 4d29575..8692cf6 100644 --- a/Frontend/speedcart-react/.gitignore +++ b/Frontend/speedcart-react/.gitignore @@ -13,6 +13,7 @@ # misc .DS_Store +.env .env.local .env.development.local .env.test.local diff --git a/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.module.css b/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.module.css index f252aac..39286dd 100644 --- a/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.module.css +++ b/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.module.css @@ -1,5 +1,6 @@ .listItem { display: table-row; /* Ensure the row aligns with the table structure */ + border-top: 2px transparent solid; } .listItem > * { @@ -26,6 +27,19 @@ text-align: center; } +.restoreBtn { + display: flex; /* Ensures the button content stays on a single line */ + align-items: center; /* Centers the icon vertically */ + justify-content: space-evenly; /* Centers the icon horizontally */ + background-color: #0f40ab; + color: inherit; /* This makes the text color of our site more modular (e.g., dark/light mode would be easier to implement) */ + width: 100px; /* Adjust the width as needed */ + border: none; + padding: 8px !important; /* Adjust padding as needed */ + border-radius: 8px; + cursor: pointer; +} + .checkboxWrapper { display: table-cell; vertical-align: middle; /* Ensures the checkbox is vertically aligned */ diff --git a/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.tsx b/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.tsx index 2b60e7f..e5a8b98 100644 --- a/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.tsx +++ b/Frontend/speedcart-react/src/components/ShoppingListItem/ShoppingListItem.tsx @@ -7,6 +7,7 @@ import { CrudMode } from '@constants/crudmodes'; import styles from './ShoppingListItem.module.css'; import inputStyles from '@modularStyles/inputs.module.css'; import { useShoppingListContext } from '@customHooks/ShoppingListContext'; +import { FaTrashRestore } from 'react-icons/fa' function ShoppingListItem({ item, index, onItemChange, onRemoveItem, isEditing, crudMode = CrudMode.READ, className = '' }) { const { handleRestoreItem } = useShoppingListContext(); @@ -51,9 +52,6 @@ function ShoppingListItem({ item, index, onItemChange, onRemoveItem, isEditing, 🗑️ } - {crudMode === CrudMode.DELETE && - - } : @@ -63,6 +61,11 @@ function ShoppingListItem({ item, index, onItemChange, onRemoveItem, isEditing,
{item.name}
{item.quantity}
{item.is_food ? "Yes" : "No"}
+ {crudMode === CrudMode.DELETE && + + } {/* Other elements for viewing */} )} diff --git a/Frontend/speedcart-react/src/index.tsx b/Frontend/speedcart-react/src/index.tsx index e3cca0d..7b593a8 100644 --- a/Frontend/speedcart-react/src/index.tsx +++ b/Frontend/speedcart-react/src/index.tsx @@ -10,7 +10,7 @@ import { AuthProvider } from 'shared'; // Import AuthProvider const root = ReactDOM.createRoot(document.getElementById('root')); root.render( <> - + {/* This is our custom context for tracking the status of a user to see if they're logged in and see data saved about them if they actually are */} diff --git a/Frontend/speedcart-react/src/pages/Dashboard/Dashboard.tsx b/Frontend/speedcart-react/src/pages/Dashboard/Dashboard.tsx index 394357e..2c12b11 100644 --- a/Frontend/speedcart-react/src/pages/Dashboard/Dashboard.tsx +++ b/Frontend/speedcart-react/src/pages/Dashboard/Dashboard.tsx @@ -274,12 +274,6 @@ function Dashboard() { View/Edit List - {list.name}