mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
Rewrite AdminLayout to use new Dummy component
This commit is contained in:
parent
1e6e6f88f3
commit
ce8e29fc5b
1 changed files with 3 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue