-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #31528 from JKobrynski/migrateUnreadActionIndicato…
…rToTypeScript [TS Migration] Migrate UnreadActionIndicator.js to TypeScript
- Loading branch information
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
21 changes: 13 additions & 8 deletions
21
src/components/UnreadActionIndicator.js → src/components/UnreadActionIndicator.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 |
---|---|---|
@@ -1,26 +1,31 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useThemeStyles from '@styles/useThemeStyles'; | ||
import CONST from '@src/CONST'; | ||
import Text from './Text'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
|
||
function UnreadActionIndicator(props) { | ||
type UnreadActionIndicatorProps = { | ||
reportActionID: string; | ||
}; | ||
|
||
function UnreadActionIndicator({reportActionID}: UnreadActionIndicatorProps) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
|
||
return ( | ||
<View | ||
accessibilityLabel={props.translate('accessibilityHints.newMessageLineIndicator')} | ||
data-action-id={props.reportActionID} | ||
accessibilityLabel={translate('accessibilityHints.newMessageLineIndicator')} | ||
data-action-id={reportActionID} | ||
style={[styles.unreadIndicatorContainer, styles.userSelectNone, styles.pointerEventsNone]} | ||
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} | ||
> | ||
<View style={styles.unreadIndicatorLine} /> | ||
<Text style={styles.unreadIndicatorText}>{props.translate('common.new')}</Text> | ||
<Text style={styles.unreadIndicatorText}>{translate('common.new')}</Text> | ||
</View> | ||
); | ||
} | ||
|
||
UnreadActionIndicator.propTypes = {...withLocalizePropTypes}; | ||
|
||
UnreadActionIndicator.displayName = 'UnreadActionIndicator'; | ||
export default withLocalize(UnreadActionIndicator); | ||
|
||
export default UnreadActionIndicator; |