feat(#179): add error popup to facebook auth
parent
3fafdca9a8
commit
d800c5ef9a
@ -0,0 +1,34 @@ |
|||||||
|
import { T9n } from 'features/T9n' |
||||||
|
|
||||||
|
import { |
||||||
|
ScBody, |
||||||
|
Modal, |
||||||
|
ScText, |
||||||
|
ScWrapper, |
||||||
|
} from './styled' |
||||||
|
|
||||||
|
type Props = { |
||||||
|
error: string, |
||||||
|
handleModalClose: () => void, |
||||||
|
isModalOpen: boolean, |
||||||
|
} |
||||||
|
|
||||||
|
export const ErrorPopup = ({ |
||||||
|
error, |
||||||
|
handleModalClose, |
||||||
|
isModalOpen, |
||||||
|
}: Props) => ( |
||||||
|
<Modal |
||||||
|
close={handleModalClose} |
||||||
|
isOpen={isModalOpen} |
||||||
|
withCloseButton |
||||||
|
> |
||||||
|
<ScWrapper> |
||||||
|
<ScBody> |
||||||
|
<ScText> |
||||||
|
<T9n t={error} /> |
||||||
|
</ScText> |
||||||
|
</ScBody> |
||||||
|
</ScWrapper> |
||||||
|
</Modal> |
||||||
|
) |
||||||
@ -0,0 +1,54 @@ |
|||||||
|
import styled, { css } from 'styled-components/macro' |
||||||
|
|
||||||
|
import { isMobileDevice } from 'config/userAgent' |
||||||
|
import { devices } from 'config/devices' |
||||||
|
|
||||||
|
import { ModalWindow } from 'features/Modal/styled' |
||||||
|
import { |
||||||
|
Body, |
||||||
|
Modal as BaseModal, |
||||||
|
} from 'features/AuthServiceApp/components/RegisterPopup/styled' |
||||||
|
|
||||||
|
export const Modal = styled(BaseModal)` |
||||||
|
${ModalWindow} { |
||||||
|
min-height: 220px; |
||||||
|
padding-top: 0; |
||||||
|
|
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
|
||||||
|
${isMobileDevice |
||||||
|
? css` |
||||||
|
@media ${devices.mobile} { |
||||||
|
width: 95vw; |
||||||
|
padding-top: 0; |
||||||
|
} |
||||||
|
` |
||||||
|
: ''}; |
||||||
|
} |
||||||
|
` |
||||||
|
|
||||||
|
export const ScBody = styled(Body)` |
||||||
|
` |
||||||
|
|
||||||
|
export const ScText = styled.span` |
||||||
|
text-align: center; |
||||||
|
|
||||||
|
${isMobileDevice |
||||||
|
? css` |
||||||
|
font-size: 14px; |
||||||
|
` |
||||||
|
: ''}; |
||||||
|
` |
||||||
|
|
||||||
|
type WrapperProps = { |
||||||
|
isFetching?: boolean, |
||||||
|
} |
||||||
|
|
||||||
|
export const ScWrapper = styled.div<WrapperProps>` |
||||||
|
${({ isFetching }) => ( |
||||||
|
isFetching |
||||||
|
? css`pointer-events: none;` |
||||||
|
: '' |
||||||
|
)} |
||||||
|
` |
||||||
Loading…
Reference in new issue