mirror of
https://github.com/valitydev/checkout.git
synced 2024-11-06 10:35:20 +00:00
Lift up redirect url link (#263)
This commit is contained in:
parent
e5ba2567ea
commit
43e0b9b1ba
@ -55,11 +55,6 @@ export const ActionBlock = () => {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{initConfig.redirectUrl && (
|
||||
<OthersButton onClick={() => window.open(initConfig.redirectUrl, '_self')}>
|
||||
{locale['form.button.back.to.website']}
|
||||
</OthersButton>
|
||||
)}
|
||||
</ErrorBlock>
|
||||
);
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { useContext, useEffect, useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Link } from 'checkout/components/ui';
|
||||
import { FormName, ModalForms, ModalName, ResultFormInfo, ResultType } from 'checkout/hooks';
|
||||
import { findNamed } from 'checkout/utils/find-named';
|
||||
import isNil from 'checkout/utils/is-nil';
|
||||
@ -13,6 +14,10 @@ import { InitialContext } from '../../../../initial-context';
|
||||
import { ResultContext } from '../../../../result-context';
|
||||
import { ModalContext } from '../../../modal-context';
|
||||
|
||||
const OthersButton = styled(Link)`
|
||||
padding-top: 12px;
|
||||
`;
|
||||
|
||||
const Title = styled.h2`
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
@ -40,7 +45,7 @@ const Container = styled.div<{ $hasActions: boolean }>`
|
||||
`;
|
||||
|
||||
const ResultForm = ({ onMount }: { onMount: () => void }) => {
|
||||
const { locale } = useContext(InitialContext);
|
||||
const { locale, initConfig } = useContext(InitialContext);
|
||||
const { setIsComplete } = useContext(ResultContext);
|
||||
const { modalState } = useContext(ModalContext);
|
||||
const { hasActions, type, header, description, hasDone } = useMemo(() => {
|
||||
@ -81,6 +86,11 @@ const ResultForm = ({ onMount }: { onMount: () => void }) => {
|
||||
<Title>{header}</Title>
|
||||
<Description> {description}</Description>
|
||||
{hasActions ? <ActionBlock /> : false}
|
||||
{initConfig?.redirectUrl && (
|
||||
<OthersButton onClick={() => window.open(initConfig.redirectUrl, '_self')}>
|
||||
{locale['form.button.back.to.website']}
|
||||
</OthersButton>
|
||||
)}
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user