Skip to content

Commit ae6fbc2

Browse files
authored
Merge pull request #83811 from samranahm/79767/add-verified-badge
feat: Add verified badge in domains list row after verifying the domain
2 parents 50581be + 7eb9e8f commit ae6fbc2

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/components/Domain/DomainMenuItem.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ function DomainMenuItem({item, index}: DomainMenuItemProps) {
5656
const {translate} = useLocalize();
5757
const {isAdmin, isValidated, action} = item;
5858

59+
let badgeText: string | undefined;
60+
if (isAdmin) {
61+
badgeText = isValidated ? translate('common.verified') : translate('domain.notVerified');
62+
}
63+
5964
const threeDotsMenuItems: PopoverMenuItem[] | undefined = useMemo(
6065
() =>
6166
isAdmin
@@ -93,7 +98,8 @@ function DomainMenuItem({item, index}: DomainMenuItemProps) {
9398
{({hovered}) => (
9499
<DomainsListRow
95100
title={item.title}
96-
badgeText={isAdmin && !isValidated ? translate('domain.notVerified') : undefined}
101+
badgeText={badgeText}
102+
isBadgeSuccess={isValidated}
97103
isHovered={hovered}
98104
menuItems={threeDotsMenuItems}
99105
brickRoadIndicator={item.brickRoadIndicator}

src/components/Domain/DomainsListRow.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ type DomainsListRowProps = {
2222
/** The text to display inside a badge next to the title */
2323
badgeText?: string;
2424

25+
/** Whether the badge should use success styling */
26+
isBadgeSuccess?: boolean;
27+
2528
/** Items for the three dots menu */
2629
menuItems?: PopoverMenuItem[];
2730

2831
/** The type of brick road indicator to show */
2932
brickRoadIndicator?: ValueOf<typeof CONST.BRICK_ROAD_INDICATOR_STATUS>;
3033
};
3134

32-
function DomainsListRow({title, isHovered, badgeText, brickRoadIndicator, menuItems}: DomainsListRowProps) {
35+
function DomainsListRow({title, isHovered, badgeText, isBadgeSuccess, brickRoadIndicator, menuItems}: DomainsListRowProps) {
3336
const styles = useThemeStyles();
3437
const theme = useTheme();
3538

@@ -53,6 +56,7 @@ function DomainsListRow({title, isHovered, badgeText, brickRoadIndicator, menuIt
5356
<View style={[styles.flexRow, styles.gap2, styles.alignItemsCenter, styles.justifyContentEnd]}>
5457
<Badge
5558
text={badgeText}
59+
success={isBadgeSuccess}
5660
textStyles={styles.textStrong}
5761
badgeStyles={styles.alignSelfCenter}
5862
/>

0 commit comments

Comments
 (0)