From 90bf9487e82d511bb6348a8ebfb5fddef228dfe7 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 8 Jul 2019 14:58:33 -0400 Subject: [PATCH 1/4] use short_url for channels and files --- package.json | 2 +- src/ui/component/claimUri/index.js | 14 ++++++++++++++ src/ui/component/claimUri/view.jsx | 30 +++++++++++++++++++++++++++++ src/ui/page/channel/view.jsx | 6 +++--- src/ui/page/file/index.js | 2 -- src/ui/page/file/view.jsx | 18 +++-------------- src/ui/scss/component/_channel.scss | 2 +- src/ui/scss/component/_main.scss | 3 +-- src/ui/scss/component/_media.scss | 6 ------ yarn.lock | 4 ++-- 10 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 src/ui/component/claimUri/index.js create mode 100644 src/ui/component/claimUri/view.jsx diff --git a/package.json b/package.json index d3cbd8313..2c2b052ac 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#c83489e78ed368d368ad25552fce25e7de2d64b5", + "lbry-redux": "lbryio/lbry-redux#bb82aed61a5569e565daa784eb25fc1d639c0c22", "lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/src/ui/component/claimUri/index.js b/src/ui/component/claimUri/index.js new file mode 100644 index 000000000..85a69cb1a --- /dev/null +++ b/src/ui/component/claimUri/index.js @@ -0,0 +1,14 @@ +import { connect } from 'react-redux'; +import { makeSelectShortUrlForUri, doToast } from 'lbry-redux'; +import ClaimUri from './view'; + +const select = (state, props) => ({ + shortUrl: makeSelectShortUrlForUri(props.uri)(state), +}); + +export default connect( + select, + { + doToast, + } +)(ClaimUri); diff --git a/src/ui/component/claimUri/view.jsx b/src/ui/component/claimUri/view.jsx new file mode 100644 index 000000000..e48c205d8 --- /dev/null +++ b/src/ui/component/claimUri/view.jsx @@ -0,0 +1,30 @@ +// @flow +import React from 'react'; +import { clipboard } from 'electron'; +import Button from 'component/button'; + +type Props = { + shortUrl: ?string, + uri: string, + doToast: ({ message: string }) => void, +}; + +function ClaimUri(props: Props) { + const { shortUrl, uri, doToast } = props; + + return ( +