File tree Expand file tree Collapse file tree
components/pages/download Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,37 +43,21 @@ const StepNumber = styled.div`
4343 font-size: 18px;
4444 border: 2.5px solid;
4545` ;
46+ const Download = styled . iframe `
47+ width: 0;
48+ height: 0;
49+ position: fixed;
50+ top: 100%;
51+ right: 100%;
52+ border: 0;
53+ background: transparent;
54+ opacity: 0;
55+ ` ;
4656
4757export default function DownloadPage ( { downloadUrl } ) {
48- const downloadStartedRef = useRef ( false ) ;
49-
50- useEffect ( ( ) => {
51- const timeout = setTimeout ( ( ) => {
52- if ( ! downloadStartedRef . current ) {
53- const link = document . createElement ( 'a' ) ;
54- link . href = downloadUrl ;
55- link . setAttribute ( 'download' , `CodeEdit.dmg` ) ;
56-
57- // Append to html link element page
58- document . body . appendChild ( link ) ;
59-
60- // Start download
61- link . click ( ) ;
62-
63- // Clean up and remove the link
64- link . parentNode . removeChild ( link ) ;
65-
66- downloadStartedRef . current = true ;
67- }
68- } , 100 ) ;
69-
70- return ( ) => {
71- clearTimeout ( timeout ) ;
72- } ;
73- } , [ downloadUrl ] ) ;
74-
7558 return (
7659 < >
60+ < Download src = { downloadUrl } />
7761 < Section contained gutterTop >
7862 < Row align = "center" style = { { position : 'relative' , zIndex : 1 } } >
7963 < Column width = { { md : 12 , lg : 12 } } >
You can’t perform that action at this time.
0 commit comments