overleaf/services/web/frontend/stories/settings/add-email-input.stories.tsx
ilkin-overleaf c807bedb65 Merge pull request #7841 from overleaf/ii-refactor-add-email
Refactor add email section

GitOrigin-RevId: 41de440caaf3baf43673c4a5f07a18b990f28c7b
2022-05-12 08:03:29 +00:00

30 lines
704 B
TypeScript

import useFetchMock from './../hooks/use-fetch-mock'
import Input from '../../js/features/settings/components/emails/add-email/input'
export const EmailInput = args => {
useFetchMock(fetchMock =>
fetchMock.get(/\/institutions\/domains/, [
{
hostname: 'autocomplete.edu',
university: { id: 123, name: 'Auto Complete University' },
},
])
)
return (
<>
<Input {...args} />
<br />
<div>
Use <code>autocomplete.edu</code> as domain to trigger an autocomplete
</div>
</>
)
}
export default {
title: 'Account Settings / Emails and Affiliations',
component: Input,
argTypes: {
onChange: { action: 'change' },
},
}