File tree Expand file tree Collapse file tree 4 files changed +12
-24
lines changed
apps/meteor/client/components/InvitationBadge
packages/i18n/src/locales Expand file tree Collapse file tree 4 files changed +12
-24
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,6 @@ const wrapper = mockAppRoot()
99 } )
1010 . build ( ) ;
1111
12- it ( 'should render InvitationBadge without date' , ( ) => {
13- const { baseElement } = render ( < InvitationBadge /> , { wrapper } ) ;
14- expect ( baseElement ) . toMatchSnapshot ( ) ;
15- } ) ;
16-
1712it ( 'should render InvitationBadge with date ISO string' , ( ) => {
1813 const { baseElement } = render ( < InvitationBadge invitationDate = '2025-01-01T12:00:00Z' /> , { wrapper } ) ;
1914 expect ( baseElement ) . toMatchSnapshot ( ) ;
Original file line number Diff line number Diff line change @@ -5,15 +5,24 @@ import { useTranslation } from 'react-i18next';
55import { useTimeAgo } from '../../hooks/useTimeAgo' ;
66
77type InvitationBadgeProps = Omit < ComponentProps < typeof Icon > , 'name' | 'color' | 'role' > & {
8- invitationDate ? : string | Date ;
8+ invitationDate : string | Date ;
99} ;
1010
1111const InvitationBadge = ( { invitationDate, ...props } : InvitationBadgeProps ) => {
1212 const { t } = useTranslation ( ) ;
1313 const timeAgo = useTimeAgo ( ) ;
14- const formattedDate = invitationDate ? t ( 'Invited__date__' , { date : timeAgo ( invitationDate ) } ) : t ( 'Invited' ) ;
1514
16- return < Icon size = 'x20' { ...props } role = 'status' color = 'info' name = 'mail' aria-hidden = 'false' title = { formattedDate } /> ;
15+ return (
16+ < Icon
17+ size = 'x20'
18+ { ...props }
19+ role = 'status'
20+ color = 'info'
21+ name = 'mail'
22+ aria-hidden = 'false'
23+ title = { t ( 'Invited__date__' , { date : timeAgo ( invitationDate ) } ) }
24+ />
25+ ) ;
1726} ;
1827
1928export default InvitationBadge ;
Original file line number Diff line number Diff line change @@ -29,18 +29,3 @@ exports[`should render InvitationBadge with date ISO string 1`] = `
2929 </div >
3030</body >
3131` ;
32-
33- exports [` should render InvitationBadge without date 1` ] = `
34- <body >
35- <div >
36- <i
37- aria-hidden = " false"
38- class = " rcx-box rcx-box--full rcx-icon--name-mail rcx-icon rcx-css-dpa92h"
39- role = " status"
40- title = " Invited"
41- >
42-
43- </i >
44- </div >
45- </body >
46- ` ;
Original file line number Diff line number Diff line change 26792679 "Invitation_Subject" : " Invitation Subject" ,
26802680 "Invitation_Subject_Default" : " You have been invited to [Site_Name]" ,
26812681 "Invite" : " Invite" ,
2682- "Invited" : " Invited" ,
26832682 "Invited__date__" : " Invited {{date}}" ,
26842683 "Invite_Link" : " Invite Link" ,
26852684 "Invite_Users" : " Invite Members" ,
You can’t perform that action at this time.
0 commit comments