2022-04-26 11:26:54 +00:00
|
|
|
import useFetchMock from './../hooks/use-fetch-mock'
|
2022-05-11 09:19:10 +00:00
|
|
|
import Input from '../../js/features/settings/components/emails/add-email/input'
|
2022-04-26 11:26:54 +00:00
|
|
|
|
2022-05-30 10:18:36 +00:00
|
|
|
export const EmailInput = (args: any) => {
|
2022-04-26 11:26:54 +00:00
|
|
|
useFetchMock(fetchMock =>
|
|
|
|
fetchMock.get(/\/institutions\/domains/, [
|
2022-04-27 16:13:17 +00:00
|
|
|
{
|
|
|
|
hostname: 'autocomplete.edu',
|
|
|
|
university: { id: 123, name: 'Auto Complete University' },
|
|
|
|
},
|
2022-04-26 11:26:54 +00:00
|
|
|
])
|
|
|
|
)
|
|
|
|
return (
|
|
|
|
<>
|
2022-05-11 09:19:10 +00:00
|
|
|
<Input {...args} />
|
2022-04-26 11:26:54 +00:00
|
|
|
<br />
|
|
|
|
<div>
|
|
|
|
Use <code>autocomplete.edu</code> as domain to trigger an autocomplete
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Account Settings / Emails and Affiliations',
|
2022-05-11 09:19:10 +00:00
|
|
|
component: Input,
|
2022-04-26 11:26:54 +00:00
|
|
|
argTypes: {
|
|
|
|
onChange: { action: 'change' },
|
|
|
|
},
|
|
|
|
}
|