All checks were successful
continuous-integration/drone/push Build is passing
21 lines
490 B
TypeScript
21 lines
490 B
TypeScript
type VerifiedEmailVisibilityOptions = {
|
|
verifiedAt: string | null;
|
|
persistedEmail: string;
|
|
currentEmail: string;
|
|
isEditing: boolean;
|
|
};
|
|
|
|
export function shouldShowVerifiedEmailBadge(options: VerifiedEmailVisibilityOptions): boolean {
|
|
const { verifiedAt, persistedEmail, currentEmail, isEditing } = options;
|
|
|
|
if (!verifiedAt) {
|
|
return false;
|
|
}
|
|
|
|
if (!isEditing) {
|
|
return true;
|
|
}
|
|
|
|
return persistedEmail.trim() === currentEmail.trim();
|
|
}
|