Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/context/AppContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const events = new EventManager();
const defaultContext = {
walletAddress: undefined,
deployer : false,
isGateWay: false,
walletError: undefined,
identity: undefined,
profile: undefined,
Expand All @@ -32,7 +33,7 @@ export const ProvideAppContext = ({ children }) => {
const [, setLocation] = useLocation();
const [profile, setUserProfile] = useState();
const [deployer, setDeployer] = useState(false);
const [processing, setProcessing] = useState(false);
const [processing, setProcessing] = useState(point.isGateway() || false);

useEffect(() => {
(async () => {
Expand Down Expand Up @@ -70,6 +71,7 @@ export const ProvideAppContext = ({ children }) => {
const context = {
walletAddress,
deployer,
isGateway : point.isGateway(),
walletError,
identity,
profile,
Expand Down
14 changes: 13 additions & 1 deletion src/pages/home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { useAppContext } from '../../context/AppContext';
import { makeStyles } from '@material-ui/core/styles';

import { Backdrop,
Button,
CircularProgress,
Snackbar,
SnackbarContent,
Container } from '@material-ui/core';


Expand Down Expand Up @@ -41,7 +43,7 @@ const useStyles = makeStyles((theme) => ({
const Home = () => {
const [loading, setLoading] = useState(false);
const [alert, setAlert] = useState("");
const { walletAddress } = useAppContext();
const { walletAddress, isGateway } = useAppContext();

const styles = useStyles();

Expand All @@ -54,6 +56,16 @@ const Home = () => {

return (
<div className={styles.root}>
{
!loading &&
<Snackbar open={isGateway} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>
<SnackbarContent
message={'You are viewing Point Social in read only mode, download Point Browser and get the full web3 experience!'}
action={
<Button color="secondary" size="small" target="_blank" rel="noreferrer" href="https://pointnetwork.io/download">Download</Button>
}/>
</Snackbar>
}
<Backdrop className={styles.backdrop} open={!walletAddress || loading}>
{
walletAddress?
Expand Down
15 changes: 14 additions & 1 deletion src/pages/post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import PostManager from '../../services/PostManager';

import CircularProgress from '@material-ui/core/CircularProgress';
import Backdrop from '@material-ui/core/Backdrop';
import Button from '@material-ui/core/Button';
import Snackbar from '@material-ui/core/Snackbar';
import SnackbarContent from '@material-ui/core/SnackbarContent';

import MuiAlert from '@material-ui/lab/Alert';

import CircularProgressWithIcon from "../../components/generic/CircularProgressWithIcon";
Expand Down Expand Up @@ -46,7 +49,7 @@ const Post = () => {
const [alert, setAlert] = useState("");
const [post, setPost] = useState();

const { walletAddress, events } = useAppContext();
const { walletAddress, isGateway, events } = useAppContext();

const styles = useStyles();

Expand Down Expand Up @@ -143,6 +146,16 @@ const Post = () => {
return (
<div style={{ padding: 0, margin: 0}}>
{ walletAddress && <Appbar setAlert={setAlert} setLoading={setLoading}/> }
{
!loading &&
<Snackbar open={isGateway} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>
<SnackbarContent
message={'You are viewing Point Social in read only mode, download Point Browser and get the full web3 experience!'}
action={
<Button color="secondary" size="small" target="_blank" rel="noreferrer" href="https://pointnetwork.io/download">Download</Button>
}/>
</Snackbar>
}
<Backdrop className={styles.backdrop} open={loading || !walletAddress}>
{
walletAddress?
Expand Down
15 changes: 14 additions & 1 deletion src/pages/profile/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import CircularProgress from '@material-ui/core/CircularProgress';
import CircularProgressWithIcon from "../../components/generic/CircularProgressWithIcon";

import Backdrop from '@material-ui/core/Backdrop';
import Button from '@material-ui/core/Button';
import Snackbar from '@material-ui/core/Snackbar';
import SnackbarContent from '@material-ui/core/SnackbarContent';

import MuiAlert from '@material-ui/lab/Alert';

import Box from '@material-ui/core/Box';
Expand Down Expand Up @@ -41,7 +44,7 @@ const Profile = () => {
const [identity, setIdentity] = useState(undefined);
const [address, setAddress] = useState(undefined);

const { walletAddress } = useAppContext();
const { walletAddress, isGateway } = useAppContext();

const styles = useStyles();

Expand Down Expand Up @@ -98,6 +101,16 @@ const Profile = () => {
<CircularProgressWithIcon icon={<AccountBalanceWalletOutlinedIcon/>} props={{color : "inherit"}} />
}
</Backdrop>
{
!loading &&
<Snackbar open={isGateway} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}>
<SnackbarContent
message={'You are viewing Point Social in read only mode, download Point Browser and get the full web3 experience!'}
action={
<Button color="secondary" size="small" target="_blank" rel="noreferrer" href="https://pointnetwork.io/download">Download</Button>
}/>
</Snackbar>
}
{walletAddress &&
<> { (address && identity)?
<>
Expand Down
5 changes: 5 additions & 0 deletions src/services/PointSDK.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class PointSDK {
return data;
}

static isGateway() {
const point = PointSDK._getPoint();
return point.isGateway;
}

/************** WALLET FUNCTIONS **************/

static getWalletAddress = async () => PointSDK._callSDKFunction('wallet', 'address'); // OK
Expand Down