|
1 | 1 | import Props, { JSX, useEffect, useState } from "react"; |
| 2 | +import React from "react"; |
2 | 3 | import Markdown from "react-markdown"; |
| 4 | +import { Link } from "react-router"; |
3 | 5 | import LBRY from "~/LBRY"; |
| 6 | +import CustomSVG from "~/components/CustomSVG"; |
4 | 7 |
|
5 | 8 | function downloadMarkdownFile(claimGetData, setMarkdown): void { |
6 | 9 | const url: string = claimGetData?.streaming_url; |
@@ -101,6 +104,51 @@ function StreamClaim({ data }: Props & { data: Stream }): JSX.Element { |
101 | 104 | return ( |
102 | 105 | <div> |
103 | 106 | <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> |
104 | 152 | {data.value?.stream_type === "audio" ? ( |
105 | 153 | <div> |
106 | 154 | <audio controls src={claimGetData?.streaming_url || null}></audio> |
|
0 commit comments