parent
c4f12804bb
commit
7c75700138
@ -0,0 +1,52 @@ |
||||
/* eslint-disable @typescript-eslint/no-unused-vars */ |
||||
import React, { useEffect, useState, useRef } from 'react' |
||||
|
||||
function HomeTabFeatured () { |
||||
const [state, setState] = useState<{ |
||||
searchInput: string |
||||
}>({ |
||||
searchInput: '' |
||||
}) |
||||
useEffect(() => { |
||||
|
||||
document.addEventListener("keyup", (e) => handleSearchKeyDown(e)) |
||||
|
||||
return () => { |
||||
document.removeEventListener("keyup", handleSearchKeyDown) |
||||
} |
||||
}, []) |
||||
|
||||
const searchInputRef = useRef(null) |
||||
const remiAudioEl = useRef(null) |
||||
|
||||
const playRemi = async () => { |
||||
remiAudioEl.current.play() |
||||
} |
||||
const handleSearchKeyDown = (e: KeyboardEvent) => { |
||||
if (e.target !== searchInputRef.current) return |
||||
if (e.key === "Enter") { |
||||
openLink() |
||||
setState(prevState => { |
||||
return { ...prevState, searchInput: '' } |
||||
}) |
||||
searchInputRef.current.value = "" |
||||
} |
||||
} |
||||
|
||||
const openLink = (url = "") => { |
||||
if (url === "") { |
||||
window.open("https://remix-ide.readthedocs.io/en/latest/search.html?q=" + state.searchInput + "&check_keywords=yes&area=default", '_blank') |
||||
} else { |
||||
window.open(url, '_blank') |
||||
} |
||||
} |
||||
|
||||
return ( |
||||
<div className="" id="hTFeaturedeSection"> |
||||
<label style={{fontSize: "1.2rem"}}>Featured</label> |
||||
<div className="border"></div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
export default HomeTabFeatured |
@ -0,0 +1,52 @@ |
||||
/* eslint-disable @typescript-eslint/no-unused-vars */ |
||||
import React, { useEffect, useState, useRef } from 'react' |
||||
|
||||
function HomeTabFeaturedPlugins () { |
||||
const [state, setState] = useState<{ |
||||
searchInput: string |
||||
}>({ |
||||
searchInput: '' |
||||
}) |
||||
useEffect(() => { |
||||
|
||||
document.addEventListener("keyup", (e) => handleSearchKeyDown(e)) |
||||
|
||||
return () => { |
||||
document.removeEventListener("keyup", handleSearchKeyDown) |
||||
} |
||||
}, []) |
||||
|
||||
const searchInputRef = useRef(null) |
||||
const remiAudioEl = useRef(null) |
||||
|
||||
const playRemi = async () => { |
||||
remiAudioEl.current.play() |
||||
} |
||||
const handleSearchKeyDown = (e: KeyboardEvent) => { |
||||
if (e.target !== searchInputRef.current) return |
||||
if (e.key === "Enter") { |
||||
openLink() |
||||
setState(prevState => { |
||||
return { ...prevState, searchInput: '' } |
||||
}) |
||||
searchInputRef.current.value = "" |
||||
} |
||||
} |
||||
|
||||
const openLink = (url = "") => { |
||||
if (url === "") { |
||||
window.open("https://remix-ide.readthedocs.io/en/latest/search.html?q=" + state.searchInput + "&check_keywords=yes&area=default", '_blank') |
||||
} else { |
||||
window.open(url, '_blank') |
||||
} |
||||
} |
||||
|
||||
return ( |
||||
<div className="" id="hTFeaturedPlugins"> |
||||
<label style={{fontSize: "1.2rem"}}>Featured Plugins</label> |
||||
<div className="border"></div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
export default HomeTabFeaturedPlugins |
@ -0,0 +1,19 @@ |
||||
/* eslint-disable @typescript-eslint/no-unused-vars */ |
||||
import React, { useEffect, useState, useRef } from 'react' |
||||
|
||||
function HomeTabGetStarted () { |
||||
const [state, setState] = useState<{ |
||||
searchInput: string |
||||
}>({ |
||||
searchInput: '' |
||||
}) |
||||
|
||||
return ( |
||||
<div className="pl-2" id="hTGetStartedSection"> |
||||
<label style={{fontSize: "1.2rem"}}>Get Started</label> |
||||
<div className="border"></div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
export default HomeTabGetStarted |
@ -0,0 +1,29 @@ |
||||
/* eslint-disable @typescript-eslint/no-unused-vars */ |
||||
import React, { useEffect, useState, useRef } from 'react' |
||||
|
||||
function HomeTabScamAlert () { |
||||
return ( |
||||
<div className="" id="hTScamAlertSection"> |
||||
<label className="pl-2 text-danger" style={{fontSize: "1.2rem"}}>Scam Alert</label> |
||||
<div className="ml-2 align-self-end mb-2 d-flex flex-column border border-danger"> |
||||
<span className="pl-4 mt-2"> |
||||
<i className="pr-2 text-danger fas fa-exclamation-triangle"></i> |
||||
<b>Scam Alerts:</b> |
||||
</span> |
||||
<span className="pl-4 mt-1"> |
||||
The only URL Remix uses is remix.ethereum.org
|
||||
</span> |
||||
<span className="pl-4 mt-1">
|
||||
Beware of online videos promoting "liquidity front runner bots":
|
||||
<a className="pl-2 remixui_home_text" target="__blank" href="https://medium.com/remix-ide/remix-in-youtube-crypto-scams-71c338da32d">Learn more</a> |
||||
</span> |
||||
<span className="pl-4 mt-1"> |
||||
Additional safety tips: <a className="remixui_home_text" target="__blank" href="https://remix-ide.readthedocs.io/en/latest/security.html">here</a> |
||||
</span> |
||||
</div> |
||||
<br/> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
export default HomeTabScamAlert |
Loading…
Reference in new issue