| 
									
										
										
										
											2023-01-03 11:55:46 -08:00
										 |  |  | // Copyright 2020 Signal Messenger, LLC
 | 
					
						
							| 
									
										
										
										
											2020-10-30 15:34:04 -05:00
										 |  |  | // SPDX-License-Identifier: AGPL-3.0-only
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | import * as React from 'react'; | 
					
						
							| 
									
										
										
										
											2020-09-14 12:51:27 -07:00
										 |  |  | import { boolean } from '@storybook/addon-knobs'; | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-17 20:30:08 -04:00
										 |  |  | import { setupI18n } from '../../util/setupI18n'; | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | import enMessages from '../../../_locales/en/messages.json'; | 
					
						
							| 
									
										
										
										
											2021-10-26 14:15:33 -05:00
										 |  |  | import type { Props } from './VerificationNotification'; | 
					
						
							|  |  |  | import { VerificationNotification } from './VerificationNotification'; | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | const i18n = setupI18n('en', enMessages); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-06 20:48:02 -04:00
										 |  |  | export default { | 
					
						
							|  |  |  |   title: 'Components/Conversation/VerificationNotification', | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-16 11:15:43 -05:00
										 |  |  | const contact = { title: 'Mr. Fire' }; | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | const createProps = (overrideProps: Partial<Props> = {}): Props => ({ | 
					
						
							|  |  |  |   i18n, | 
					
						
							|  |  |  |   type: overrideProps.type || 'markVerified', | 
					
						
							|  |  |  |   isLocal: boolean('isLocal', overrideProps.isLocal !== false), | 
					
						
							| 
									
										
										
										
											2021-09-02 16:23:27 -05:00
										 |  |  |   contact: overrideProps.contact || contact, | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | export function MarkAsVerified(): JSX.Element { | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  |   const props = createProps({ type: 'markVerified' }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return <VerificationNotification {...props} />; | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-06-06 20:48:02 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | MarkAsVerified.story = { | 
					
						
							|  |  |  |   name: 'Mark as Verified', | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | export function MarkAsNotVerified(): JSX.Element { | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  |   const props = createProps({ type: 'markNotVerified' }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return <VerificationNotification {...props} />; | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-06 20:48:02 -04:00
										 |  |  | MarkAsNotVerified.story = { | 
					
						
							|  |  |  |   name: 'Mark as Not Verified', | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | export function MarkAsVerifiedRemotely(): JSX.Element { | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  |   const props = createProps({ type: 'markVerified', isLocal: false }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return <VerificationNotification {...props} />; | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-06 20:48:02 -04:00
										 |  |  | MarkAsVerifiedRemotely.story = { | 
					
						
							|  |  |  |   name: 'Mark as Verified Remotely', | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | export function MarkAsNotVerifiedRemotely(): JSX.Element { | 
					
						
							| 
									
										
										
										
											2020-08-26 11:40:23 -07:00
										 |  |  |   const props = createProps({ type: 'markNotVerified', isLocal: false }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return <VerificationNotification {...props} />; | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-06-06 20:48:02 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | MarkAsNotVerifiedRemotely.story = { | 
					
						
							|  |  |  |   name: 'Mark as Not Verified Remotely', | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2021-09-02 16:23:27 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | export function LongName(): JSX.Element { | 
					
						
							| 
									
										
										
										
											2021-09-02 16:23:27 -05:00
										 |  |  |   const longName = '🎆🍬🏈'.repeat(50); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const props = createProps({ | 
					
						
							|  |  |  |     type: 'markVerified', | 
					
						
							| 
									
										
										
										
											2021-09-16 11:15:43 -05:00
										 |  |  |     contact: { title: longName }, | 
					
						
							| 
									
										
										
										
											2021-09-02 16:23:27 -05:00
										 |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return <VerificationNotification {...props} />; | 
					
						
							| 
									
										
										
										
											2022-11-17 16:45:19 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-06-06 20:48:02 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | LongName.story = { | 
					
						
							|  |  |  |   name: 'Long name', | 
					
						
							|  |  |  | }; |