Skip to content
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
8 changes: 6 additions & 2 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -41,4 +45,4 @@ jobs:
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: "speedcart"
directory: "Frontend/speedcart-react/build"
branch: "development"
branch: "${{ github.ref == 'refs/heads/deployment' && 'deployment' || 'development' }}"
1 change: 0 additions & 1 deletion Frontend/speedcart-react/.env

This file was deleted.

1 change: 1 addition & 0 deletions Frontend/speedcart-react/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.listItem {
display: table-row; /* Ensure the row aligns with the table structure */
border-top: 2px transparent solid;
}

.listItem > * {
Expand All @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -51,9 +52,6 @@ function ShoppingListItem({ item, index, onItemChange, onRemoveItem, isEditing,
🗑️
</button>
}
{crudMode === CrudMode.DELETE &&
<button onClick={() => handleRestoreItem(index)}>Restore</button>
}
</div>
</>
:
Expand All @@ -63,6 +61,11 @@ function ShoppingListItem({ item, index, onItemChange, onRemoveItem, isEditing,
<div>{item.name}</div>
<div>{item.quantity}</div>
<div>{item.is_food ? "Yes" : "No"}</div>
{crudMode === CrudMode.DELETE &&
<button onClick={() => handleRestoreItem(index)} className={styles.restoreBtn}>
Restore <FaTrashRestore />
</button>
}
</>
{/* Other elements for viewing */}
</>)}
Expand Down
2 changes: 1 addition & 1 deletion Frontend/speedcart-react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { AuthProvider } from 'shared'; // Import AuthProvider
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<>
<GoogleOAuthProvider clientId='345095409372-ebua99dg2ok8dgt5bfpkacf4nclqhj08.apps.googleusercontent.com'>
<GoogleOAuthProvider clientId={import.meta.env.VITE_GOOGLE_CLIENT_ID}>
{/* 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 */}
<AuthProvider>
Expand Down
6 changes: 0 additions & 6 deletions Frontend/speedcart-react/src/pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,6 @@ function Dashboard() {
<FaEdit className={styles.viewEditIcon} />
<span className={styles.tooltip}>View/Edit List</span>
</Link>
<button onClick={() => {
// This state will display the modal for the sharing feature for that specific list
setShareListId(list.list_id);
}} >
<FaShare className={styles.faShare} />
</button>
</span>
<span className={styles.listName}>{list.name}</span>
<div className={styles.listDetails}>
Expand Down