Skip to content

Commit

Permalink
Merge branch 'shocknet:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
snake-eaterr authored Sep 2, 2024
2 parents 9f98ac0 + 34fc6a9 commit e93689a
Show file tree
Hide file tree
Showing 22 changed files with 4,325 additions and 4,497 deletions.
3,849 changes: 1,710 additions & 2,139 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@capacitor/browser": "^5.2.0",
"@capacitor/camera": "^5.0.7",
"@capacitor/clipboard": "^5.0.6",
"@capacitor/core": "5.4.0",
"@capacitor/core": "5.7.8",
"@capacitor/filesystem": "^5.1.4",
"@capacitor/haptics": "5.0.6",
"@capacitor/ios": "5.4.0",
Expand All @@ -33,18 +33,18 @@
"@ionic/pwa-elements": "^3.2.2",
"@ionic/react": "^7.0.0",
"@ionic/react-router": "^7.0.0",
"@noble/curves": "^1.2.0",
"@noble/curves": "^1.5.0",
"@noble/hashes": "^1.3.2",
"@noble/secp256k1": "^2.0.0",
"@reduxjs/toolkit": "^1.9.5",
"@scure/base": "^1.1.3",
"@stablelib/xchacha20": "^1.0.1",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^13.5.0",
"@types/crypto-js": "^4.1.3",
"@types/file-saver": "^2.0.6",
"@types/jest": "^27.4.0",
"@types/jest": "^29.5.12",
"@types/node": "^16.11.25",
"@types/react": "^17.0.39",
"@types/react-copy-to-clipboard": "^5.0.4",
Expand Down Expand Up @@ -86,20 +86,20 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@capacitor/assets": "2.0.4",
"@capacitor/assets": "^3.0.5",
"@capacitor/cli": "5.4.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/deep-diff": "^1.0.5",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"@vitejs/plugin-legacy": "^4.0.2",
"@vitejs/plugin-react": "^4.0.1",
"cypress": "^12.7.0",
"cypress": "^13.14.0",
"eslint": "^8.56.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-react": "^7.32.2",
Expand Down
274 changes: 144 additions & 130 deletions src/Api/pub/autogenerated/ts/http_client.ts

Large diffs are not rendered by default.

258 changes: 136 additions & 122 deletions src/Api/pub/autogenerated/ts/nostr_client.ts

Large diffs are not rendered by default.

271 changes: 145 additions & 126 deletions src/Api/pub/autogenerated/ts/nostr_transport.ts

Large diffs are not rendered by default.

3,030 changes: 1,483 additions & 1,547 deletions src/Api/pub/autogenerated/ts/types.ts

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,34 @@ input[type=number] {
}

.metric-footer{
position: fixed;
bottom: 2vh;
text-align: center;
font-size: 12px;
color: #ffffff;
font-weight: 500;
font-family: Montserrat;
width: 100%;
}

.Status {
display: flex;

.Status_title{
font-size: 16px;
font-family: Montserrat;
width: 50%;
}

.Status_value{
display: flex;
font-size: 16px;
font-family: Montserrat;
width: 50%;
justify-content: end;

div {
margin: 1px 5px;
}
}
}


Expand All @@ -154,6 +175,7 @@ input[type=number] {
@import "./Pages/NodeUp/NodeUp.scss";
@import "./Pages/Invitations/Invitations.scss";
@import "./Pages/Manage//Manage.scss";
@import "./Pages/Channels/Channels.scss";
@import "./Pages/Scan/Scan.scss";
@import "./Pages/Receive/Receive.scss";
@import "./Pages/Send/Send.scss";
Expand Down
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { isBrowser } from 'react-device-detect'
import { Notify } from './Pages/Notify';
import { Metrics } from './Pages/Metrics';
import { Manage } from "./Pages/Manage";
import { Channels } from "./Pages/Channels";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";

Expand Down Expand Up @@ -143,6 +144,11 @@ const App: React.FC = () => {
<Manage />
</Layout>
</Route>
<Route exact path="/channels">
<Layout>
<Channels />
</Layout>
</Route>
</IonRouterOutlet>
</IonReactHashRouter>
</ErrorBoundary>
Expand Down
16 changes: 15 additions & 1 deletion src/Assets/SvgIconLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -750,4 +750,18 @@ export const closeQuestion = () => {
return (
<div dangerouslySetInnerHTML={{__html: svgCode}} />
)
}
}

export const YellowState = () => {
const svgCode =
'<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 15 15" width="15" height="15"><g transform="translate(0, 0)"><defs><path id="path-172386722092776505" d="M7.5 0 C11.639362683705 0 15 3.360637316295001 15 7.5 C15 11.639362683705006 11.639362683705 15 7.5 15 C3.3606373162949987 15 0 11.639362683705006 0 7.5 C0 3.360637316295001 3.3606373162949987 0 7.5 0 Z" vector-effect="non-scaling-stroke"/><filter height="126.66666666666666%" id="filter-172386722095877789" width="126.66666666666666%" x="-13.333333333333334%" y="-13.333333333333334%" vector-effect="non-scaling-stroke"><feFlood flood-opacity="0" result="backgroundFix" vector-effect="non-scaling-stroke"/><feColorMatrix in="SourceAlpha" result="hardAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" vector-effect="non-scaling-stroke"/><feOffset dx="0" dy="0" vector-effect="non-scaling-stroke"/><feGaussianBlur stdDeviation="1.1666666666666665" vector-effect="non-scaling-stroke"/><feColorMatrix in="" result="" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" vector-effect="non-scaling-stroke"/><feBlend in2="backgroundFix" mode="normal" result="shadowOuter_1" vector-effect="non-scaling-stroke"/></filter></defs><g transform="translate(0, 0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#path-172386722092776505" filter="url(#filter-172386722095877789)" vector-effect="non-scaling-stroke"/><path d="M7.5 0 C11.639362683705 0 15 3.360637316295001 15 7.5 C15 11.639362683705006 11.639362683705 15 7.5 15 C3.3606373162949987 15 0 11.639362683705006 0 7.5 C0 3.360637316295001 3.3606373162949987 0 7.5 0 Z" style="stroke: rgb(140, 140, 140); stroke-width: 0; stroke-linecap: butt; stroke-linejoin: miter; fill: rgb(204, 199, 49);" vector-effect="non-scaling-stroke"/></g></g></svg>';
return (
<div dangerouslySetInnerHTML={{__html: svgCode}}></div>
)
}

export const GreenState = () => {
const svgCode =
'<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="visible" preserveAspectRatio="none" viewBox="0 0 15 15" width="15" height="15"><g transform="translate(0, 0)"><defs><path id="path-172386722092776501" d="M7.5 0 C11.639362683705 0 15 3.3606373162950014 15 7.5000000000000036 C15 11.639362683705007 11.639362683705 15.000000000000007 7.5 15.000000000000007 C3.3606373162949987 15.000000000000007 0 11.639362683705007 0 7.5000000000000036 C0 3.3606373162950014 3.3606373162949987 0 7.5 0 Z" vector-effect="non-scaling-stroke"/><filter height="126.66666666666666%" id="filter-172386722095977790" width="126.66666666666666%" x="-13.333333333333334%" y="-13.333333333333334%" vector-effect="non-scaling-stroke"><feFlood flood-opacity="0" result="backgroundFix" vector-effect="non-scaling-stroke"/><feColorMatrix in="SourceAlpha" result="hardAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" vector-effect="non-scaling-stroke"/><feOffset dx="0" dy="0" vector-effect="non-scaling-stroke"/><feGaussianBlur stdDeviation="1.1666666666666665" vector-effect="non-scaling-stroke"/><feColorMatrix in="" result="" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" vector-effect="non-scaling-stroke"/><feBlend in2="backgroundFix" mode="normal" result="shadowOuter_1" vector-effect="non-scaling-stroke"/></filter></defs><g transform="translate(0, 0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#path-172386722092776501" filter="url(#filter-172386722095977790)" vector-effect="non-scaling-stroke"/><path d="M7.5 0 C11.639362683705 0 15 3.3606373162950014 15 7.5000000000000036 C15 11.639362683705007 11.639362683705 15.000000000000007 7.5 15.000000000000007 C3.3606373162949987 15.000000000000007 0 11.639362683705007 0 7.5000000000000036 C0 3.3606373162950014 3.3606373162949987 0 7.5 0 Z" style="stroke: rgb(140, 140, 140); stroke-width: 0; stroke-linecap: butt; stroke-linejoin: miter; fill: rgb(50, 168, 82);" vector-effect="non-scaling-stroke"/></g></g></svg>';
return <div dangerouslySetInnerHTML={{ __html: svgCode }}></div>;
};
7 changes: 7 additions & 0 deletions src/Components/BackgroundJobs/NodeUpCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useEffect, useLayoutEffect } from "react";
import { useDispatch, useSelector } from "../../State/store";
import { setPrivateKey } from "../../State/Slices/nostrPrivateKey";
import { useHistory } from "react-router";
import { fixSpendDuplicates } from "../../State/Slices/spendSourcesSlice";
import { fixPayDuplicates } from "../../State/Slices/paySourcesSlice";


export const NodeUpCheck = () => {
Expand All @@ -24,5 +26,10 @@ export const NodeUpCheck = () => {
}
}, [history.location, nodedUp])


useEffect(() => {
dispatch(fixSpendDuplicates());
dispatch(fixPayDuplicates());
}, [dispatch])
return null;
}
7 changes: 2 additions & 5 deletions src/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export const Layout: React.FC<LayoutProps> = ({ children }): JSX.Element => {
const router = useIonRouter();

const isScan: boolean = router.routeInfo.pathname === "/scan";
const isMetrics: boolean = router.routeInfo.pathname === "/metrics";
const isManage: boolean = router.routeInfo.pathname === "/manage";


const isPub: boolean = router.routeInfo.pathname === "/metrics" || router.routeInfo.pathname === "/manage" || router.routeInfo.pathname === "/channels"

const dispatch = useDispatch();

Expand Down Expand Up @@ -59,7 +56,7 @@ export const Layout: React.FC<LayoutProps> = ({ children }): JSX.Element => {
{
!isScan
&&
isMetrics || isManage ?
isPub ?
<IonHeader style={{boxShadow: "none"}}>
<PubHeader />
</IonHeader>
Expand Down
148 changes: 148 additions & 0 deletions src/Pages/Channels/Channels.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
.Channels {
max-width: 500px;
width: 100%;
margin-inline: auto;
font-family: Montserrat;
display: flex;
flex-direction: column;
gap: 20px;

& .section-title {
& > div {
display: flex;
justify-content: space-between;
align-items: end;

& > .title {
font-size: 16px;
& > span {
font-size: 11x;
}
}

& > .sub-title {
color: #8c8c8c;
text-align: right;
font-size: 11px;
}
}

& > .line {
margin-block: 5px;
background: linear-gradient(60deg, #ff7700 0%, #c740c7 100%);
width: 100%;
height: 1px;
margin-inline: auto;
}
}

& .channel-group {
display: flex;
flex-direction: column;
gap: 5px;

& .channel {
border-radius: 5px;
width: 100%;
border: 2px solid #2a3035;
padding: 3px 6px;
box-shadow: 1px 2px 5px #000;

& .avatar {
display: flex;
gap: 5px;
align-items: center;
& > img {
border-radius: 50%;
}
& > div {
font-size: 12px;
}
}

& .amount {
text-align: right;
color: #8c8c8c;
font-size: 11px;
}
}
}

& .channel {
border-radius: 5px;
width: 100%;
border: 2px solid #2a3035;
padding: 3px 6px;
box-shadow: 1px 2px 5px #000;
}

&_offline-channels {
margin-top: 20px;
& > .channel-group {
& > .channel {
display: flex;
justify-content: space-between;
align-items: start;

& > div {
display: flex;
flex-direction: column;
gap: 5px;

& > .sub-node {
color: #a012c7;
font-size: 11px;
text-decoration: underline;
}

& > .time {
text-align: right;
font-size: 11px;
color: #8c8c8c;
& > span {
font-size: 12px;
}
}
}
}
}
}

&_active-channels {
& .channel {
& > div {
display: flex;
justify-content: space-between;
}

& > .progress {
display: flex;
flex-direction: column;
font-size: 12px;
margin-block-start: 10px;
& > div {
display: flex;
align-items: center;
gap: 5px;

& > div:nth-child(1) {
width: 10px;
text-align: center;
color: #8c8c8c;
}
& > div:nth-child(2) {
padding-block: 5px;
padding-left: 10px;
}
}
}
}
}

&_footer {
font-size: 12px;
font-style: italic;
text-align: center;
margin-block-end: 10px;
}
}
Loading

0 comments on commit e93689a

Please sign in to comment.