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

Add Feature, Capitalize the first letter of Category name #597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Feature, Capitalize the first letter of Category name
shahadrn committed Nov 25, 2022
commit 3baa39c4acaacb8be14dc32066a7007192c69f6b
27,947 changes: 20 additions & 27,927 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/client/components/AppSidebar/AddCategoryForm.tsx
Original file line number Diff line number Diff line change
@@ -30,7 +30,10 @@ export const AddCategoryForm: React.FC<AddCategoryFormProps> = ({
maxLength={20}
placeholder="New category..."
onChange={(event) => {
changeHandler(editingCategoryId, event.target.value)
changeHandler(
editingCategoryId,
event.target.value.charAt(0).toUpperCase() + event.target.value.slice(1)
Copy link

@jreflores jreflores Aug 27, 2023

Choose a reason for hiding this comment

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

You can make this simple by using lodash's capitalize(). Also encourage to write unit or e2e test for this.

)
}}
onBlur={(event) => {
if (!tempCategoryName || tempCategoryName.trim() === '') {