Skip to content

Commit

Permalink
fix: fixup some ui (#12022)
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask authored Jan 6, 2025
1 parent 3f612d0 commit 067ef13
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback } from 'react'
import { useCallback, type HTMLProps } from 'react'
import {
CircularProgress,
type ListItemButtonProps,
Expand Down Expand Up @@ -44,7 +44,7 @@ const useStyles = makeStyles()(() => ({
},
}))

interface ToolboxHintProps {
interface ToolboxHintProps extends HTMLProps<HTMLDivElement> {
Container?: React.ComponentType<React.PropsWithChildren>
ListItemButton?: React.ComponentType<Pick<ListItemButtonProps, 'onClick' | 'children'>>
ListItemText?: React.ComponentType<Pick<ListItemTextProps, 'primary'>>
Expand All @@ -69,14 +69,15 @@ function ToolboxHintForApplication(props: ToolboxHintProps) {
iconSize = 24,
mini,
ListItemText = MuiListItemText,
...rest
} = props
const { classes } = useStyles()

const openApplicationBoardDialog = useOpenApplicationBoardDialog()

return (
<GuideStep step={1} total={4} tip={<Trans>Explore multi-chain dApps.</Trans>}>
<Container>
<Container {...rest}>
<ListItemButton onClick={openApplicationBoardDialog}>
<ListItemIcon>
<Icons.MaskBlue size={iconSize} />
Expand Down Expand Up @@ -113,6 +114,7 @@ function ToolboxHintForWallet(props: ToolboxHintProps) {
iconSize = 24,
badgeSize = 12,
mini,
...rest
} = props
const { classes } = useStyles()
const { onClickToolbox, title, chainColor, shouldDisplayChainIndicator, account, provider } = useToolbox()
Expand All @@ -121,7 +123,7 @@ function ToolboxHintForWallet(props: ToolboxHintProps) {

return (
<GuideStep step={2} total={4} tip={<Trans>Connect and switch between your wallets.</Trans>}>
<Container>
<Container {...rest}>
<ListItemButton onClick={onClickToolbox}>
<ListItemIcon>
{account && provider && provider.type !== ProviderType.MaskWallet ?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { CSSProperties } from 'react'
import { ToolboxHintUnstyled } from '../../../components/InjectedComponents/ToolboxUnstyled.js'
import { styled, ListItemButton, Typography, ListItemIcon, useMediaQuery } from '@mui/material'
import { styled, ListItemButton, Typography, ListItemIcon, useMediaQuery, useTheme } from '@mui/material'

const mindsBreakPoint = 1221 /** px */

Expand All @@ -12,15 +13,19 @@ const Item = styled(ListItemButton)`
border-radius: 8px;
height: 45px;
padding: 4px 12px 4px 0;
color: #43434d !important;
color: var(--nav-text-color, #43434d) !important;
&:hover {
background: unset;
color: #43434d;
color: var(--nav-text-color, #43434d);
}
[data-icon] {
color: #43434d;
--icon-color: #43434d;
}
[data-icon='Wallet'] {
color: var(--nav-text-color, #43434d);
--icon-color: var(--nav-text-color, #43434d);
}
@media screen and (max-width: ${mindsBreakPoint}px) {
padding: 12px 0;
justify-content: center;
Expand All @@ -47,9 +52,15 @@ const Icon = styled(ListItemIcon)`

export function ToolboxHintAtMinds(props: { category: 'wallet' | 'application' }) {
const mini = useMediaQuery(`(max-width: ${mindsBreakPoint}px)`)
const theme = useTheme()

return (
<ToolboxHintUnstyled
style={
{
'--nav-text-color': theme.palette.mode === 'dark' ? '#fff' : '#43434d',
} as CSSProperties
}
mini={mini}
Container={Container}
ListItemButton={Item}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export const ConnectedAccounts = memo<ConnectedAccountsProps>(function ({
height="58px"
className={classes.connectedAccounts}
width="100%">
{profiles?.slice(0, 2).map((profile, index) => {
{profiles?.slice(0, 2).map((profile) => {
return (
<AccountRender
key={index}
key={profile.identity}
profile={profile}
avatar={localProfile?.userId === (profile.name ?? profile.identity) ? avatar : ''}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const SocialAccount = memo<SocialAccountProps>(function SocialAccount({ a
const isOnTwitter = site === EnhanceableSite.Twitter
const { data: twitterAvatar = avatar } = useQuery({
enabled: isOnTwitter && !avatar,
queryKey: ['social-account-avatar', site, avatar],
queryKey: ['social-account-avatar', site, avatar, userId],
queryFn: async () => {
const userInfo = await FireflyTwitter.getUserInfo(userId)
return userInfo?.legacy.profile_image_url_https
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/Avatar/src/Application/NFTListDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function NFTListDialog() {
const handleAddCollectibles = useCallback(async () => {
const results = await AddCollectiblesModal.openAndWaitForClose({
pluginID,
chainId: assetChainId,
chainId: assetChainId || chainId,
account: targetAccount,
})
if (!results || !assetChainId) return
Expand Down Expand Up @@ -162,7 +162,7 @@ export function NFTListDialog() {
setTokens((originalTokens) => {
return uniqBy([...originalTokens, ...tokens], (x) => `${x.contract?.address}.${x.tokenId}`)
})
}, [pluginID, assetChainId, targetAccount])
}, [pluginID, assetChainId, chainId, targetAccount])

useEffect(() => {
const unsubscribe = emitter.on('add', handleAddCollectibles)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const useStyles = makeStyles()((theme) => ({
gridTemplateColumns: 'repeat(auto-fill, minmax(20%, 1fr))',
},
sidebar: {
marginLeft: theme.spacing(1),
paddingLeft: 12,
paddingTop: 12,
paddingRight: 4,
},
form: {
flexGrow: 1,
Expand All @@ -41,14 +43,19 @@ export const AddCollectiblesDialog = memo(function AddCollectiblesDialog({
const allNetworks = useNetworks(pluginID, true)

return (
<InjectedDialog titleBarIconStyle={'back'} open={open} onClose={() => onAdd()} title={<Trans>Add NFTs</Trans>}>
<InjectedDialog
titleBarIconStyle={'back'}
open={open}
onClose={() => onAdd()}
title={<Trans>Add Collectibles</Trans>}>
<DialogContent classes={{ root: classes.content }}>
<SelectNetworkSidebar
className={classes.sidebar}
chainId={chainId}
onChainChange={setChainId}
pluginID={pluginID}
networks={allNetworks}
hideAllButton
/>
<AddCollectibles
className={classes.form}
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/locale/en-US.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/shared/src/locale/en-US.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/shared/src/locale/ja-JP.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/shared/src/locale/ja-JP.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/shared/src/locale/ko-KR.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/shared/src/locale/ko-KR.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/shared/src/locale/zh-CN.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/shared/src/locale/zh-CN.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/shared/src/locale/zh-TW.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/shared/src/locale/zh-TW.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 067ef13

Please sign in to comment.