react-icons/fi#FiWifi TypeScript Examples
The following examples show how to use
react-icons/fi#FiWifi.
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 dxvote with GNU Affero General Public License v3.0 | 4 votes |
Votes = () => {
const {
context: {
configStore,
daoStore,
providerStore,
daoService,
orbitDBService,
},
} = useContext();
//State
const [signVote, setSignVote] = useState(false);
const [decision, setDecision] = useState(0);
const [votePercentage, setVotePercentage] = useState(0);
const [signedVotesOfProposal, setSignedVotesOfProposal] = useState([]);
const [loadingSignedOrbitDBVotes, setLoadingSignedOrbitDBVotes] =
useState(true);
// We should get the ID in another way
const proposalId = useLocation().pathname.split('/')[3];
const proposal = daoStore.getProposal(proposalId);
const proposalEvents = daoStore.getProposalEvents(proposalId);
const { account } = providerStore.getActiveWeb3React();
const signedVoteMessageId = utils.id(`dxvote:${proposalId}`);
const { finishTime } = daoStore.getProposalStatus(proposalId);
const votingMachineOfProposal =
daoStore.getVotingMachineOfProposal(proposalId);
const finishTimeReached = finishTime.toNumber() < moment().unix();
const isDXDVotingMachine =
configStore.getNetworkContracts().votingMachines[
votingMachineOfProposal.address
].type == 'DXDVotingMachine';
orbitDBService.getLogs(signedVoteMessageId).then(signedVoteMessages => {
console.debug('[OrbitDB messages]', signedVoteMessages);
signedVoteMessages.map(signedVoteMessageRaw => {
const signedVoteMessage = parseSignedVoteMessage(signedVoteMessageRaw);
if (signedVoteMessage.valid) {
const alreadyAdded =
signedVotesOfProposal.findIndex(
s => s.voter == signedVoteMessage.voter
) > -1 ||
proposalEvents.votes.findIndex(
s => s.voter == signedVoteMessage.voter
) > -1;
const repOfVoterForProposal = daoStore.getRepAt(
signedVoteMessage.voter,
proposal.creationEvent.blockNumber
).userRep;
if (
!alreadyAdded &&
repOfVoterForProposal >= bnum(signedVoteMessage.repAmount)
) {
signedVotesOfProposal.push({
voter: signedVoteMessage.voter,
vote: signedVoteMessage.decision,
amount: bnum(signedVoteMessage.repAmount),
signature: signedVoteMessage.signature,
source: 'orbitDB',
});
}
}
});
setSignedVotesOfProposal(signedVotesOfProposal);
setLoadingSignedOrbitDBVotes(false);
});
let votedAmount = bnum(0);
proposalEvents.votes.map(vote => {
if (vote.voter === account) {
votedAmount = bnum(vote.amount);
}
});
let positiveVotesCount = proposalEvents.votes.filter(vote =>
isVoteYes(vote.vote)
).length;
let negativeVotesCount = proposalEvents.votes.filter(vote =>
isVoteNo(vote.vote)
).length;
const {
userRep: userRepAtProposalCreation,
totalSupply: totalRepAtProposalCreation,
} = daoStore.getRepAt(account, proposal.creationEvent.blockNumber);
const repPercentageAtCreation = toPercentage(
userRepAtProposalCreation.div(totalRepAtProposalCreation)
).toFixed(2);
const positiveVotes = toPercentage(
proposal.positiveVotes.div(totalRepAtProposalCreation)
).toFixed(2, 4);
const negativeVotes = toPercentage(
proposal.negativeVotes.div(totalRepAtProposalCreation)
).toFixed(2, 4);
const totalPositiveSignedVotes = toPercentage(
signedVotesOfProposal
.filter(signedVote => isVoteYes(signedVote.vote))
.reduce(function (acc, obj) {
return acc.plus(obj.amount);
}, bnum(0))
.div(totalRepAtProposalCreation)
).toFixed(2, 4);
const totalNegativeSignedVotes = toPercentage(
signedVotesOfProposal
.filter(signedVote => isVoteNo(signedVote.vote))
.reduce(function (acc, obj) {
return acc.plus(obj.amount);
}, bnum(0))
.div(totalRepAtProposalCreation)
).toFixed(2, 4);
if (Number(repPercentageAtCreation) > 0 && votePercentage === 0) {
setVotePercentage(Number(repPercentageAtCreation));
}
// Events Handlers
const onVoteValueChange = event => {
setVotePercentage(
event.target.value < repPercentageAtCreation
? event.target.value
: repPercentageAtCreation
);
};
const executeSignedVote = function (signedVote) {
daoService.executeSignedVote(
votingMachineOfProposal.address,
proposalId,
signedVote.voter,
signedVote.vote,
signedVote.amount.toString(),
signedVote.signature
);
};
const submitVote = async function (voteDetails: {
votingMachine: string;
proposalId: string;
voter: string;
decision: string;
repAmount: string;
signVote: boolean;
networks: boolean[];
hashToETHMessage: boolean;
}) {
if (voteDetails.signVote) {
const voteSignature = await daoService.signVote(
voteDetails.votingMachine,
voteDetails.proposalId,
voteDetails.decision,
voteDetails.repAmount,
voteDetails.hashToETHMessage
);
if (
verifySignedVote(
voteDetails.votingMachine,
voteDetails.proposalId,
voteDetails.voter,
voteDetails.decision,
voteDetails.repAmount,
voteSignature
)
) {
if (voteDetails.networks[0])
orbitDBService.addLog(
utils.id(`dxvote:${proposalId}`),
`signedVote:${voteDetails.votingMachine}:${voteDetails.proposalId}:${voteDetails.voter}:${voteDetails.decision}:${voteDetails.repAmount}:${voteSignature}`
);
}
} else {
daoService.vote(
voteDetails.decision,
voteDetails.repAmount,
voteDetails.proposalId
);
}
setDecision(0);
};
// TODO:
// This Component could be abstracted so much!
// <Counts> <NewVote> each one getting proposalEvents and iterating and counting.
// and Summary can be based on polarity <Summary polarity={positive|negative} /> and reused.
return (
<>
<SpaceAroundRow>
<strong>
Confirmed Votes <Question question="4" />
</strong>
</SpaceAroundRow>
<SpaceAroundRow>
<PositiveSummary>
<SummaryTotal>
<AmountBadge color="green">{positiveVotesCount}</AmountBadge>
{`${positiveVotes}%`}
</SummaryTotal>
<HorizontalSeparator />
<SummaryDetails>
{proposalEvents?.votes
.filter(voteEvent => isVoteYes(voteEvent.vote))
.map((voteEvent, i) => (
<Vote key={`vote-pos-${i}`}>
<BlockchainLink
size="short"
type="user"
text={voteEvent.voter}
/>
<span>
{bnum(voteEvent.amount)
.times('100')
.div(totalRepAtProposalCreation)
.toFixed(2, 4)}
%
</span>
</Vote>
))}
</SummaryDetails>
</PositiveSummary>
<NegativeSummary>
<SummaryTotal>
<AmountBadge color="red">{negativeVotesCount}</AmountBadge>
<span>{`${negativeVotes}%`}</span>
</SummaryTotal>
<HorizontalSeparator />
<SummaryDetails>
{proposalEvents?.votes
?.filter(voteEvent => isVoteNo(voteEvent.vote))
.map((voteEvent, i) => (
<Vote key={`vote-neg-${i}`}>
<BlockchainLink
size="short"
type="user"
text={voteEvent.voter}
/>
<span>
{bnum(voteEvent.amount)
.times('100')
.div(totalRepAtProposalCreation)
.toFixed(2, 4)}
%
</span>
</Vote>
))}
</SummaryDetails>
</NegativeSummary>
</SpaceAroundRow>
{!loadingSignedOrbitDBVotes && (
<div>
<SpaceAroundRow>
<strong>
Signed Votes <Question question="4" /> <br />
{!isDXDVotingMachine && <small>Non-Executable</small>}
</strong>
</SpaceAroundRow>
<SpaceAroundRow>
<PositiveSummary>
<SummaryTotal>
<AmountBadge color="green">
{
signedVotesOfProposal.filter(signedVote =>
isVoteYes(signedVote.vote)
).length
}
</AmountBadge>
{`${totalPositiveSignedVotes}%`}
</SummaryTotal>
<HorizontalSeparator />
<SummaryDetails>
{signedVotesOfProposal
.filter(signedVote => isVoteYes(signedVote.vote))
.map((signedVote, i) => (
<Vote key={`vote-pos-${i}`}>
<BlockchainLink
size="short"
type="user"
text={signedVote.voter}
/>
<span>
{bnum(signedVote.amount)
.times('100')
.div(totalRepAtProposalCreation)
.toFixed(2, 4)}
%
</span>
{isDXDVotingMachine && (
<ActionButton
style={{
height: '15px',
margin: '0px 0px 0px 2px',
maxWidth: '15px',
textAlign: 'center',
}}
color="#536DFE"
onClick={() => executeSignedVote(signedVote)}
>
<FiArrowUp />
</ActionButton>
)}
</Vote>
))}
</SummaryDetails>
</PositiveSummary>
<NegativeSummary>
<SummaryTotal>
<AmountBadge color="red">
{
signedVotesOfProposal.filter(signedVote =>
isVoteNo(signedVote.vote)
).length
}
</AmountBadge>
{`${totalNegativeSignedVotes}%`}
</SummaryTotal>
<HorizontalSeparator />
<SummaryDetails>
{signedVotesOfProposal
?.filter(signedVote => isVoteNo(signedVote.vote))
.map((signedVote, i) => (
<Vote key={`vote-neg-${i}`}>
<BlockchainLink
size="short"
type="user"
text={signedVote.voter}
/>
<span>
{bnum(signedVote.amount)
.times('100')
.div(totalRepAtProposalCreation)
.toFixed(2, 4)}
%
</span>
{isDXDVotingMachine && (
<ActionButton
style={{
height: '15px',
margin: '0px 0px 0px 2px',
maxWidth: '15px',
textAlign: 'center',
}}
color="#536DFE"
onClick={() => executeSignedVote(signedVote)}
>
<FiArrowUp />
</ActionButton>
)}
</Vote>
))}
</SummaryDetails>
</NegativeSummary>
</SpaceAroundRow>
</div>
)}
{Number(repPercentageAtCreation) > 0 && (
<small>{repPercentageAtCreation} % REP at proposal creation</small>
)}
{(proposal.stateInVotingMachine === 3 ||
proposal.stateInVotingMachine === 4) &&
votingMachineOfProposal.params.votersReputationLossRatio.toNumber() >
0 &&
finishTime.toNumber() > 0 && (
<TextCenter>
<small>
Voter REP Loss Ratio:
{votingMachineOfProposal.params.votersReputationLossRatio.toString()}
%
</small>
</TextCenter>
)}
{account &&
!finishTimeReached &&
votedAmount.toNumber() === 0 &&
Number(repPercentageAtCreation) > 0 &&
proposal.stateInVotingMachine >= 3 ? (
<SpaceAroundRow>
<ConfirmVoteModal
voteDecision={decision}
toAdd={votePercentage}
positive={parseFloat(positiveVotes)}
negative={parseFloat(negativeVotes)}
onConfirm={submitVote}
onCancel={() => setDecision(0)}
voteDetails={{
votingMachine: votingMachineOfProposal.address,
proposalId: proposalId,
voter: account,
decision: decision.toString(),
repAmount: totalRepAtProposalCreation
.times(bnum(votePercentage))
.div('100')
.toFixed(0, 1)
.toString(),
signVote: signVote,
}}
/>
<AmountInput
type="number"
placeholder="REP"
name="votePercentage"
max={repPercentageAtCreation}
value={votePercentage}
min="0"
step={
votePercentage > 10
? '1'
: votePercentage > 1
? '0.01'
: votePercentage > 0.1
? '0.001'
: '0.00001'
}
id="votePercentage"
onChange={onVoteValueChange}
style={{ flex: 2 }}
/>
<ActionButton
style={{ flex: 1, maxWidth: '20px', textAlign: 'center' }}
color="green"
onClick={() => setDecision(1)}
>
<FiThumbsUp />
</ActionButton>
<ActionButton
style={{ flex: 1, maxWidth: '20px', textAlign: 'center' }}
color="red"
onClick={() => setDecision(2)}
>
<FiThumbsDown />
</ActionButton>
<ActionButton
style={{ flex: 1, maxWidth: '20px', textAlign: 'center' }}
color="#536DFE"
onClick={() => setSignVote(!signVote)}
>
{signVote ? <FiWifiOff /> : <FiWifi />}
</ActionButton>
</SpaceAroundRow>
) : (
votedAmount.toNumber() !== 0 && (
<SpaceAroundRow>
<TextCenter>
{`
Already voted ${votedAmount.toNumber() > 0 ? 'for' : 'against'}
with
${votedAmount
.times('100')
.div(totalRepAtProposalCreation)
.toFixed(2, 4)}
% REP`}
</TextCenter>
</SpaceAroundRow>
)
)}
</>
);
}
Example #2
Source File: HardwareModal.tsx From Meshtastic with GNU General Public License v3.0 | 4 votes |
HardwareModal = ({
device,
open,
close,
}: HardwareModal): JSX.Element => {
const [hideDetails, setHideDetails] = useState(false);
const { breakpoint } = useBreakpoint(BREAKPOINTS, 'md');
return (
<Modal open={open} onClose={close}>
<div className="absolute right-0 z-20 m-2 md:flex">
<Button onClick={close}>
<FiX />
</Button>
</div>
<div className="absolute inset-0">
<motion.div
layout
animate={
breakpoint === 'sm'
? hideDetails
? 'hiddenSm'
: 'visibleSm'
: hideDetails
? 'hidden'
: 'visible'
}
variants={{
hidden: { width: '100%', height: '100%' },
hiddenSm: { height: '100%', width: '100%' },
visible: { width: '20%', height: '100%' },
visibleSm: { height: '33%', width: '100%' },
}}
transition={{
type: 'just',
}}
className="flex flex-col md:h-full md:flex-row"
>
<motion.div
layout
className={`relative z-10 flex h-full w-full rounded-t-2xl md:rounded-l-2xl md:rounded-tr-none ${device.misc.Gradient}`}
>
<motion.img
layout
src={device.images.Front}
alt=""
className="pointer-events-none m-auto max-h-full max-w-full object-cover p-2"
/>
<div className="absolute -bottom-5 z-20 flex w-full md:bottom-auto md:-right-5 md:h-full md:w-auto">
<Button
animate={
breakpoint === 'sm'
? hideDetails
? 'hiddenSm'
: 'visibleSm'
: hideDetails
? 'hidden'
: 'visible'
}
variants={{
hidden: { rotate: 180 },
hiddenSm: { rotate: -90 },
visible: { rotate: 0 },
visibleSm: { rotate: 90 },
}}
onClick={() => {
setHideDetails(!hideDetails);
}}
>
<FiChevronRight />
</Button>
</div>
<AnimatePresence>
{!hideDetails && (
<>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className={`absolute -bottom-5 z-20 flex md:mt-0 md:hidden md:pb-2 ${
hideDetails ? 'opacity-0' : 'opacity-100'
}`}
>
<VariantSelectButton options={device.variants} />
</motion.div>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className="absolute -bottom-3 right-0 m-auto mr-2 ml-auto flex md:inset-x-1 md:bottom-4 md:mt-2"
>
<div className="m-auto flex gap-2">
{device.features.BLE && (
<Badge
name="Bluetooth"
color="bg-blue-500"
icon={<FiBluetooth />}
/>
)}
{device.features.WiFi && (
<Badge
name="WiFi"
color="bg-orange-500"
icon={<FiWifi />}
/>
)}
</div>
</motion.div>
</>
)}
</AnimatePresence>
</motion.div>
<div
className={`h-7 bg-base opacity-0 md:h-auto md:w-7 ${
hideDetails ? 'flex' : 'hidden'
}`}
/>
</motion.div>
</div>
<div className="z-[1] mt-[25%] flex h-full flex-col md:ml-[20%] md:mt-0 md:w-4/5">
<div className="z-0 hidden pb-2 md:flex">
<VariantSelectButton options={device.variants} />
</div>
<div
className={`mt-1 flex flex-grow rounded-2xl bg-base p-2 shadow-inner transition-opacity duration-100 ease-linear md:mt-0 md:rounded-l-none md:rounded-r-2xl md:p-4 ${
hideDetails ? 'opacity-0' : 'opacity-100'
}`}
>
<Tab.Group
as="div"
className="flex flex-grow flex-col rounded-2xl bg-primary p-2"
>
<Tab.List className="flex gap-2">
<CardTab title="Info" />
<CardTab title="Power" />
<CardTab title="Pinout" />
</Tab.List>
<Tab.Panels as="div" className="flex-grow overflow-y-auto">
<InfoTab device={device} />
<PowerTab device={device} />
<PinoutTab device={device} />
</Tab.Panels>
</Tab.Group>
</div>
</div>
</Modal>
);
}
Example #3
Source File: Index.tsx From meshtastic-web with GNU General Public License v3.0 | 4 votes |
Settings = ({ open, setOpen }: SettingsProps): JSX.Element => {
const [modulesOpen, setModulesOpen] = useState(false);
const [channelsOpen, setChannelsOpen] = useState(false);
const moduleConfig = useAppSelector(
(state) => state.meshtastic.radio.moduleConfig,
);
const hasGps = true;
const hasWifi = true;
return (
<>
<SidebarOverlay
title="Settings"
open={open}
close={(): void => {
setOpen(false);
}}
direction="y"
>
<CollapsibleSection icon={<FiUser />} title="User">
<User />
</CollapsibleSection>
<CollapsibleSection icon={<FiSmartphone />} title="Device">
<WiFi />
</CollapsibleSection>
<CollapsibleSection icon={<FiMapPin />} title="Position">
<Position />
</CollapsibleSection>
<CollapsibleSection icon={<FiPower />} title="Power">
<Power />
</CollapsibleSection>
<CollapsibleSection icon={<FiWifi />} title="WiFi">
<WiFi />
</CollapsibleSection>
<CollapsibleSection icon={<FiTv />} title="Display">
<Display />
</CollapsibleSection>
<CollapsibleSection icon={<FiRss />} title="LoRa">
<LoRa />
</CollapsibleSection>
<ExternalSection
onClick={(): void => {
setChannelsOpen(true);
}}
icon={<FiLayers />}
title="Channels"
/>
<ExternalSection
onClick={(): void => {
setModulesOpen(true);
}}
icon={<FiPackage />}
title="Modules"
/>
<CollapsibleSection icon={<FiLayout />} title="Interface">
<Interface />
</CollapsibleSection>
</SidebarOverlay>
{/* Modules */}
<SidebarOverlay
title="Modules"
open={modulesOpen}
close={(): void => {
setModulesOpen(false);
}}
direction="x"
>
<CollapsibleSection
icon={<FiWifi />}
title="MQTT"
status={!moduleConfig.mqtt.disabled}
>
<MQTT />
</CollapsibleSection>
<CollapsibleSection
icon={<FiAlignLeft />}
title="Serial"
status={moduleConfig.serial.enabled}
>
<SerialSettingsPanel />
</CollapsibleSection>
<CollapsibleSection
icon={<FiBell />}
title="External Notifications"
status={moduleConfig.extNotification.enabled}
>
<ExternalNotificationsSettingsPlanel />
</CollapsibleSection>
<CollapsibleSection
icon={<FiFastForward />}
title="Store & Forward"
status={moduleConfig.storeForward.enabled}
>
<StoreForwardSettingsPanel />
</CollapsibleSection>
<CollapsibleSection
icon={<FiRss />}
title="Range Test"
status={moduleConfig.rangeTest.enabled}
>
<RangeTestSettingsPanel />
</CollapsibleSection>
<CollapsibleSection
icon={<FiActivity />}
title="Telemetry"
status={true}
>
<Telemetry />
</CollapsibleSection>
<CollapsibleSection
icon={<FiMessageSquare />}
title="Canned Message"
status={moduleConfig.cannedMessage.enabled}
>
<CannedMessage />
</CollapsibleSection>
</SidebarOverlay>
{/* End Modules */}
{/* Channels */}
<SidebarOverlay
title="Channels"
open={channelsOpen}
close={(): void => {
setChannelsOpen(false);
}}
direction="x"
>
<ChannelsGroup />
</SidebarOverlay>
{/* End Channels */}
</>
);
}
Example #4
Source File: BottomNav.tsx From meshtastic-web with GNU General Public License v3.0 | 4 votes |
BottomNav = (): JSX.Element => {
const [showVersionInfo, setShowVersionInfo] = useState(false);
const dispatch = useAppDispatch();
const meshtasticState = useAppSelector((state) => state.meshtastic);
const appState = useAppSelector((state) => state.app);
const primaryChannelSettings = useAppSelector(
(state) => state.meshtastic.radio.channels,
).find((channel) => channel.role === Protobuf.Channel_Role.PRIMARY)?.settings;
const metrics =
meshtasticState.nodes[meshtasticState.radio.hardware.myNodeNum]?.metrics;
return (
<div className="z-20 flex justify-between divide-x divide-gray-400 border-t border-gray-400 bg-white dark:divide-gray-600 dark:border-gray-600 dark:bg-secondaryDark">
<BottomNavItem tooltip="Meshtastic WebUI">
<img
title="Logo"
className="my-auto w-5"
src={appState.darkMode ? '/Logo_White.svg' : '/Logo_Black.svg'}
/>
</BottomNavItem>
<BottomNavItem
tooltip="Connection Status"
onClick={(): void => {
dispatch(openConnectionModal());
}}
className={
[
Types.DeviceStatusEnum.DEVICE_CONNECTED,
Types.DeviceStatusEnum.DEVICE_CONFIGURED,
].includes(meshtasticState.deviceStatus)
? 'bg-primary dark:bg-primary'
: [
Types.DeviceStatusEnum.DEVICE_CONNECTING,
Types.DeviceStatusEnum.DEVICE_RECONNECTING,
Types.DeviceStatusEnum.DEVICE_CONFIGURING,
].includes(meshtasticState.deviceStatus)
? 'bg-yellow-400 dark:bg-yellow-400'
: ''
}
>
{appState.connType === connType.BLE ? (
<FiBluetooth className="h-4" />
) : appState.connType === connType.SERIAL ? (
<FiCpu className="h-4" />
) : (
<FiWifi className="h-4" />
)}
<div className="truncate text-xs font-medium">
{meshtasticState.nodes.find(
(node) =>
node.data.num === meshtasticState.radio.hardware.myNodeNum,
)?.data.user?.longName ?? 'Disconnected'}
</div>
</BottomNavItem>
<BottomNavItem tooltip="Battery Level">
{!metrics?.batteryLevel ? (
<IoBatteryDeadOutline className="h-4" />
) : metrics?.batteryLevel > 50 ? (
<IoBatteryFullOutline className="h-4" />
) : metrics?.batteryLevel > 0 ? (
<IoBatteryFullOutline className="h-4" />
) : (
<IoBatteryChargingOutline className="h-4" />
)}
<div className="truncate text-xs font-medium">
{metrics?.batteryLevel
? `${metrics?.batteryLevel}% - ${metrics?.voltage}v`
: 'No Battery'}
</div>
</BottomNavItem>
<BottomNavItem tooltip="Network Utilization">
<div className="m-auto h-3 w-3 rounded-full bg-primary" />
<div className="truncate text-xs font-medium">
{`${metrics?.airUtilTx ?? 0}% - Air`} |
</div>
<div
className={`m-auto h-3 w-3 rounded-full ${
!metrics?.channelUtilization
? 'bg-primary'
: metrics?.channelUtilization > 50
? 'bg-red-400'
: metrics?.channelUtilization > 24
? 'bg-yellow-400'
: 'bg-primary'
}`}
/>
<div className="truncate text-xs font-medium">
{`${metrics?.channelUtilization ?? 0}% - Ch`}
</div>
</BottomNavItem>
<BottomNavItem tooltip="MQTT Status">
{primaryChannelSettings?.uplinkEnabled &&
primaryChannelSettings?.downlinkEnabled &&
!meshtasticState.radio.moduleConfig.mqtt.disabled ? (
<RiArrowUpDownLine className="h-4" />
) : primaryChannelSettings?.uplinkEnabled &&
!meshtasticState.radio.moduleConfig.mqtt.disabled ? (
<RiArrowUpLine className="h-4" />
) : primaryChannelSettings?.downlinkEnabled &&
!meshtasticState.radio.moduleConfig.mqtt.disabled ? (
<RiArrowDownLine className="h-4" />
) : (
<FiX className="h-4" />
)}
</BottomNavItem>
<div className="flex-grow">
<BottomNavItem
onClick={(): void => {
dispatch(toggleMobileNav());
}}
className="md:hidden"
>
{appState.mobileNavOpen ? (
<FiX className="m-auto h-4" />
) : (
<FiMenu className="m-auto h-4" />
)}
</BottomNavItem>
</div>
<BottomNavItem
tooltip={
appState.updateAvaliable ? 'Update Avaliable' : 'Current Commit'
}
onClick={(): void => {
setShowVersionInfo(true);
}}
className={appState.updateAvaliable ? 'animate-pulse' : ''}
>
{appState.updateAvaliable ? (
<MdUpgrade className="h-4" />
) : (
<FiGitBranch className="h-4" />
)}
<p className="text-xs opacity-60">{process.env.COMMIT_HASH}</p>
</BottomNavItem>
<BottomNavItem
tooltip="Toggle Theme"
onClick={(): void => {
dispatch(setDarkModeEnabled(!appState.darkMode));
}}
>
{appState.darkMode ? (
<FiSun className="h-4" />
) : (
<FiMoon className="h-4" />
)}
</BottomNavItem>
<VersionInfo
modalOpen={showVersionInfo}
onClose={(): void => {
setShowVersionInfo(false);
}}
/>
</div>
);
}