-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Google Translate issues with React #1382
Changes from all commits
13285b8
a599e99
ffeb0b9
2352906
2e3359f
d6862e2
f54f1b9
6ea9dfd
dbc2d1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import { useSelector } from 'react-redux' | |
import { Text } from 'grommet' | ||
import { StringifiedBigInt } from 'types/StringifiedBigInt' | ||
import { formatBaseUnitsAsRose, formatWeiAsWrose } from 'app/lib/helpers' | ||
import { NoTranslate } from '../NoTranslate' | ||
|
||
export interface AmountFormatterProps { | ||
amount: StringifiedBigInt | null | ||
|
@@ -36,7 +37,7 @@ export const AmountFormatter = memo( | |
}: AmountFormatterProps) => { | ||
const ticker = useSelector(selectTicker) | ||
const isUsingBaseUnits = amountUnit === 'baseUnits' | ||
if (amount == null) return <>-</> | ||
if (amount == null) return <span>-</span> | ||
|
||
const formatter = isUsingBaseUnits ? formatBaseUnitsAsRose : formatWeiAsWrose | ||
const amountString = formatter(amount, { | ||
|
@@ -55,11 +56,10 @@ export const AmountFormatter = memo( | |
|
||
return ( | ||
<span> | ||
{amountString} | ||
<span>{amountString}</span> | ||
{!hideTicker && ( | ||
<Text size={size} {...tickerProps}> | ||
{' '} | ||
{ticker} | ||
<NoTranslate>{` ${ticker}`}</NoTranslate> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Added, tho I found ticker translation cute |
||
</Text> | ||
)} | ||
</span> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,7 @@ export const SidebarButton = ({ | |
gap="medium" | ||
justify={isMediumSize ? 'center' : 'start'} | ||
> | ||
{/* eslint-disable-next-line no-restricted-syntax -- icon is not a plain text node */} | ||
{icon} | ||
{!isMediumSize && <Text>{label}</Text>} | ||
</Box> | ||
|
@@ -224,21 +225,24 @@ const SidebarFooter = (props: SidebarFooterProps) => { | |
dropProps={{ align: { bottom: 'bottom', left: 'left' } }} | ||
items={languageLabels.map(([key, label]) => ({ label: label, onClick: () => setLanguage(key) }))} | ||
> | ||
<Box direction="row"> | ||
{size === 'medium' ? ( | ||
<Box pad="small"> | ||
<Language /> | ||
</Box> | ||
{size !== 'medium' && ( | ||
<> | ||
<Box pad="small" flex="grow"> | ||
<Text>Language</Text> | ||
</Box> | ||
<Box pad="small"> | ||
<FormDown /> | ||
</Box> | ||
</> | ||
)} | ||
</Box> | ||
) : ( | ||
<Box direction="row"> | ||
<Box pad="small"> | ||
<Language /> | ||
</Box> | ||
<Box pad="small" flex="grow"> | ||
{/* Intentionally not translated */} | ||
<Text>Language</Text> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing i18n label There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we want to keep this one international. Otherwise if someone gets into French, they can't get out |
||
</Box> | ||
<Box pad="small"> | ||
<FormDown /> | ||
</Box> | ||
</Box> | ||
)} | ||
</Menu> | ||
</Box> | ||
</SidebarTooltip> | ||
|
@@ -293,6 +297,7 @@ function SidebarMenuItems() { | |
{menu.home} | ||
{menu.wallet} | ||
{menu.stake} | ||
{/* eslint-disable-next-line no-restricted-syntax -- menu.paraTimes is not a plain text node */} | ||
{canAccessParaTimesRoute && menu.paraTimes} | ||
</Nav> | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably covers most potential issues, but there is a possibility of undetectable:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should later make a package out of it, and reuse it on explorer