Skip to content

Project2 - MadeOfMoney#41

Open
patrickkok wants to merge 54 commits intorocketacademy:mainfrom
patrickkok:main
Open

Project2 - MadeOfMoney#41
patrickkok wants to merge 54 commits intorocketacademy:mainfrom
patrickkok:main

Conversation

@patrickkok
Copy link

group members:

  • Kendi
  • Matthew
  • Patrick

patrickkok and others added 30 commits December 16, 2023 12:45
Install react-bootstrap and bootstrap through npm
Install react-router, create History.js and /history route. Create Navbar.
Display trade history and filter/sort
Merge database setup and login/sign up pages to main
patrickkok and others added 24 commits January 13, 2024 10:57
Change History to Trades for clarity
Add buy/sell information to trade line, add edit/delete functionality, add responsiveness
Fix Trades not displaying in the center
@@ -2,6 +2,11 @@

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs more info on how to install and run the application. Also background info on the project and planning docs

color: white;
color: rgb(232, 222, 222);
}
/* App.css */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant comment

color: #e8dede; /* Light text color */
}

/* index.css */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment does not make sense to me somehow 🤔

}

/* Additional dark mode styles */
/* App.css */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, if you mean to make sections for different files in this css file, it might make sense to create css files for specific files instead of using a single css file for the whole app and creating sections

import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";

const Accountsummary = () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File name and component name should use PascalCase. AccountSummary


useEffect(() => {
// Call the API for each company
getAlphaVantageData("AMZN");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to have an array of symbols here, and then run a loop on them with this function instead of manually calling the function multiple times in a row

Comment on lines +18 to +22
{/* <img src={logo} className="App-logo" alt="logo" /> */}
{/* <p>
Edit <code>src/App.js</code> and save to reload.
</p> */}
{/* <Educationalmaterial /> */}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no...more....please

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [tradesArr, sort]);

const sortTrades = (arr, sortMethod) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would include the way trades are sorted in the function name. ascending, descending, alphabetical, numerical etc.

};

const filterTrades = (filter) => {
const loadedTrades = [];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be moved within the else block, as loadedTrades is only used in there

let newTradesArr = tradesArr;
for (let i = 0; i < newTradesArr.length; i++) {
if (newTradesArr[i].key === tradeUid) {
newTradesArr.splice(i, 1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
newTradesArr.splice(i, 1);
const newTradesArr = [...tradesArr].splice(i, 1);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way you copied newTradesArr from tradesArr, you will actuall perform the splice on the original array as well

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass by reference!

// import { Link } from "react-router-dom";
// import Container from "react-bootstrap/Container";

const Educationalmaterial = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this even used?

Comment on lines +33 to +47
<Link className="nav-link text-white" to="/">
Home
</Link>
<Link className="nav-link text-white" to="/dash">
Dashboard
</Link>
<Link className="nav-link text-white" to="/trades">
Trades
</Link>
<Link className="nav-link text-white" to="/insights">
Insights
</Link>
<Link className="nav-link text-white" to="/settings">
Settings
</Link>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could create a reusable component for this and render from a map instead of hardcoding it like here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants