-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 #41672 from software-mansion-labs/search-v1-p2/dyn…
…amic-columns
- Loading branch information
Showing
12 changed files
with
294 additions
and
115 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
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,31 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import type {StyleProp, TextStyle, ViewStyle} from 'react-native'; | ||
import Text from '@components/Text'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
type SearchTableHeaderColumnProps = { | ||
shouldShow?: boolean; | ||
containerStyle?: StyleProp<ViewStyle>; | ||
text: string; | ||
textStyle?: StyleProp<TextStyle>; | ||
}; | ||
|
||
export default function SearchTableHeaderColumn({containerStyle, text, textStyle, shouldShow = true}: SearchTableHeaderColumnProps) { | ||
const styles = useThemeStyles(); | ||
|
||
if (!shouldShow) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<View style={containerStyle}> | ||
<Text | ||
numberOfLines={1} | ||
style={[styles.mutedNormalTextLabel, textStyle]} | ||
> | ||
{text} | ||
</Text> | ||
</View> | ||
); | ||
} |
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,45 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Icon from '@components/Icon'; | ||
import Text from '@components/Text'; | ||
import Tooltip from '@components/Tooltip'; | ||
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import type IconAsset from '@src/types/utils/IconAsset'; | ||
|
||
type TextWithIconCellProps = { | ||
icon: IconAsset; | ||
text?: string; | ||
showTooltip: boolean; | ||
}; | ||
|
||
export default function TextWithIconCell({icon, text, showTooltip}: TextWithIconCellProps) { | ||
const styles = useThemeStyles(); | ||
const theme = useTheme(); | ||
|
||
if (!text) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Tooltip | ||
shouldRender={showTooltip} | ||
text={text} | ||
> | ||
<View style={[styles.flexRow, styles.flexShrink1, styles.gap1]}> | ||
<Icon | ||
src={icon} | ||
fill={theme.icon} | ||
height={12} | ||
width={12} | ||
/> | ||
<Text | ||
numberOfLines={1} | ||
style={[styles.optionDisplayName, styles.label, styles.pre, styles.justifyContentCenter, styles.textMicro, styles.textSupporting, styles.flexShrink1]} | ||
> | ||
{text} | ||
</Text> | ||
</View> | ||
</Tooltip> | ||
); | ||
} |
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
Oops, something went wrong.