-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] ♻️ (typescript) convert TransactionListWithBalances.jsx to .tsx #3876
[WIP] ♻️ (typescript) convert TransactionListWithBalances.jsx to .tsx #3876
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
@@ -314,16 +315,20 @@ function TransactionListWithPreviews({ | |||
); | |||
|
|||
const transactionsToDisplay = !isSearching | |||
? previewTransactions.concat(transactions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code was resulting in a readonly
version of transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is intentional. We should instead update transactions
prop of TransactionListWithBalances
as readonly
marginTop: 10, | ||
}} | ||
> | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only change here is I wrapped the two children in a <></>
so that there is only a single child inside <SelectedProvider></SelectedProvider>
. I did not touch the components inside the <></>
This is probably ready for review, but let me do one more pass tomorrow. |
@@ -247,9 +248,9 @@ function TransactionListWithPreviews({ | |||
const dispatch = useDispatch(); | |||
const navigate = useNavigate(); | |||
|
|||
const onRefresh = useCallback(() => { | |||
const onRefresh = useCallback(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be async?
@@ -314,16 +315,20 @@ function TransactionListWithPreviews({ | |||
); | |||
|
|||
const transactionsToDisplay = !isSearching | |||
? previewTransactions.concat(transactions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is intentional. We should instead update transactions
prop of TransactionListWithBalances
as readonly
@@ -57,6 +66,19 @@ function TransactionSearchInput({ placeholder, onSearch }) { | |||
); | |||
} | |||
|
|||
type TransactionListWithBalancesProps = { | |||
isLoading: boolean | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLoading: boolean | undefined; | |
isLoading?: boolean; |
@@ -57,6 +66,19 @@ function TransactionSearchInput({ placeholder, onSearch }) { | |||
); | |||
} | |||
|
|||
type TransactionListWithBalancesProps = { | |||
isLoading: boolean | undefined; | |||
transactions: TransactionEntity[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transactions: TransactionEntity[]; | |
transactions: readonly TransactionEntity[]; |
balanceCleared, | ||
balance, | ||
}: { | ||
balanceUncleared: SheetFields<SheetNames>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a BalanceWithClearedProps
type
@@ -170,7 +202,7 @@ function BalanceWithCleared({ balanceUncleared, balanceCleared, balance }) { | |||
); | |||
} | |||
|
|||
function Balance({ balance }) { | |||
function Balance({ balance }: { balance: SheetFields<SheetNames> }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a BalanceProps
balanceUncleared={balanceQueries.uncleared} | ||
balance={balanceQueries.balance.name as SheetFields<SheetNames>} | ||
balanceCleared={ | ||
(balanceQueries.cleared?.name as SheetFields<SheetNames>) ?? undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change the behavior. This is ignoring the query
property of the binding. These should be Binding
s instead.
👋 Hi! It looks like this PR has not had any changes for a week now. Would you like someone to review this PR? If so - please remove the "[WIP]" prefix from the PR title. That will let the community know that this PR is open for a review. |
This PR was closed because it has been stalled for 5 days with no activity. |
#1483
CategoryTransactions.jsx
to .tsxAccountTransactions.tsx