[PR #1936] [MERGED] [Maintenance] Refactor amount input to typescript #4031

Closed
opened 2026-02-28 20:50:32 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1936
Author: @kymckay
Created: 11/20/2023
Status: Merged
Merged: 11/20/2023
Merged by: @MatissJanis

Base: masterHead: ts-inputs


📝 Commits (3)

  • 154b4fd convert amount input to typescript
  • 6549148 make content optional for input with content
  • e3d335a add release note

📊 Changes

3 files changed (+25 additions, -7 deletions)

View changed files

📝 packages/desktop-client/src/components/common/InputWithContent.tsx (+2 -2)
📝 packages/desktop-client/src/components/util/AmountInput.tsx (+17 -5)
upcoming-release-notes/1936.md (+6 -0)

📄 Description

  • Small refactor to start exploring the codebase. Maintains parity with the previous JS component.
  • Tweaked the props of the InputWithContent component to reflect how it is used and quell the typescript errors.
    • Most uses appear to omit leftContent or rightContent so this allows for that instead of explicitly passing undefined values.
    • It probably never makes sense to use this component with neither prop, but adding a union with an intersection representing the exclusive optional cases is pretty ugly.

I was going to do GenericInput too, but that's some form of factory pattern that requires a bit more thought so keeping this PR tight and simple.

Part of #1483


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/1936 **Author:** [@kymckay](https://github.com/kymckay) **Created:** 11/20/2023 **Status:** ✅ Merged **Merged:** 11/20/2023 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `ts-inputs` --- ### 📝 Commits (3) - [`154b4fd`](https://github.com/actualbudget/actual/commit/154b4fdb3136b32b64d1e20a4cf7646e6f88fdd0) convert amount input to typescript - [`6549148`](https://github.com/actualbudget/actual/commit/6549148975e2c2dbd7002aeed96d52eee493e715) make content optional for input with content - [`e3d335a`](https://github.com/actualbudget/actual/commit/e3d335a9d3279d2768910d100895d3b4aad0358d) add release note ### 📊 Changes **3 files changed** (+25 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/common/InputWithContent.tsx` (+2 -2) 📝 `packages/desktop-client/src/components/util/AmountInput.tsx` (+17 -5) ➕ `upcoming-release-notes/1936.md` (+6 -0) </details> ### 📄 Description - Small refactor to start exploring the codebase. Maintains parity with the previous JS component. - Tweaked the props of the `InputWithContent` component to reflect how it is used and quell the typescript errors. - Most uses appear to omit `leftContent` or `rightContent` so this allows for that instead of explicitly passing undefined values. - It probably never makes sense to use this component with neither prop, but adding a union with an intersection representing the exclusive optional cases is pretty ugly. I was going to do `GenericInput` too, but that's some form of factory pattern that requires a bit more thought so keeping this PR tight and simple. Part of #1483 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:50:32 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4031