mirror of
https://github.com/wassname/talk.git
synced 2026-08-08 11:28:12 +08:00
S
This commit is contained in:
@@ -21,22 +21,27 @@ const PermalinkView: StatelessComponent<InnerProps> = props => {
|
||||
if (props.comment) {
|
||||
// TODO (bc) temporary needed to pass the assetID to go back to the correct asset until the backend
|
||||
// returns the correct asset url
|
||||
const assetURL = `${location.origin}/?assetID=${query.assetID}`;
|
||||
let assetURL: string = "";
|
||||
if (query.assetID) {
|
||||
assetURL = `${location.origin}/?assetID=${query.assetID}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<Logo />
|
||||
<Flex direction="column" className={styles.comment}>
|
||||
<CommentContainer data={props.comment} />
|
||||
<Button
|
||||
variant="filled"
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
window.location.href = assetURL;
|
||||
}}
|
||||
>
|
||||
Back to the Stream
|
||||
</Button>
|
||||
{assetURL && (
|
||||
<Button
|
||||
variant="filled"
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
window.location.href = assetURL;
|
||||
}}
|
||||
>
|
||||
Back to the Stream
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -10,8 +10,13 @@ interface InnerProps {
|
||||
commentID: string;
|
||||
}
|
||||
|
||||
export const PermalinkContainer: StatelessComponent<InnerProps> = props => {
|
||||
return <Permalink {...props} assetURL={props.local.assetURL} />;
|
||||
export const PermalinkContainer: StatelessComponent<InnerProps> = ({
|
||||
local,
|
||||
commentID,
|
||||
}) => {
|
||||
return local.assetURL ? (
|
||||
<Permalink assetURL={local.assetURL} commentID={commentID} />
|
||||
) : null;
|
||||
};
|
||||
|
||||
const enhanced = withLocalStateContainer<Local>(
|
||||
|
||||
Reference in New Issue
Block a user