Skip to content

Commit

Permalink
Merge pull request #25 from DoughFin/feature/df-101-debug-budget-disp…
Browse files Browse the repository at this point in the history
…lay-for-render

Adjustment to FE for Transactions and Budget
  • Loading branch information
shawndcarpenter authored Feb 26, 2024
2 parents 14a685a + ca15d2c commit c2a62a9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Budget/Budget.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const Budget = () => {
console.error("Error fetching data:", error);
}
console.log("Fetched budgetData:", budgetsData);
const pctRemaining = Math.round(budgetsData?.budgets[0]?.pctRemaining) < 0 ? 0 : Math.round(budgetsData?.budgets[0]?.pctRemaining) || 'Loading...';
const pctRemaining = Math.round(budgetsData?.budgets[0]?.pctRemaining) <= 0 ? 0 : Math.round(budgetsData?.budgets[0]?.pctRemaining) || 'Loading...';
const amount = budgetsData?.budgets[0]?.amount || 'Loading...';
const amountRemaining = Math.round(budgetsData?.budgets[0]?.amountRemaining) || 'Loading...';
const amountRemaining = Math.round(budgetsData?.budgets[0]?.amountRemaining) === 0 ? 0 : Math.round(budgetsData?.budgets[0]?.amountRemaining) || 'Loading...';

// State to manage dropdown visibility
const [isDropdownVisible, setIsDropdownVisible] = useState(false);
Expand Down
4 changes: 2 additions & 2 deletions src/components/CashFlow/CashFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const CashFlow = ({ cashFlow }) => {
<h1 className='cashflow-h1'>Cash Flow</h1>
<div className='cashflow-header-income'>
<img src={EllipsePurple} alt='purple ellipse' />
<p className='cashflow-header-text'>Income</p>
<p className='cashflow-header-text'>Incomes</p>
</div>
<div className='cashflow-header-income'>
<img src={EllipseBlue} alt='purple ellipse' />
<p className='cashflow-header-text'>Expense</p>
<p className='cashflow-header-text'>Expenses</p>
</div>
<BasicSelect />
</header>
Expand Down
2 changes: 2 additions & 0 deletions src/components/TransactionsTable/TransactionsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const transactionEntries = sortedTransactions.map((transaction) => {
return (
<tr className="transactions-tr" key={transaction.id}>
<td>{titleize(transaction.vendor)}</td>
<td>{titleize(transaction.category || "Income")}</td>
<td>{transaction.date}</td>
<td>{(transaction.amount / 100).toLocaleString('en-US', { style: 'currency', currency: 'USD' })}</td>
<td style={{ color: statusColor }} className="transactions-status-text">{titleize(transaction.status)}</td>
Expand Down Expand Up @@ -50,6 +51,7 @@ const transactionEntries = sortedTransactions.map((transaction) => {
<thead>
<tr>
<th>Name</th>
<th>Category</th>
<th>Date</th>
<th>Amount</th>
<th>Status</th>
Expand Down
1 change: 1 addition & 0 deletions src/components/apollo-client/queries/getTransactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ query getTransactions($email: String!) {
id
amount
date
category
vendor
status
}
Expand Down

0 comments on commit c2a62a9

Please sign in to comment.