Skip to content
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

Maintenance: BudgetSummary & CreateLocalAccount to tsx #1768

Merged

Conversation

MikesGlitch
Copy link
Contributor

@MikesGlitch MikesGlitch commented Oct 7, 2023

Convert BudgetSummary modal(mobile) and CreateLocalAccounts components to TypeScript.

Relates to : #1483

@netlify
Copy link

netlify bot commented Oct 7, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit d1bbdd6
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6521bf4ced9df900087a907c
😎 Deploy Preview https://deploy-preview-1768.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -26,7 +33,7 @@ function CreateLocalAccount({ modalProps, actions }) {
let validateBalance = balance => !isNaN(parseFloat(balance));

return (
<Modal title="Create Local Account" {...modalProps} showBack={false}>
Copy link
Contributor Author

@MikesGlitch MikesGlitch Oct 7, 2023

Choose a reason for hiding this comment

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

"showBack" is not a valid property for Modal - it does nothing. This is the only place where a showBack prop is set on Modal - I think this may be old code.

The Back button logic is handled inside this component - verified it still works.
still back button

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2023

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
16 2.48 MB → 2.48 MB (-16 B) -0.00%
Changeset
File Δ Size
src/components/modals/CreateLocalAccount.tsx 🆕 +8.66 kB 0 B → 8.66 kB
src/components/modals/BudgetSummary.tsx 🆕 +5.56 kB 0 B → 5.56 kB
src/components/modals/CreateLocalAccount.js 🔥 -8.68 kB (-100%) 8.68 kB → 0 B
src/components/modals/BudgetSummary.js 🔥 -5.6 kB (-100%) 5.6 kB → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/main.js 1.12 MB → 1.12 MB (-16 B) -0.00%

Unchanged

Asset File Size % Changed
static/js/678.chunk.js 420.74 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/713.chunk.js 156.56 kB 0%
static/js/wide-components.chunk.js 126.84 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/narrow-components.chunk.js 34.74 kB 0%
static/js/reports.chunk.js 29.23 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/389.chunk.js 12.77 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 903 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2023

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@@ -8,7 +8,7 @@ type InlineFieldProps = {
label: ReactNode;
labelWidth?: number;
children?: ReactNode;
width: number;
width: number | string;
Copy link
Contributor Author

@MikesGlitch MikesGlitch Oct 7, 2023

Choose a reason for hiding this comment

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

width is being used as a string like:

width: '75%'

numbers are also valid. width: 100 would mean 100px


return (
<Modal title="Budget Details" {...modalProps} animate>
<Modal title="Budget Details" {...modalProps}>
Copy link
Contributor Author

@MikesGlitch MikesGlitch Oct 7, 2023

Choose a reason for hiding this comment

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

Removed animate prop as it doesn't get used by anything as far as I can see. It's nowhere else in the code - seems like an anomaly.

Verified, it is still working as before:
animates by default

@@ -1,9 +1,10 @@
import React from 'react';

import { rolloverBudget } from 'loot-core/src/client/queries';
import * as monthUtils from 'loot-core/src/shared/months';
Copy link
Contributor Author

@MikesGlitch MikesGlitch Oct 7, 2023

Choose a reason for hiding this comment

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

Only importing what's needed

@@ -164,7 +164,7 @@ type SingleAutocompleteProps = {
openOnFocus?: boolean;
getHighlightedIndex?: (suggestions) => number | null;
highlightFirst?: boolean;
onUpdate: (id: unknown, value: string) => void;
onUpdate?: (id: unknown, value: string) => void;
Copy link
Contributor Author

@MikesGlitch MikesGlitch Oct 7, 2023

Choose a reason for hiding this comment

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

This is optional - it's rarely specified - found it when looking in another area.

@MikesGlitch MikesGlitch marked this pull request as ready for review October 7, 2023 20:36
@MikesGlitch MikesGlitch changed the title CreateLocalAccount to tsx Maintenance: BudgetSummary & CreateLocalAccount to tsx Oct 7, 2023
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Thanks! Very easy to review 👏

@MatissJanis MatissJanis merged commit efba86a into actualbudget:master Oct 9, 2023
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Oct 9, 2023
@MikesGlitch MikesGlitch deleted the maintenance/js-to-ts-modals-1 branch October 10, 2023 20:30
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants