Implemented short URLs creation

This commit is contained in:
Alejandro Celaya
2018-07-28 18:59:32 +02:00
parent 0a5c20e3ee
commit f7249cfe6e
3 changed files with 21 additions and 15 deletions

View File

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