mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-16 13:01:04 +02:00
Remove old components from squeak detail (#942)
* Remove old components from squeak detail component * Fix handleReloadSqueakItem for SqueakThread component * Update frontend build
This commit is contained in:
parent
4ca5f0356c
commit
8aba1d9135
14 changed files with 29 additions and 246 deletions
|
|
@ -68,10 +68,7 @@ export default function SqueakDetailItem({
|
|||
|
||||
const history = useHistory();
|
||||
|
||||
const [replyDialogOpen, setReplyDialogOpen] = useState(false);
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
const [buyDialogOpen, setBuyDialogOpen] = useState(false);
|
||||
const [viewDetailsDialogOpen, setViewDetailsDialogOpen] = useState(false);
|
||||
const [unlockedSnackbarOpen, setUnlockedSnackbarOpen] = useState(false);
|
||||
|
||||
|
||||
|
|
@ -79,23 +76,6 @@ export default function SqueakDetailItem({
|
|||
return getBlockDetailUrl(squeak.getBlockHash(), network);
|
||||
};
|
||||
|
||||
const handleClickOpenReplyDialog = () => {
|
||||
setReplyDialogOpen(true);
|
||||
};
|
||||
|
||||
const handleCloseReplyDialog = () => {
|
||||
setReplyDialogOpen(false);
|
||||
};
|
||||
|
||||
const handleClickOpenDeleteDialog = () => {
|
||||
setDeleteDialogOpen(true);
|
||||
console.log("deleteDialogOpen: " + deleteDialogOpen);
|
||||
};
|
||||
|
||||
const handleCloseDeleteDialog = () => {
|
||||
setDeleteDialogOpen(false);
|
||||
};
|
||||
|
||||
const handleClickOpenBuyDialog = () => {
|
||||
setBuyDialogOpen(true);
|
||||
};
|
||||
|
|
@ -104,28 +84,6 @@ export default function SqueakDetailItem({
|
|||
setBuyDialogOpen(false);
|
||||
};
|
||||
|
||||
const handleClickOpenViewDetailsDialog = () => {
|
||||
setViewDetailsDialogOpen(true);
|
||||
};
|
||||
|
||||
const handleCloseViewDetailsDialog = () => {
|
||||
setViewDetailsDialogOpen(false);
|
||||
};
|
||||
|
||||
const handleLikeSqueak = () => {
|
||||
console.log("liked.");
|
||||
likeSqueakRequest(hash, (response) => {
|
||||
reloadSqueak();
|
||||
});
|
||||
};
|
||||
|
||||
const handleUnlikeSqueak = () => {
|
||||
console.log("unliked.");
|
||||
unlikeSqueakRequest(hash, (response) => {
|
||||
reloadSqueak();
|
||||
});
|
||||
};
|
||||
|
||||
const onAddressClick = (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
|
@ -136,51 +94,6 @@ export default function SqueakDetailItem({
|
|||
goToSqueakAddressPage(history, squeak.getAuthorAddress());
|
||||
}
|
||||
|
||||
const onReplyClick = (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Handling reply click...");
|
||||
if (!squeak) {
|
||||
return;
|
||||
}
|
||||
handleClickOpenReplyDialog();
|
||||
}
|
||||
|
||||
const onLikeClick = (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Handling like click...");
|
||||
if (!squeak) {
|
||||
return;
|
||||
}
|
||||
handleLikeSqueak();
|
||||
}
|
||||
|
||||
const onUnlikeClick = (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Handling like click...");
|
||||
if (!squeak) {
|
||||
return;
|
||||
}
|
||||
handleUnlikeSqueak();
|
||||
}
|
||||
|
||||
const onDeleteClick = (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Handling delete click...");
|
||||
if (!squeak) {
|
||||
return;
|
||||
}
|
||||
handleClickOpenDeleteDialog();
|
||||
}
|
||||
|
||||
const onZoomInClick = (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Handling zoomin click...");
|
||||
if (!squeak) {
|
||||
return;
|
||||
}
|
||||
handleClickOpenViewDetailsDialog();
|
||||
}
|
||||
|
||||
const onUnlockClick = (event) => {
|
||||
event.preventDefault();
|
||||
console.log("Handling unlock click...");
|
||||
|
|
@ -316,31 +229,6 @@ export default function SqueakDetailItem({
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
function MakeSqueakDialogContent() {
|
||||
return (
|
||||
<>
|
||||
<MakeSqueakDialog
|
||||
open={replyDialogOpen}
|
||||
handleClose={handleCloseReplyDialog}
|
||||
replytoSqueak={squeak}
|
||||
></MakeSqueakDialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function DeleteSqueakDialogContent() {
|
||||
return (
|
||||
<>
|
||||
<DeleteSqueakDialog
|
||||
open={deleteDialogOpen}
|
||||
handleClose={handleCloseDeleteDialog}
|
||||
squeakToDelete={squeak}
|
||||
></DeleteSqueakDialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function BuyDialogContent() {
|
||||
return (
|
||||
<>
|
||||
|
|
@ -354,19 +242,6 @@ export default function SqueakDetailItem({
|
|||
)
|
||||
}
|
||||
|
||||
function ViewDetailsDialogContent() {
|
||||
return (
|
||||
<>
|
||||
<SqueakDetailsDialog
|
||||
open={viewDetailsDialogOpen}
|
||||
handleClose={handleCloseViewDetailsDialog}
|
||||
hash={hash}
|
||||
squeak={squeak}
|
||||
></SqueakDetailsDialog>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function SqueakUnlockedActionContent() {
|
||||
return (
|
||||
<Snackbar open={unlockedSnackbarOpen} autoHideDuration={6000} onClose={handleCloseUnlockedSnackbar}>
|
||||
|
|
@ -377,97 +252,6 @@ export default function SqueakDetailItem({
|
|||
)
|
||||
}
|
||||
|
||||
function ActionBarContent() {
|
||||
return (
|
||||
<>
|
||||
<Divider />
|
||||
<Grid
|
||||
container
|
||||
direction="row"
|
||||
justify="flex-start"
|
||||
alignItems="flex-start"
|
||||
>
|
||||
<Grid item xs={3} sm={1}>
|
||||
{ReplyIconContent()}
|
||||
</Grid>
|
||||
<Grid item xs={3} sm={1}>
|
||||
{ResqueakIconContent()}
|
||||
</Grid>
|
||||
<Grid item xs={3} sm={1}>
|
||||
{LikeIconContent()}
|
||||
</Grid>
|
||||
<Grid item xs={3} sm={1}>
|
||||
{DeleteIconContent()}
|
||||
</Grid>
|
||||
<Grid item xs={3} sm={1}>
|
||||
{DetailsIconContent()}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function ReplyIconContent() {
|
||||
return (
|
||||
<IconButton aria-label="reply"
|
||||
onClick={onReplyClick}
|
||||
>
|
||||
<ReplyIcon />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
function ResqueakIconContent() {
|
||||
return (
|
||||
<IconButton aria-label="resqueak"
|
||||
>
|
||||
<RepeatIcon />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
function LikeIconContent() {
|
||||
if (squeak && !squeak.getLikedTimeS()) {
|
||||
return (
|
||||
<IconButton aria-label="like"
|
||||
onClick={onLikeClick}
|
||||
>
|
||||
<FavoriteIcon />
|
||||
</IconButton>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<IconButton aria-label="unlike"
|
||||
onClick={onUnlikeClick}
|
||||
>
|
||||
<FavoriteIcon
|
||||
color="secondary"
|
||||
/>
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteIconContent() {
|
||||
return (
|
||||
<IconButton aria-label="delete"
|
||||
onClick={onDeleteClick}
|
||||
>
|
||||
<DeleteIcon />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
function DetailsIconContent() {
|
||||
return (
|
||||
<IconButton aria-label="details"
|
||||
onClick={onZoomInClick}
|
||||
>
|
||||
<ZoomInIcon />
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Paper elevation={3} className={classes.paper}
|
||||
|
|
@ -517,10 +301,7 @@ export default function SqueakDetailItem({
|
|||
reloadSqueak={reloadSqueak}
|
||||
></SqueakActionBar>
|
||||
</Paper>
|
||||
{MakeSqueakDialogContent()}
|
||||
{DeleteSqueakDialogContent()}
|
||||
{BuyDialogContent()}
|
||||
{ViewDetailsDialogContent()}
|
||||
{SqueakUnlockedActionContent()}
|
||||
</>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import {
|
|||
} from "../../squeakclient/requests"
|
||||
|
||||
|
||||
export default function SqueakList({
|
||||
export default function SqueakThread({
|
||||
squeaks,
|
||||
network,
|
||||
setSqueaksFn,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ export default function SqueakPage() {
|
|||
getSqueakDisplayRequest(hash, setSqueak);
|
||||
};
|
||||
const getAncestorSqueaks = (hash) => {
|
||||
getAncestorSqueakDisplaysRequest(hash, setAncestorSqueaks);
|
||||
getAncestorSqueakDisplaysRequest(hash, (result) => {
|
||||
setAncestorSqueaks(result.slice(0, -1));
|
||||
});
|
||||
};
|
||||
const getReplySqueaks = (hash) => {
|
||||
getReplySqueakDisplaysRequest(hash, setReplySqueaks);
|
||||
|
|
@ -152,7 +154,7 @@ export default function SqueakPage() {
|
|||
function AncestorsContent() {
|
||||
return (
|
||||
<SqueakThread
|
||||
squeaks={ancestorSqueaks.slice(0, -1)}
|
||||
squeaks={ancestorSqueaks}
|
||||
network={network}
|
||||
setSqueaksFn={setAncestorSqueaks}
|
||||
></SqueakThread>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
"files": {
|
||||
"main.js": "/static/js/main.02ddf78b.chunk.js",
|
||||
"main.js.map": "/static/js/main.02ddf78b.chunk.js.map",
|
||||
"main.js": "/static/js/main.07fbbc6a.chunk.js",
|
||||
"main.js.map": "/static/js/main.07fbbc6a.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.15110fae.chunk.css": "/static/css/2.15110fae.chunk.css",
|
||||
"static/js/2.0c6b0365.chunk.js": "/static/js/2.0c6b0365.chunk.js",
|
||||
"static/js/2.0c6b0365.chunk.js.map": "/static/js/2.0c6b0365.chunk.js.map",
|
||||
"static/js/2.0bf951c4.chunk.js": "/static/js/2.0bf951c4.chunk.js",
|
||||
"static/js/2.0bf951c4.chunk.js.map": "/static/js/2.0bf951c4.chunk.js.map",
|
||||
"index.html": "/index.html",
|
||||
"precache-manifest.6287ba31017aea9c05cf8c369106635c.js": "/precache-manifest.6287ba31017aea9c05cf8c369106635c.js",
|
||||
"precache-manifest.eff616d58665ade328493579724ba2a4.js": "/precache-manifest.eff616d58665ade328493579724ba2a4.js",
|
||||
"service-worker.js": "/service-worker.js",
|
||||
"static/css/2.15110fae.chunk.css.map": "/static/css/2.15110fae.chunk.css.map",
|
||||
"static/js/2.0c6b0365.chunk.js.LICENSE.txt": "/static/js/2.0c6b0365.chunk.js.LICENSE.txt",
|
||||
"static/js/2.0bf951c4.chunk.js.LICENSE.txt": "/static/js/2.0bf951c4.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"
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
"entrypoints": [
|
||||
"static/js/runtime-main.9f0ba400.js",
|
||||
"static/css/2.15110fae.chunk.css",
|
||||
"static/js/2.0c6b0365.chunk.js",
|
||||
"static/js/main.02ddf78b.chunk.js"
|
||||
"static/js/2.0bf951c4.chunk.js",
|
||||
"static/js/main.07fbbc6a.chunk.js"
|
||||
]
|
||||
}
|
||||
|
|
@ -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.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.0c6b0365.chunk.js"></script><script src="/static/js/main.02ddf78b.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.0bf951c4.chunk.js"></script><script src="/static/js/main.07fbbc6a.chunk.js"></script></body></html>
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
self.__precacheManifest = (self.__precacheManifest || []).concat([
|
||||
{
|
||||
"revision": "93a3f7db5933742ada7b7210791083d9",
|
||||
"revision": "f6c37dc76918b613f6f0453d8fd85420",
|
||||
"url": "/index.html"
|
||||
},
|
||||
{
|
||||
"revision": "610bb8a208dd140f5277",
|
||||
"revision": "f27cc370bf4b79bdb6eb",
|
||||
"url": "/static/css/2.15110fae.chunk.css"
|
||||
},
|
||||
{
|
||||
"revision": "610bb8a208dd140f5277",
|
||||
"url": "/static/js/2.0c6b0365.chunk.js"
|
||||
"revision": "f27cc370bf4b79bdb6eb",
|
||||
"url": "/static/js/2.0bf951c4.chunk.js"
|
||||
},
|
||||
{
|
||||
"revision": "7156b2c9571000777b9be03b3c6006ee",
|
||||
"url": "/static/js/2.0c6b0365.chunk.js.LICENSE.txt"
|
||||
"url": "/static/js/2.0bf951c4.chunk.js.LICENSE.txt"
|
||||
},
|
||||
{
|
||||
"revision": "ebd75b83d6adc192731e",
|
||||
"url": "/static/js/main.02ddf78b.chunk.js"
|
||||
"revision": "c68cb364b5759056481f",
|
||||
"url": "/static/js/main.07fbbc6a.chunk.js"
|
||||
},
|
||||
{
|
||||
"revision": "cc9816de5a8639d377ea",
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
|
||||
|
||||
importScripts(
|
||||
"/precache-manifest.6287ba31017aea9c05cf8c369106635c.js"
|
||||
"/precache-manifest.eff616d58665ade328493579724ba2a4.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
Loading…
Add table
Add a link
Reference in a new issue