Skip to content

Commit

Permalink
fix: update validators mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
akhlopiachyi committed Jan 19, 2024
1 parent c601e1c commit ccee242
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web-coreum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-coreum",
"version": "2.19.3-72",
"version": "2.19.3-73",
"license": "Apache-2.0",
"private": true,
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface AvatarName {
image?: React.ReactNode;
target?: JSX.IntrinsicElements['a']['target'];
shorten?: boolean;
isMobile?: boolean;
}

type Transactions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports[`component: AvatarName matches snapshot 1`] = `
-webkit-flex-flow: row nowrap;
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
word-break: break-all;
}
.emotion-0:hover {
Expand Down Expand Up @@ -91,6 +92,7 @@ exports[`component: AvatarName matches snapshot with imageUrl 1`] = `
-webkit-flex-flow: row nowrap;
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
word-break: break-all;
}
.emotion-0:hover {
Expand Down
16 changes: 16 additions & 0 deletions packages/ui/src/components/avatar_name/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,26 @@ const AvatarName: FC<AvatarName & JSX.IntrinsicElements['div']> = ({
image,
target,
shorten,
isMobile,
...props
}) => {
const { classes, cx } = useStyles();

if (isMobile) {
return (
<Link shallow href={href(address)} target={target}>
<span className={cx(classes.root, className)} {...props}>
<Avatar className={classes.avatar} address={address} imageUrl={imageUrl ?? undefined} />
{/* <MiddleEllipsis className={classes.text} content={name} /> */}

<Typography variant="body1" className={shorten ? classes.short : undefined}>
{name}
</Typography>
</span>
</Link>
);
}

return (
<Tooltip
TransitionComponent={Zoom}
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/avatar_name/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const useStyles = makeStyles()((theme) => ({
justifyContent: 'flex-start',
gap: theme.spacing(1),
flexFlow: 'row nowrap',
wordBreak: 'break-all',

'&:hover': {
cursor: 'pointer',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ListItem: FC<ListItemProps> = ({ index, style, setRowHeight, item, isLast,
const votingPower = numeral(item.votingPower).format('0,0');
const selectedItem = {
idx: `#${i + 1}`,
validator: <AvatarName address={address} imageUrl={imageUrl} name={name} />,
validator: <AvatarName address={address} imageUrl={imageUrl} name={name} isMobile />,
commission: `${numeral(item.commission).format('0.[00]')}%`,
condition: <Condition className={condition} />,
votingPower: (
Expand Down

0 comments on commit ccee242

Please sign in to comment.