-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #637 from nordnet/feat/table-add-tooltip-to-expand…
…-item Feat/table add tooltip to expand item
- Loading branch information
Showing
7 changed files
with
6,071 additions
and
3,313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
src/Molecules/FlexTable/Row/components/ExpandItems/TextWrapper.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/Molecules/FlexTable/Row/components/ExpandItems/TextWrapperLabel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { FontSize } from '../../../shared/shared.types'; | ||
import { getFontSizeTypographyType } from '../../../shared/textUtils'; | ||
import { Typography, TruncateWithTooltip } from '../../../../..'; | ||
import { TextWrapperComponent } from './ExpandItems.types'; | ||
|
||
const Text: React.FC<{ fontSize: FontSize }> = ({ fontSize, children }) => ( | ||
<Typography type={getFontSizeTypographyType(fontSize)} color={t => t.color.label}> | ||
{children} | ||
</Typography> | ||
); | ||
|
||
export const TextWrapperLabel: TextWrapperComponent = ({ fontSize, children, truncate = true }) => { | ||
if (!truncate) { | ||
return <Text fontSize={fontSize}>{children}</Text>; | ||
} | ||
return ( | ||
<TruncateWithTooltip label={children}> | ||
<Text fontSize={fontSize}>{children}</Text> | ||
</TruncateWithTooltip> | ||
); | ||
}; |
20 changes: 20 additions & 0 deletions
20
src/Molecules/FlexTable/Row/components/ExpandItems/TextWrapperValue.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { Typography, TruncateWithTooltip } from '../../../../..'; | ||
import { FontSize } from '../../../shared/shared.types'; | ||
import { getFontSizeTypographyType } from '../../../shared/textUtils'; | ||
import { TextWrapperComponent } from './ExpandItems.types'; | ||
|
||
const Text: React.FC<{ fontSize: FontSize }> = ({ fontSize, children }) => ( | ||
<Typography type={getFontSizeTypographyType(fontSize)}>{children}</Typography> | ||
); | ||
|
||
export const TextWrapperValue: TextWrapperComponent = ({ fontSize, children, truncate = true }) => { | ||
if (!truncate) { | ||
return <Text fontSize={fontSize}>{children}</Text>; | ||
} | ||
return ( | ||
<TruncateWithTooltip label={children}> | ||
<Text fontSize={fontSize}>{children}</Text> | ||
</TruncateWithTooltip> | ||
); | ||
}; |
Oops, something went wrong.