Small QOL tweaks

This commit is contained in:
oitsjustjose 2020-10-17 09:41:52 -05:00
commit 996b8c1572
5 changed files with 26 additions and 7 deletions

View file

@ -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>
);
}

View file

@ -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>