Show following in profile detail component (#1082)

* Got following indicator working in squeak profile detail component

* Show following indicator in profile detail component and profile list item component

* Update frontend build
This commit is contained in:
Jonathan Zernik 2021-08-27 19:49:22 -07:00 committed by GitHub
parent f017d33039
commit ef9bda769a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 204 additions and 30 deletions

View file

@ -12,6 +12,7 @@ import VpnKeyIcon from '@material-ui/icons/VpnKey';
import useStyles from "../../pages/wallet/styles";
import SqueakUserAvatar from "../../components/SqueakUserAvatar";
import SqueakProfileFollowingIndicator from "../../components/SqueakProfileFollowingIndicator";
import {
@ -71,6 +72,9 @@ export default function ProfileListItem({
<Box>
{`Address: ${address}`}
</Box>
<SqueakProfileFollowingIndicator
squeakProfile={profile}
></SqueakProfileFollowingIndicator>
</>
)
}

View file

@ -26,6 +26,8 @@ import Avatar from '@material-ui/core/Avatar';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import VpnKeyIcon from '@material-ui/icons/VpnKey';
import NotificationsActiveIcon from '@material-ui/icons/NotificationsActive';
import NotificationsNoneIcon from '@material-ui/icons/NotificationsNone';
// styles
import useStyles from "./styles";
@ -37,6 +39,7 @@ import ExportPrivateKeyDialog from "../../components/ExportPrivateKeyDialog";
import ConfigureProfileDialog from "../../components/ConfigureProfileDialog";
import UpdateProfileImageDialog from "../../components/UpdateProfileImageDialog";
import ClearProfileImageDialog from "../../components/ClearProfileImageDialog";
import SqueakProfileFollowingIndicator from "../../components/SqueakProfileFollowingIndicator";
import {
@ -248,6 +251,37 @@ export default function SqueakProfileDetailItem({
)
}
function FollowingIndicator() {
return (
<>
<Typography variant="body2" color="textSecondary" component="p">
<NotificationsActiveIcon /> Following
</Typography>
</>
)
}
function NotFollowingIndicator() {
return (
<>
<Typography variant="body2" color="textSecondary" component="p">
<NotificationsNoneIcon /> Not Following
</Typography>
</>
)
}
function IsFollowingContent() {
return (
<>
{(squeakProfile.getFollowing())
? FollowingIndicator()
: NotFollowingIndicator()
}
</>
)
}
return (
<>
@ -293,6 +327,9 @@ export default function SqueakProfileDetailItem({
<Typography variant="body2" color="textSecondary" component="p">
{squeakProfile.getAddress()}
</Typography>
<SqueakProfileFollowingIndicator
squeakProfile={squeakProfile}
></SqueakProfileFollowingIndicator>
</CardContent>
<CardActions>
<Button

View file

@ -0,0 +1,78 @@
import React, { useState } from "react";
import {
Paper,
IconButton,
Menu,
MenuItem,
Typography,
Grid,
Box,
Link,
Divider,
Button,
} from "@material-ui/core";
import { MoreVert as MoreIcon } from "@material-ui/icons";
import {useHistory} from "react-router-dom";
import classnames from "classnames";
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import CardMedia from '@material-ui/core/CardMedia';
import CardHeader from '@material-ui/core/CardHeader';
import Avatar from '@material-ui/core/Avatar';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import VpnKeyIcon from '@material-ui/icons/VpnKey';
import NotificationsActiveIcon from '@material-ui/icons/NotificationsActive';
import NotificationsNoneIcon from '@material-ui/icons/NotificationsNone';
// styles
import useStyles from "./styles";
import Widget from "../../components/Widget";
import DeleteProfileDialog from "../../components/DeleteProfileDialog";
import RenameProfileDialog from "../../components/RenameProfileDialog";
import ExportPrivateKeyDialog from "../../components/ExportPrivateKeyDialog";
import ConfigureProfileDialog from "../../components/ConfigureProfileDialog";
import UpdateProfileImageDialog from "../../components/UpdateProfileImageDialog";
import ClearProfileImageDialog from "../../components/ClearProfileImageDialog";
export default function SqueakProfileFollowingIndicator({
squeakProfile,
...props
}) {
var classes = useStyles();
function FollowingIndicator() {
return (
<>
<Typography variant="body2" color="textSecondary" component="p">
<NotificationsActiveIcon /> Following
</Typography>
</>
)
}
function NotFollowingIndicator() {
return (
<>
<Typography variant="body2" color="textSecondary" component="p">
<NotificationsNoneIcon /> Not Following
</Typography>
</>
)
}
return (
<>
{(squeakProfile.getFollowing())
? FollowingIndicator()
: NotFollowingIndicator()
}
</>
);
}

View file

@ -0,0 +1,6 @@
{
"name": "SqueakProfileFollowingIndicator",
"version": "0.0.0",
"private": true,
"main": "SqueakProfileFollowingIndicator.js"
}

View file

@ -0,0 +1,49 @@
import { makeStyles } from "@material-ui/styles";
export default makeStyles(theme => ({
widgetWrapper: {
display: "flex",
minHeight: "100%",
},
widgetHeader: {
padding: theme.spacing(3),
paddingBottom: theme.spacing(1),
display: "flex",
justifyContent: "space-between",
alignItems: "center",
},
widgetRoot: {
boxShadow: theme.customShadows.widget,
},
widgetBody: {
paddingBottom: theme.spacing(3),
paddingRight: theme.spacing(3),
paddingLeft: theme.spacing(3),
},
noPadding: {
padding: 0,
},
paper: {
padding: '6px 12px',
},
secondaryTail: {
backgroundColor: theme.palette.secondary.main,
},
moreButton: {
margin: -theme.spacing(1),
padding: 0,
width: 40,
height: 40,
color: theme.palette.text.hint,
"&:hover": {
backgroundColor: theme.palette.primary.main,
color: "rgba(255, 255, 255, 0.35)",
},
},
root: {
maxWidth: 345,
},
media: {
height: 180,
},
}));

View file

@ -1,25 +1,25 @@
{
"files": {
"main.js": "/static/js/main.317b6c9d.chunk.js",
"main.js.map": "/static/js/main.317b6c9d.chunk.js.map",
"main.js": "/static/js/main.5792cef4.chunk.js",
"main.js.map": "/static/js/main.5792cef4.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.9f0ba400.js",
"runtime-main.js.map": "/static/js/runtime-main.9f0ba400.js.map",
"static/css/2.ea4ba2f0.chunk.css": "/static/css/2.ea4ba2f0.chunk.css",
"static/js/2.248267c1.chunk.js": "/static/js/2.248267c1.chunk.js",
"static/js/2.248267c1.chunk.js.map": "/static/js/2.248267c1.chunk.js.map",
"static/css/2.15110fae.chunk.css": "/static/css/2.15110fae.chunk.css",
"static/js/2.d8bd441e.chunk.js": "/static/js/2.d8bd441e.chunk.js",
"static/js/2.d8bd441e.chunk.js.map": "/static/js/2.d8bd441e.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.e78d06cb584521fc0bad25ae80bb588a.js": "/precache-manifest.e78d06cb584521fc0bad25ae80bb588a.js",
"precache-manifest.db97ef05bd05dd26814809eacff62865.js": "/precache-manifest.db97ef05bd05dd26814809eacff62865.js",
"service-worker.js": "/service-worker.js",
"static/css/2.ea4ba2f0.chunk.css.map": "/static/css/2.ea4ba2f0.chunk.css.map",
"static/js/2.248267c1.chunk.js.LICENSE.txt": "/static/js/2.248267c1.chunk.js.LICENSE.txt",
"static/css/2.15110fae.chunk.css.map": "/static/css/2.15110fae.chunk.css.map",
"static/js/2.d8bd441e.chunk.js.LICENSE.txt": "/static/js/2.d8bd441e.chunk.js.LICENSE.txt",
"static/media/font-awesome.min.css": "/static/media/fontawesome-webfont.fee66e71.woff",
"static/media/google.svg": "/static/media/google.695a3160.svg",
"static/media/logo.svg": "/static/media/logo.a0185b04.svg"
},
"entrypoints": [
"static/js/runtime-main.9f0ba400.js",
"static/css/2.ea4ba2f0.chunk.css",
"static/js/2.248267c1.chunk.js",
"static/js/main.317b6c9d.chunk.js"
"static/css/2.15110fae.chunk.css",
"static/js/2.d8bd441e.chunk.js",
"static/js/main.5792cef4.chunk.js"
]
}

View file

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Squeak Node</title><meta name="description" content="Squeak Node is a frontend for accessing a squeak node"><meta name="keywords" content="squeak, bitcoin, lightning"><meta name="author" content="Flatlogic LLC."><link href="/static/css/2.ea4ba2f0.chunk.css" rel="stylesheet"></head><body style="font-family:Roboto,sans-serif"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,f,l=r[0],a=r[1],i=r[2],c=0,s=[];c<l.length;c++)f=l[c],Object.prototype.hasOwnProperty.call(o,f)&&o[f]&&s.push(o[f][0]),o[f]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var a=t[l];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={1:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var l=this["webpackJsonpsqueak-node-frontend"]=this["webpackJsonpsqueak-node-frontend"]||[],a=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var p=a;t()}([])</script><script src="/static/js/2.248267c1.chunk.js"></script><script src="/static/js/main.317b6c9d.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Squeak Node</title><meta name="description" content="Squeak Node is a frontend for accessing a squeak node"><meta name="keywords" content="squeak, bitcoin, lightning"><meta name="author" content="Flatlogic LLC."><link href="/static/css/2.15110fae.chunk.css" rel="stylesheet"></head><body style="font-family:Roboto,sans-serif"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,f,l=r[0],a=r[1],i=r[2],c=0,s=[];c<l.length;c++)f=l[c],Object.prototype.hasOwnProperty.call(o,f)&&o[f]&&s.push(o[f][0]),o[f]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var a=t[l];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={1:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var l=this["webpackJsonpsqueak-node-frontend"]=this["webpackJsonpsqueak-node-frontend"]||[],a=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var p=a;t()}([])</script><script src="/static/js/2.d8bd441e.chunk.js"></script><script src="/static/js/main.5792cef4.chunk.js"></script></body></html>

View file

@ -1,23 +1,23 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "0d83b2c3039dc9f8cf54f4ebb614a5bc",
"revision": "978c795433d9b43b7c0cb660af77e5b4",
"url": "/index.html"
},
{
"revision": "cd160927f2499f9d5606",
"url": "/static/css/2.ea4ba2f0.chunk.css"
"revision": "d0ab39369da4608bf56a",
"url": "/static/css/2.15110fae.chunk.css"
},
{
"revision": "cd160927f2499f9d5606",
"url": "/static/js/2.248267c1.chunk.js"
"revision": "d0ab39369da4608bf56a",
"url": "/static/js/2.d8bd441e.chunk.js"
},
{
"revision": "7156b2c9571000777b9be03b3c6006ee",
"url": "/static/js/2.248267c1.chunk.js.LICENSE.txt"
"url": "/static/js/2.d8bd441e.chunk.js.LICENSE.txt"
},
{
"revision": "e6d01ab27976f255c68e",
"url": "/static/js/main.317b6c9d.chunk.js"
"revision": "03719d75c8a8df9197b9",
"url": "/static/js/main.5792cef4.chunk.js"
},
{
"revision": "cc9816de5a8639d377ea",

View file

@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/precache-manifest.e78d06cb584521fc0bad25ae80bb588a.js"
"/precache-manifest.db97ef05bd05dd26814809eacff62865.js"
);
self.addEventListener('message', (event) => {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long