index.tsx 568 B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import { Wrapper, Bg, CloseImg } from './styled';
  3. const EmbedComp: React.FC = () => {
  4. const handleClose = () => {
  5. const wrapper = document.getElementById('embed-wrapper') as HTMLElement;
  6. const embeds = document.getElementsByTagName('embed');
  7. if (embeds[0]) {
  8. wrapper.style.display = 'none';
  9. wrapper.removeChild(embeds[0]);
  10. }
  11. };
  12. return (
  13. <Wrapper id="embed-wrapper">
  14. <Bg />
  15. <CloseImg src="/icons/button_close.svg" onClick={handleClose} />
  16. </Wrapper>
  17. );
  18. };
  19. export default EmbedComp;