Massive change. Changed to react-scripts (webpack) for building. Changed to material-ui where applicable. Changed to CSS-in-JS.

This commit is contained in:
Håvar Aambø Fosstveit
2019-03-29 14:12:13 +01:00
parent 36944a9ea7
commit 0449d6ff20
185 changed files with 4564 additions and 6442 deletions
+40
View File
@@ -0,0 +1,40 @@
import randomString from 'random-string';
import * as stateActions from './stateActions';
// This returns a redux-thunk action (a function).
export const notify = ({ type = 'info', text, timeout }) =>
{
if (!timeout)
{
switch (type)
{
case 'info':
timeout = 3000;
break;
case 'error':
timeout = 5000;
break;
default:
timeout = 3000;
break;
}
}
const notification =
{
id : randomString({ length: 6 }).toLowerCase(),
type : type,
text : text,
timeout : timeout
};
return (dispatch) =>
{
dispatch(stateActions.addNotification(notification));
setTimeout(() =>
{
dispatch(stateActions.removeNotification(notification.id));
}, timeout);
};
};