Skip to content

Commit

Permalink
add title for display name web component
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Nov 30, 2023
1 parent 2aafb7a commit bab320b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/DisplayNames/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
import React from 'react';
import useLocalize from '@hooks/useLocalize';
import DisplayNamesWithoutTooltip from './DisplayNamesWithoutTooltip';
import DisplayNamesWithToolTip from './DisplayNamesWithTooltip';
import DisplayNamesProps from './types';

function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips}: DisplayNamesProps) {
const {translate} = useLocalize();
const title = fullTitle || translate('common.hidden');

if (!tooltipEnabled) {
return (
<DisplayNamesWithoutTooltip
textStyles={textStyles}
numberOfLines={numberOfLines}
fullTitle={fullTitle}
fullTitle={title}
/>
);
}

return (
<DisplayNamesWithToolTip
shouldUseFullTitle={shouldUseFullTitle}
fullTitle={fullTitle}
fullTitle={title}
displayNamesWithTooltips={displayNamesWithTooltips}
textStyles={textStyles}
numberOfLines={numberOfLines}
Expand Down

0 comments on commit bab320b

Please sign in to comment.