Skip to content

Commit

Permalink
Merge pull request #31528 from JKobrynski/migrateUnreadActionIndicato…
Browse files Browse the repository at this point in the history
…rToTypeScript

[TS Migration] Migrate UnreadActionIndicator.js to TypeScript
  • Loading branch information
mountiny authored Nov 22, 2023
2 parents fc14a3f + c0a947d commit f1e085b
Showing 1 changed file with 13 additions and 8 deletions.
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;

0 comments on commit f1e085b

Please sign in to comment.