Skip to content

Commit

Permalink
Preview auto close
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelBahiense committed Jun 4, 2021
1 parent 9e69f57 commit f185545
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Hashtag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Hashtag = () => {
setPosts(null);
refreshPosts();
}
}, [hashtag]);
}, [hashtag]);

useInterval(() => {
refreshPosts();
Expand Down
8 changes: 7 additions & 1 deletion src/components/Post/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export default function Preview(props) {
style={customStyles}
>
<Buttons>
<Open onClick={() => window.open(link,'_blank')}>Open in new tab</Open>
<Open onClick={() => {
window.open(link,'_blank'); closeModal();
}
}
>
Open in new tab
</Open>
<AiOutlineClose style={{"font-size": "20px"}} onClick={closeModal}/>
</Buttons>
<iframe type={"text/html"} width={"100%"} height={"100%"} src={link}></iframe>
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserPosts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const UserPosts = () => {
setPosts(null);
refreshPosts();
}
}, [id]);
}, [id]);

useInterval(() => {
refreshPosts();
Expand Down

0 comments on commit f185545

Please sign in to comment.