add code for local links
This commit is contained in:
parent
539e8e360c
commit
8127db345b
2 changed files with 17 additions and 0 deletions
|
@ -1,9 +1,11 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doNotify } from 'lbry-redux';
|
||||
// import { doNavigate } from 'redux/actions/navigation';
|
||||
import ExternalLink from './view';
|
||||
|
||||
const select = () => ({});
|
||||
const perform = dispatch => ({
|
||||
// navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||
openModal: (modal, props) => dispatch(doNotify(modal, props)),
|
||||
});
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ type Props = {
|
|||
href: string,
|
||||
title?: string,
|
||||
children: React.Node,
|
||||
// navigate: (string, ?{}) => void,
|
||||
openModal: ({ id: string }, { uri: string }) => void,
|
||||
};
|
||||
|
||||
|
@ -40,6 +41,20 @@ class ExternalLink extends React.PureComponent<Props> {
|
|||
);
|
||||
}
|
||||
|
||||
/* React-remark blocks the lbry protocol requires an external fix
|
||||
// Return local link if valid lbry uri
|
||||
if (protocol && protocol[0] === 'lbry:') {
|
||||
element = (
|
||||
<Button
|
||||
button="link"
|
||||
title={title}
|
||||
onClick={() => navigate('/show', { uri: href })}
|
||||
>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
} */
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue