Connected creation form with redux, and created reducer for short URL creation

This commit is contained in:
Alejandro Celaya
2018-07-28 10:41:05 +02:00
parent c51bf5b9a0
commit 0a5c20e3ee
13 changed files with 116 additions and 48 deletions

View File

@@ -0,0 +1,18 @@
import React from 'react';
import { isNil } from 'ramda';
export default function CreateShortUrlResult ({ creationResult }) {
if (creationResult.loading) {
return <div className="text-center">Loading...</div>
}
if (creationResult.error) {
return <div className="text-center color-danger">An error occurred while creating the URL :(</div>
}
if (isNil(creationResult.result)) {
return null;
}
return <div className="text-center">Great!</div>;
};