Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

[WIP] New Apply Page #33

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions merry/src/components/ExternalRedirect/ExternalRedirect.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Route } from 'react-router-dom';

const ExternalRedirect = props => {
const { from, to, ...other } = props;

return <Route path={from} component={() => (window.location.href = to)} {...other} />;
};

ExternalRedirect.propTypes = {
from: PropTypes.string.isRequired,
to: PropTypes.string.isRequired,
};

export default ExternalRedirect;
3 changes: 3 additions & 0 deletions merry/src/components/ExternalRedirect/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ExternalRedirect from './ExternalRedirect';

export default ExternalRedirect;
2 changes: 2 additions & 0 deletions merry/src/components/components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AbsoluteModal from './AbsoluteModal';
import BlankButton from './BlankButton';
import Button from './Button';
import ExternalRedirect from './ExternalRedirect';
import Field from './Field';
import FullScreenModal from './FullScreenModal';
import Input from './Input';
Expand All @@ -20,6 +21,7 @@ export {
AbsoluteModal,
BlankButton,
Button,
ExternalRedirect,
Field,
FullScreenModal,
Input,
Expand Down