Skip to content

Commit

Permalink
add version chip text to i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
peps committed Dec 27, 2024
1 parent b715902 commit 368f464
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
/* eslint-disable i18next/no-literal-string */
import { useEffect, useState } from 'react';
import { getVersion } from '@tauri-apps/api/app';
import { Wrapper } from './styles';
import { useTranslation } from 'react-i18next';

export default function AppVersion() {
const { t } = useTranslation('common', { useSuspense: false });
const [tariVersion, setTariVersion] = useState<string | null>(null);

useEffect(() => {
getVersion().then((version) => {
setTariVersion(version);
setTariVersion('v' + version);
});
}, []);

if (!tariVersion) return null;

return (
<Wrapper>
Testnet <span>v{tariVersion}</span>
{t('testnet')} <span>{tariVersion}</span>
</Wrapper>
);
}
2 changes: 1 addition & 1 deletion src/containers/phase/Setup/components/AppVersion/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export const Wrapper = styled.div`
line-height: 245.455%;
span {
opacity: 0.5;
opacity: 0.6;
}
`;
3 changes: 2 additions & 1 deletion src/containers/phase/Setup/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import { AnimatePresence } from 'framer-motion';

export default function Footer() {
const { airdropTokens } = useAirdropStore();
const isLoggedIn = !!airdropTokens;
const allowTelemetry = useAppConfigStore((s) => s.allow_telemetry);

const isLoggedIn = !!airdropTokens;

/*
// @peps: Im disabling this for now,
// the airdrop share markup requires the AirdropPermission component to be shown
Expand Down

0 comments on commit 368f464

Please sign in to comment.