2022-04-26 07:26:54 -04:00
|
|
|
import useFetchMock from './../hooks/use-fetch-mock'
|
2022-05-11 05:19:10 -04:00
|
|
|
import Input from '../../js/features/settings/components/emails/add-email/input'
|
2024-10-10 03:26:18 -04:00
|
|
|
import { bsVersionDecorator } from '../../../.storybook/utils/with-bootstrap-switcher'
|
2022-04-26 07:26:54 -04:00
|
|
|
|
2022-05-30 06:18:36 -04:00
|
|
|
export const EmailInput = (args: any) => {
|
2022-04-26 07:26:54 -04:00
|
|
|
useFetchMock(fetchMock =>
|
|
|
|
fetchMock.get(/\/institutions\/domains/, [
|
2022-04-27 12:13:17 -04:00
|
|
|
{
|
|
|
|
hostname: 'autocomplete.edu',
|
|
|
|
university: { id: 123, name: 'Auto Complete University' },
|
|
|
|
},
|
2022-04-26 07:26:54 -04:00
|
|
|
])
|
|
|
|
)
|
|
|
|
return (
|
|
|
|
<>
|
2022-05-11 05:19:10 -04:00
|
|
|
<Input {...args} />
|
2022-04-26 07:26:54 -04: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 05:19:10 -04:00
|
|
|
component: Input,
|
2022-04-26 07:26:54 -04:00
|
|
|
argTypes: {
|
|
|
|
onChange: { action: 'change' },
|
2024-10-10 03:26:18 -04:00
|
|
|
...bsVersionDecorator.argTypes,
|
2022-04-26 07:26:54 -04:00
|
|
|
},
|
|
|
|
}
|