Skip to content

Commit abf7a39

Browse files
committed
Add reflect button
1 parent ecdd4dc commit abf7a39

5 files changed

Lines changed: 63 additions & 2 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [18.x, 20.x, 22.x]
15+
node-version: [20.x, 22.x, 23.x, 24.x, 25.x]
1616
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1717

1818
steps:

src/LBRY.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const VERSION_2_0: string = "2.0";
22

33
const CLAIM_SEARCH: string = "claim_search";
4+
const FILE_REFLECT: string = "file_reflect";
45
const GET: string = "get";
56
const PREFERENCE_GET: string = "preference_get";
67
const RESOLVE: string = "resolve";
@@ -118,6 +119,7 @@ async function rpc(
118119

119120
export default {
120121
CLAIM_SEARCH,
122+
FILE_REFLECT,
121123
GET,
122124
PREFERENCE_GET,
123125
RESOLVE,

src/components/ChannelClaim.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ function ChannelClaim({ data }: Props & { data: Channel }): JSX.Element {
183183
: null}
184184
{tab === "about" ? (
185185
<section>
186+
{data.value.description ? (
187+
<div style={{ padding: "16px 8px" }}>
188+
<label style={{ display: "block", fontWeight: "bold" }}>
189+
Description
190+
</label>
191+
<span>{data.value.description}</span>
192+
</div>
193+
) : null}
186194
{data.value.email ? (
187195
<div style={{ padding: "16px 8px" }}>
188196
<label style={{ display: "block", fontWeight: "bold" }}>

src/components/Header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ function Header({ menuOpen, menuOpenSetter }): JSX.Element {
8787
},
8888
};
8989

90-
navigate(new URL(form.action).pathname + `?q=${encodeURIComponent(query)}`, options);
90+
navigate(
91+
new URL(form.action).pathname + `?q=${encodeURIComponent(query)}`,
92+
options,
93+
);
9194
return false;
9295
}
9396

src/components/StreamClaim.tsx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Props, { JSX, useEffect, useState } from "react";
2+
import React from "react";
23
import Markdown from "react-markdown";
4+
import { Link } from "react-router";
35
import LBRY from "~/LBRY";
6+
import CustomSVG from "~/components/CustomSVG";
47

58
function downloadMarkdownFile(claimGetData, setMarkdown): void {
69
const url: string = claimGetData?.streaming_url;
@@ -101,6 +104,51 @@ function StreamClaim({ data }: Props & { data: Stream }): JSX.Element {
101104
return (
102105
<div>
103106
<h1>{data.value?.title}</h1>
107+
<Link
108+
onClick={(event): void => {
109+
event.preventDefault();
110+
LBRY.rpc(
111+
LBRY.getDaemonRPC(),
112+
LBRY.FILE_REFLECT,
113+
{ stream_hash: claimGetData.stream_hash },
114+
undefined,
115+
LBRY.isUsingProxy(),
116+
).then((json: object): void => {
117+
alert("Reflected " + Array(json).length + " blobs.");
118+
});
119+
}}
120+
style={{ margin: "0 8px" }}
121+
to={null}
122+
>
123+
<button
124+
style={{
125+
backgroundColor: "rgba(17, 17, 17, 0.4)",
126+
// backgroundColorHover: 'rgba(17, 17, 17, 0.7)',
127+
border: "none",
128+
borderRadius: "6px",
129+
color: "white",
130+
cursor: "pointer",
131+
fontWeight: "700",
132+
height: "40px",
133+
padding: "0 16px",
134+
}}
135+
>
136+
<CustomSVG
137+
icon="publish"
138+
viewBox="0 0 24 24"
139+
style={{
140+
fill: "transparent",
141+
height: "18px",
142+
paddingRight: "4px",
143+
stroke: "white",
144+
strokeLinecap: "round",
145+
strokeWidth: "2px",
146+
verticalAlign: "middle",
147+
}}
148+
/>{" "}
149+
<span>Reflect claim file</span>
150+
</button>
151+
</Link>
104152
{data.value?.stream_type === "audio" ? (
105153
<div>
106154
<audio controls src={claimGetData?.streaming_url || null}></audio>

0 commit comments

Comments
 (0)