overleaf/services/web/frontend/stories/settings/add-email-input.stories.tsx
Miguel Serrano 5ed9987345 [Settings] Autocomplete input for Add Email Form (#7747)
* [Settings] Autocomplete input for Add Email Form

* Applied PR Feedback

GitOrigin-RevId: 27d2ef97deb836e92283e89675dfa3866f44904f
2022-04-27 08:04:10 +00:00

27 lines
659 B
TypeScript

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