Skip to content

Commit

Permalink
fix: getStringParts function
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanad94 committed Mar 11, 2024
1 parent ae60a60 commit 26d660b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/sensenet/src/components/tree/tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type TreeProps = {
treeData: ItemType
}

const CHARACHTER_SPLIT = 6
const CHARACHTER_SPLIT = 10
const getStringParts = (str: string) => {
return [str.slice(0, Math.abs(CHARACHTER_SPLIT - 1)), str.slice(Math.abs(CHARACHTER_SPLIT) * -1)]
return [str.slice(0, CHARACHTER_SPLIT * -1), str.slice(CHARACHTER_SPLIT * -1)]
}

const useStyles = makeStyles(() => {
Expand All @@ -33,7 +33,7 @@ const useStyles = makeStyles(() => {
flexWrap: 'no-wrap',
maxWidth: 'calc(100% - 56px)',
flex: 1,
'& .second': {
'& .second span': {
width: `${CHARACHTER_SPLIT}ch`,
},
'& .first': {
Expand Down Expand Up @@ -162,6 +162,7 @@ export function Tree({ treeData, itemCount, onItemClick, loadMore, isLoading, ac
selected={activeItemPath === item.Path}
key={keyPrefix}
style={{ paddingLeft }}
data-item-name={item.Name}
button>
<ListItemIcon>
<Icon item={item} />
Expand Down

0 comments on commit 26d660b

Please sign in to comment.