react-feather#Code TypeScript Examples
The following examples show how to use
react-feather#Code.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx From sushiswap-exchange with GNU General Public License v3.0 | 6 votes |
export default function Menu() {
const node = useRef<HTMLDivElement>()
const [open, toggle] = useToggle(false)
useOnClickOutside(node, open ? toggle : undefined)
return (
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30451
<StyledMenu ref={node as any}>
<StyledMenuButton onClick={toggle}>
<StyledMenuIcon />
</StyledMenuButton>
{open && (
<MenuFlyout>
<MenuItem id="link" href="https://uniswap.org/">
<Info size={14} />
About
</MenuItem>
<MenuItem id="link" href="https://uniswap.org/docs/v2">
<BookOpen size={14} />
Docs
</MenuItem>
<MenuItem id="link" href={CODE_LINK}>
<Code size={14} />
Code
</MenuItem>
<MenuItem id="link" href="https://discord.gg/EwFs3Pp">
<MessageCircle size={14} />
Discord
</MenuItem>
<MenuItem id="link" href="https://uniswap.info/">
<PieChart size={14} />
Analytics
</MenuItem>
</MenuFlyout>
)}
</StyledMenu>
)
}
Example #2
Source File: index.tsx From cuiswap with GNU General Public License v3.0 | 5 votes |
export default function Menu() {
const node = useRef<HTMLDivElement>()
const [open, toggle] = useToggle(false)
useEffect(() => {
const handleClickOutside = e => {
if (node.current?.contains(e.target) ?? false) {
return
}
toggle()
}
if (open) {
document.addEventListener('mousedown', handleClickOutside)
} else {
document.removeEventListener('mousedown', handleClickOutside)
}
return () => {
document.removeEventListener('mousedown', handleClickOutside)
}
}, [open, toggle])
return (
<StyledMenu ref={node}>
<StyledMenuButton onClick={toggle}>
<StyledMenuIcon />
</StyledMenuButton>
{open && (
<MenuFlyout>
<MenuItem id="link" href="https://uniswap.org/">
<Info size={14} />
About
</MenuItem>
<MenuItem id="link" href="https://uniswap.org/docs/v2">
<BookOpen size={14} />
Docs
</MenuItem>
<MenuItem id="link" href={CODE_LINK}>
<Code size={14} />
Code
</MenuItem>
<MenuItem id="link" href="https://discord.gg/EwFs3Pp">
<MessageCircle size={14} />
Discord
</MenuItem>
<MenuItem id="link" href="https://uniswap.info/">
<PieChart size={14} />
Analytics
</MenuItem>
</MenuFlyout>
)}
</StyledMenu>
)
}
Example #3
Source File: index.tsx From cheeseswap-interface with GNU General Public License v3.0 | 5 votes |
export default function Menu() {
const node = useRef<HTMLDivElement>()
const [open, toggle] = useToggle(false)
useOnClickOutside(node, open ? toggle : undefined)
return (
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30451
<StyledMenu ref={node as any}>
<StyledMenuButton onClick={toggle}>
<StyledMenuIcon />
</StyledMenuButton>
{open && (
<MenuFlyout>
<MenuItem id="link" href="https://ogee.exchange/#/swap">
HECO
</MenuItem>
<MenuItem id="link" href="https://qsr.cheeseswap.app">
Quasar
</MenuItem>
<MenuItem id="link" href="https://cheesemaker.farm/">
<Sunrise size={14} />
Farm
</MenuItem>
<MenuItem id="link" href="https://info.cheeseswap.app/">
<PieChart size={14} />
Chart
</MenuItem>
<MenuItem id="link" href="https://t.me/cheesemakerfarm">
<MessageCircle size={14} />
Telegram
</MenuItem>
<MenuItem id="link" href={CODE_LINK}>
<Code size={14} />
Code
</MenuItem>
</MenuFlyout>
)}
</StyledMenu>
)
}
Example #4
Source File: index.tsx From forward.swaps with GNU General Public License v3.0 | 5 votes |
export default function Menu() {
const { account } = useActiveWeb3React()
const node = useRef<HTMLDivElement>()
const open = useModalOpen(ApplicationModal.MENU)
const toggle = useToggleModal(ApplicationModal.MENU)
useOnClickOutside(node, open ? toggle : undefined)
const openClaimModal = useToggleModal(ApplicationModal.ADDRESS_CLAIM)
return (
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30451
<StyledMenu ref={node as any}>
<StyledMenuButton onClick={toggle}>
<StyledMenuIcon />
</StyledMenuButton>
{open && (
<MenuFlyout>
<MenuItem id="link" href="https://uniswap.org/">
<Info size={14} />
About
</MenuItem>
<MenuItem id="link" href="https://uniswap.org/docs/v2">
<BookOpen size={14} />
Docs
</MenuItem>
<MenuItem id="link" href={CODE_LINK}>
<Code size={14} />
Code
</MenuItem>
<MenuItem id="link" href="https://discord.gg/EwFs3Pp">
<MessageCircle size={14} />
Discord
</MenuItem>
<MenuItem id="link" href="https://uniswap.info/">
<PieChart size={14} />
Analytics
</MenuItem>
{account && (
<ButtonPrimary onClick={openClaimModal} padding="8px 16px" width="100%" borderRadius="12px" mt="0.5rem">
Claim UNI
</ButtonPrimary>
)}
</MenuFlyout>
)}
</StyledMenu>
)
}
Example #5
Source File: index.tsx From luaswap-interface with GNU General Public License v3.0 | 5 votes |
export default function Menu() {
const { chainId } = useActiveWeb3React()
const IsTomo = IsTomoChain(chainId)
const node = useRef<HTMLDivElement>()
const open = useModalOpen(ApplicationModal.MENU)
const toggle = useToggleModal(ApplicationModal.MENU)
useOnClickOutside(node, open ? toggle : undefined)
// const openClaimModal = useToggleModal(ApplicationModal.ADDRESS_CLAIM)
return (
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30451
<StyledMenu ref={node as any}>
<StyledMenuButton onClick={toggle}>
<StyledMenuIcon />
</StyledMenuButton>
{open && (
<MenuFlyout>
<MenuItem id="link" href="https://luaswap.org/">
<Info size={14} />
About
</MenuItem>
{/* <MenuItem id="link" href="https://luaswap.org/docs/">
<BookOpen size={14} />
Docs
</MenuItem> */}
<MenuItem id="link" href={CODE_LINK}>
<Code size={14} />
Code
</MenuItem>
{/* <MenuItem id="link" href="https://discord.gg/">
<MessageCircle size={14} />
Discord
</MenuItem> */}
{!IsTomo ? (
<MenuItem id="link" href="https://info.luaswap.org/">
<PieChart size={14} />
Analytics
</MenuItem>
) : (
''
)}
{/* {account && (
<ButtonPrimary onClick={openClaimModal} padding="8px 16px" width="100%" borderRadius="12px" mt="0.5rem">
Claim LUA
</ButtonPrimary>
)} */}
</MenuFlyout>
)}
</StyledMenu>
)
}