Small QOL tweaks
This commit is contained in:
parent
781efacc8c
commit
996b8c1572
5 changed files with 26 additions and 7 deletions
|
|
@ -47,7 +47,7 @@ export default () => {
|
|||
if (renderState.notFound) {
|
||||
return (
|
||||
<CSSTransition classNames="react-router" appear in timeout={300}>
|
||||
<h2 className="v-center">Paste Not Found</h2>
|
||||
<h2 className="v-center">Paste Not Found Or Expired</h2>
|
||||
</CSSTransition>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export default () => {
|
|||
url: null,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: false,
|
||||
});
|
||||
|
||||
const submit = (evt) => {
|
||||
|
|
@ -21,7 +22,12 @@ export default () => {
|
|||
...state,
|
||||
result: `http://${window.location.host}/u/${data}`.replace('5000', '3000'),
|
||||
loading: false,
|
||||
error: false,
|
||||
});
|
||||
}).catch((ex) => {
|
||||
if (ex.response && ex.response.data === 'INVALID URL') {
|
||||
setState({ ...state, error: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -47,6 +53,12 @@ export default () => {
|
|||
</Button>
|
||||
</InputGroup.Append>
|
||||
</InputGroup>
|
||||
{state.error && (
|
||||
<Form.Text className="text-danger">
|
||||
Please enter a valid URL
|
||||
</Form.Text>
|
||||
)}
|
||||
<Form.Text className="danger" />
|
||||
</Form.Group>
|
||||
</Form>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue