diff --git a/src/components/Assets.jsx b/src/components/Assets.jsx index 6e34b12..f5da4f3 100644 --- a/src/components/Assets.jsx +++ b/src/components/Assets.jsx @@ -9,7 +9,7 @@ import { LoaderWithText } from './Loader'; import { Text } from './Text'; import { Icon } from './Icons'; -const Assets = ({ onProBtnClick }) => { +const Assets = ({ onProBtnClick, onLoginBtnClick }) => { const [files, setFiles] = useState([]); const [isFetchingFiles, setIsFetchingFiles] = useState(false); const [searchTerm, setSearchTerm] = useState(''); @@ -94,7 +94,9 @@ const Assets = ({ onProBtnClick }) => { }; useEffect(() => { - fetchFiles(); + if (window.user?.isPro) { + fetchFiles(); + } }, []); useEffect(() => { @@ -161,9 +163,20 @@ const Assets = ({ onProBtnClick }) => { return (

Assets feature is available in PRO plan.

-
diff --git a/src/components/Share.jsx b/src/components/Share.jsx index 4a2e51c..31054de 100644 --- a/src/components/Share.jsx +++ b/src/components/Share.jsx @@ -6,6 +6,7 @@ import { itemService } from '../itemService'; import { alertsService } from '../notifications'; import { Button } from './common'; import { Icon } from './Icons'; +import { Text } from './Text'; const FREE_PUBLIC_ITEM_COUNT = 1; const BASE_URL = location.origin; @@ -58,6 +59,16 @@ export function Share({ user, item, onVisibilityChange }) { navigator.clipboard.writeText(`${BASE_URL}/create/${item.id}`); alertsService.add('URL copied to clipboard'); }; + if (!user) { + return ( + + Login to share this creation + + + ); + } return (
diff --git a/src/components/app.jsx b/src/components/app.jsx index 3ffb205..b017363 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -1792,6 +1792,10 @@ export default class App extends Component { this.proBtnClickHandler(); this.setState({ isAssetsOpen: false }); }} + onLoginBtnClick={() => { + this.loginBtnClickHandler(); + this.setState({ isAssetsOpen: false }); + }} />