react-feather#Info TypeScript Examples
The following examples show how to use
react-feather#Info.
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: ExpandableListItem.tsx From bee-dashboard with BSD 3-Clause "New" or "Revised" License | 6 votes |
export default function ExpandableListItem({ label, value, tooltip }: Props): ReactElement | null {
const classes = useStyles()
return (
<ListItem className={classes.header}>
<Grid container direction="row" justifyContent="space-between" alignItems="center">
{label && <Typography variant="body1">{label}</Typography>}
{value && (
<Typography variant="body2">
{value}
{tooltip && (
<Tooltip title={tooltip} placement="top" arrow>
<IconButton size="small" className={classes.copyValue}>
<Info strokeWidth={1} />
</IconButton>
</Tooltip>
)}
</Typography>
)}
</Grid>
</ListItem>
)
}
Example #2
Source File: index.tsx From limit-orders-lib with GNU General Public License v3.0 | 6 votes |
StyledInfo = styled(Info)`
opacity: 0.4;
color: ${({ theme }) => theme.text1};
height: 16px;
width: 16px;
:hover {
opacity: 0.8;
}
`
Example #3
Source File: index.tsx From skeleton-web3-interface with GNU General Public License v3.0 | 6 votes |
export default function Menu() {
const node = useRef<HTMLDivElement>()
const open = useModalOpen(ApplicationModal.MENU)
const toggle = useToggleModal(ApplicationModal.MENU)
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>
</MenuFlyout>
)}
</StyledMenu>
)
}
Example #4
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 #5
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 #6
Source File: ListUpdatePopup.tsx From cuiswap with GNU General Public License v3.0 | 5 votes |
export default function ListUpdatePopup({
popKey,
listUrl,
oldList,
newList,
auto
}: {
popKey: string
listUrl: string
oldList: TokenList
newList: TokenList
auto: boolean
}) {
const removePopup = useRemovePopup()
const removeThisPopup = useCallback(() => removePopup(popKey), [popKey, removePopup])
const dispatch = useDispatch<AppDispatch>()
const theme = useContext(ThemeContext)
const updateList = useCallback(() => {
if (auto) return
dispatch(acceptListUpdate(listUrl))
removeThisPopup()
}, [auto, dispatch, listUrl, removeThisPopup])
return (
<AutoRow>
<div style={{ paddingRight: 16 }}>
{auto ? <Info color={theme.text2} size={24} /> : <AlertCircle color={theme.red1} size={24} />}{' '}
</div>
<AutoColumn style={{ flex: '1' }} gap="8px">
{auto ? (
<TYPE.body fontWeight={500}>
The token list "{oldList.name}" has been updated to{' '}
<strong>{versionLabel(newList.version)}</strong>.
</TYPE.body>
) : (
<>
<div>
A token list update is available for the list "{oldList.name}" ({versionLabel(oldList.version)}{' '}
to {versionLabel(newList.version)}).
</div>
<AutoRow>
<div style={{ flexGrow: 1, marginRight: 6 }}>
<ButtonPrimary onClick={updateList}>Update list</ButtonPrimary>
</div>
<div style={{ flexGrow: 1 }}>
<ButtonSecondary onClick={removeThisPopup}>Dismiss</ButtonSecondary>
</div>
</AutoRow>
</>
)}
</AutoColumn>
</AutoRow>
)
}
Example #7
Source File: routes.ts From Aragorn with MIT License | 5 votes |
routes: Routes = [
{
name: 'dashboard',
path: '/',
component: Dashboard,
icon: Grid
},
{
name: 'uploader',
path: '/uploader',
component: Uploader,
icon: Package
},
{
name: 'profile',
path: '/profile/:id?',
component: Profile,
icon: Box
},
{
name: 'fileManage',
path: '/fileManage/:id?',
component: FileManage,
icon: Server
},
{
name: 'upload',
icon: Upload
},
{
name: 'about',
path: '/about',
component: About,
icon: Info,
isFooter: true
},
{
name: 'setting',
path: '/setting',
component: Setting,
icon: Settings,
isFooter: true
}
]
Example #8
Source File: warning.tsx From samuelkraft-next with MIT License | 5 votes |
Warning = ({ children, type }: { children: ReactNode; type: 'warning' | 'info' }): JSX.Element => (
<div className={styles.warning}>
{type === 'info' ? <Info /> : <AlertTriangle />}
<p className={styles.text}>{children}</p>
</div>
)
Example #9
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 #10
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>
)
}
Example #11
Source File: index.tsx From calories-in with MIT License | 5 votes |
InfoStyled = chakra(Info)
Example #12
Source File: getMenuOrDrawerItems.tsx From calories-in with MIT License | 5 votes |
InfoStyled = chakra(Info)
Example #13
Source File: getMenuOrDrawerItems.tsx From calories-in with MIT License | 5 votes |
InfoStyled = chakra(Info)
Example #14
Source File: index.tsx From bee-dashboard with BSD 3-Clause "New" or "Revised" License | 4 votes |
export default function Feeds(): ReactElement {
const { identities, setIdentities } = useContext(IdentityContext)
const { status } = useContext(BeeContext)
const navigate = useNavigate()
const [selectedIdentity, setSelectedIdentity] = useState<Identity | null>(null)
const [showImport, setShowImport] = useState(false)
const [showExport, setShowExport] = useState(false)
const [showDelete, setShowDelete] = useState(false)
function createNewFeed() {
return navigate(ROUTES.FEEDS_NEW)
}
function viewFeed(uuid: string) {
navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uuid))
}
function onDialogClose() {
setShowDelete(false)
setShowExport(false)
setShowImport(false)
setSelectedIdentity(null)
}
function onDelete(identity: Identity) {
onDialogClose()
const updatedFeeds = identities.filter(x => x.uuid !== identity.uuid)
setIdentities(updatedFeeds)
persistIdentitiesWithoutUpdate(updatedFeeds)
}
function onShowExport(identity: Identity) {
setSelectedIdentity(identity)
setShowExport(true)
}
function onShowDelete(identity: Identity) {
setSelectedIdentity(identity)
setShowDelete(true)
}
if (status.all === CheckState.ERROR) return <TroubleshootConnectionCard />
return (
<div>
{showImport && <ImportFeedDialog onClose={() => setShowImport(false)} />}
{showExport && selectedIdentity && <ExportFeedDialog identity={selectedIdentity} onClose={onDialogClose} />}
{showDelete && selectedIdentity && (
<DeleteFeedDialog
identity={selectedIdentity}
onClose={onDialogClose}
onConfirm={(identity: Identity) => onDelete(identity)}
/>
)}
<Box mb={4}>
<Typography variant="h1">Feeds</Typography>
</Box>
<Box mb={4}>
<ExpandableListItemActions>
<SwarmButton iconType={PlusSquare} onClick={createNewFeed}>
Create New Feed
</SwarmButton>
<SwarmButton iconType={PlusSquare} onClick={() => setShowImport(true)}>
Import Feed
</SwarmButton>
</ExpandableListItemActions>
</Box>
{identities.map((x, i) => (
<ExpandableList key={i} label={`${x.name} Website`} defaultOpen>
<Box mb={0.5}>
<ExpandableList label={x.name} level={1}>
<ExpandableListItemKey label="Identity address" value={x.address} />
<ExpandableListItem label="Identity type" value={formatEnum(x.type)} />
</ExpandableList>
</Box>
<ExpandableListItemKey label="Topic" value={'00'.repeat(32)} />
{x.feedHash && <ExpandableListItemKey label="Feed hash" value={x.feedHash} />}
<Box mt={0.75}>
<ExpandableListItemActions>
<SwarmButton onClick={() => viewFeed(x.uuid)} iconType={Info}>
View Feed Page
</SwarmButton>
<SwarmButton onClick={() => onShowExport(x)} iconType={Download}>
Export...
</SwarmButton>
<SwarmButton onClick={() => onShowDelete(x)} iconType={Trash}>
Delete...
</SwarmButton>
</ExpandableListItemActions>
</Box>
</ExpandableList>
))}
</div>
)
}
Example #15
Source File: index.tsx From calories-in with MIT License | 4 votes |
function VariantStats({ ...rest }: Props) {
const dietForm = useDietForm()
const { variantsForms, selectedVariantFormIndex } = dietForm
const selectedVariantForm = variantsForms[selectedVariantFormIndex]
const variantsDetailsModalDisclosure = useDisclosure()
const {
variantStats,
proteinPercent,
carbsPercent,
fatPercent,
energyDiff,
} = useVariantStats({ variantFormFieldId: selectedVariantForm.fieldId })
const { saturatedFat } = variantStats
const saturatedFatEnergyEstimate = getFatEnergyEstimate(saturatedFat)
const { energyEstimate } = getStatsEnergiesEstimates(variantStats)
const saturatedFatPercent = Math.round(
getMacroEnergyPercent(saturatedFatEnergyEstimate, energyEstimate)
)
const hasAtLeastOneMeal = selectedVariantForm.mealsForms.length > 0
return (
<VStack
p={5}
spacing={3}
align="stretch"
alignSelf="flex-start"
justify="left"
{...rest}
>
<Text fontSize="lg" textAlign="center" textColor="gray.500">
Daily totals
</Text>
<Divider />
<EnergyStat
energy={variantStats.energy}
energyDiff={energyDiff}
hasAtLeastOneMeal={hasAtLeastOneMeal}
/>
<VariantStat
label="Protein"
detail={`${proteinPercent}%`}
value={variantStats.protein}
type="primaryMacro"
isDisabled={!hasAtLeastOneMeal}
tooltipLabel="% calories from protein"
/>
<VariantStat
label="Carbs"
detail={`${carbsPercent}%`}
value={variantStats.carbs}
type="primaryMacro"
isDisabled={!hasAtLeastOneMeal}
tooltipLabel="% calories from carbs"
/>
<VariantStat
label="Fat"
detail={`${fatPercent}%`}
value={variantStats.fat}
type="primaryMacro"
isDisabled={!hasAtLeastOneMeal}
tooltipLabel="% calories from fat"
/>
<VariantStat
label="Saturated fat"
detail={`${saturatedFatPercent}%`}
value={variantStats.saturatedFat}
type="secondaryMacro"
isDisabled={!hasAtLeastOneMeal}
tooltipLabel="% calories from saturated fat"
/>
<VariantStat
label="Sugar"
value={variantStats.sugar}
type="secondaryMacro"
isDisabled={!hasAtLeastOneMeal}
/>
<Divider />
<Button
colorScheme="teal"
variant="link"
leftIcon={<Info size={16} />}
isDisabled={!hasAtLeastOneMeal}
onClick={variantsDetailsModalDisclosure.onOpen}
>
View details
</Button>
<VariantsDetailsModal
isOpen={variantsDetailsModalDisclosure.isOpen}
onClose={variantsDetailsModalDisclosure.onClose}
initialVariantForm={selectedVariantForm}
/>
</VStack>
)
}