Skip to content

Commit

Permalink
feat:add share
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Aug 12, 2024
1 parent 46b4c23 commit 3367f39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions public/share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/components/ATable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ATable: FC<ATableProps> = ({ header = [], data = [], loading }) => {
data-tooltip-id="my-tooltip"
data-tooltip-content={item.fileName}
data-tooltip-delay-hide={100}
data-tooltip-place='top-start' className="w-[200px] pl-2 h-[40px] flex items-center">{truncateMiddle(item.fileName, 5, 5)}</div></td>
data-tooltip-place='top-start' className="w-[230px] pl-2 h-[40px] flex items-center">{truncateMiddle(item.fileName, 5, 5)}</div></td>
<td><div className="w-[130px] flex items-center justify-between mr-5 ">{truncateMiddle(item.bagId, 5, 5)}
<button onClick={() => copyTextToClipboard(item.bagId)}>
<img src='/copy.svg' className=" w-5" />
Expand All @@ -45,7 +45,10 @@ const ATable: FC<ATableProps> = ({ header = [], data = [], loading }) => {
>{formatBytes(Number(item.fileSize))}</div></td>
<td><div className="w-[150px]">{timestampToDateTime(Number(item.uploadDate))}</div></td>
<td><div className="w-[100px]">{truncateMiddle(item.from, 5, 5)}</div></td>
<td><div className="w-[100px]">
<td><div className="w-[100px] flex gap-2">
<button onClick={() => copyTextToClipboard(`https://ton-gateway.crust.network/gateway/${item.bagId}?filename=${item.fileName}`)}>
<img src="share.svg" className="w-5" />
</button>
<button onClick={() => onDownloadFile(item)}>
<img src="download.svg" className="w-5" />
</button>
Expand Down

0 comments on commit 3367f39

Please sign in to comment.