Rewrite AdminLayout to use new Dummy component

This commit is contained in:
Apollinaire 2019-01-10 14:28:23 +01:00
parent 1e6e6f88f3
commit ce8e29fc5b

View file

@ -2,18 +2,12 @@
* @Author: Apollinaire Lecocq <apollinaire>
* @Date: 08-01-19
* @Last modified by: apollinaire
* @Last modified time: 09-01-19
* @Last modified time: 10-01-19
*/
import React from 'react';
import {registerComponent, Components, withAccess} from 'meteor/vulcan:core';
import {registerComponent, Components, withAccess, Dummy} from 'meteor/vulcan:core';
// we need a component to wrap the `withAccess` hoc around something
function EmptyComponent({children}) {
return children;
}
EmptyComponent.displayName = 'EmptyComponent';
const RestrictToAdmins = withAccess({groups: ['admins']})(EmptyComponent);
const RestrictToAdmins = withAccess({groups: ['admins']})(Dummy);
/**
* A simple component that renders the existing layout and checks wether the currentUser is an admin or not.