mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 05:26:38 -04:00
48 lines
1,009 B
React
48 lines
1,009 B
React
![]() |
/*
|
||
|
|
||
|
Pics Home component
|
||
|
|
||
|
*/
|
||
|
|
||
|
import React from 'react';
|
||
|
import { Components, withCurrentUser } from 'meteor/vulcan:core';
|
||
|
import PicsList from './PicsList.jsx';
|
||
|
import Users from 'meteor/vulcan:users';
|
||
|
import Button from 'react-bootstrap/lib/Button';
|
||
|
|
||
|
const PicsHome = ({results = [], currentUser, loading, loadMore, count, totalCount}) => {
|
||
|
if (currentUser) {
|
||
|
|
||
|
return (
|
||
|
<div className="pics-list">
|
||
|
|
||
|
{Users.canDo(currentUser, 'pics.view') ?
|
||
|
|
||
|
<PicsList /> :
|
||
|
|
||
|
<Components.Checkout
|
||
|
productKey="membership"
|
||
|
associatedCollection={Users}
|
||
|
associatedDocument={currentUser}
|
||
|
fragmentName="UsersCurrent"
|
||
|
button={<Button bsStyle="primary">Buy membership</Button>}
|
||
|
/>
|
||
|
|
||
|
}
|
||
|
|
||
|
</div>
|
||
|
)
|
||
|
|
||
|
} else {
|
||
|
|
||
|
return (
|
||
|
<div className="pics-list">
|
||
|
<p>Please sign up or log in to access this content</p>
|
||
|
</div>
|
||
|
)
|
||
|
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
export default withCurrentUser(PicsHome);
|