-
Notifications
You must be signed in to change notification settings - Fork 20
Feature/#217 create tree component #790
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
Conversation
…, create helper functions for position calculation taking in acount indentation
…e for subfolder and file
…just automatic height calculation to always fit content
…d file tree shapes, add selectSizeV2 to properties pod
…hat manages font and icon dimensions
| }; | ||
|
|
||
| // Hook to resize edition text area based on content | ||
| export const useFileTreeResizeOnContentChange = ( |
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.
I use to keep business just for plain vainilla ts code, it would be good idea to place hooks on a diferent file, e.g. file-tree-resize.hook.ts
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.
Created file-tree-resize.hook.ts and moved both hooks to the new file
| ]); | ||
| }; | ||
|
|
||
| export const useFileTreeResizeOnSizeChange = ( |
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.
Maybe you can keep this two hooks private and create a third hook that wraps this two, something like
useFilteTreeResize
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.
Both private hooks wrapped into useFileTreeResize hook
| @@ -0,0 +1 @@ | |||
| export * from './select-size-v2.component'; | |||
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.
select-size-v2 applies to only the file tree, doesn`t it?
If that's the case then let's call it select-size-filetree, or we could call it select-size-two-sizes but it's a bit strange
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.
I've created the issue #791 for the future replacement of select size
| baseRestrictions: ShapeSizeRestrictions; | ||
| } | ||
|
|
||
| export const parseFileTreeText = (text: string): FileTreeItem[] => { |
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.
It would be a good idea to add unit tests to this method, including corner cases
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.
Unit tests done!
…rap both hooks with useFileTreeResize, export the wrapper function and update main component file
… and eliminate empty space, establish min height from 120 to 50
…nt adaptation when switching between sizes
Close #217