Skip to content

Commit

Permalink
icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminaAiren committed Jan 17, 2024
1 parent 17366d9 commit 78a8e44
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 32 deletions.
8 changes: 8 additions & 0 deletions icons/user_op.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions lib/hooks/useNavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ export default function useNavItems(): ReturnType {
const userOps: NavItem | null = config.features.userOps.isEnabled ? {
text: 'User operations',
nextRoute: { pathname: '/ops' as const },
// change!!!
icon: 'top-accounts',
icon: 'user_op',
isActive: pathname === '/ops' || pathname === '/op/[hash]',
} : null;

Expand Down
1 change: 1 addition & 0 deletions public/icons/name.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
| "txn_batches"
| "unfinalized"
| "uniswap"
| "user_op"
| "verified_token"
| "verified"
| "verify-contract"
Expand Down
32 changes: 16 additions & 16 deletions ui/shared/entities/userOp/UserOpEntity.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ import TestApp from 'playwright/TestApp';
import UserOpEntity from './UserOpEntity';

const hash = '0x376db52955d5bce114d0ccea2dcf22289b4eae1b86bcae5a59bb5fdbfef48899';
// const iconSizes = [ 'md', 'lg' ];
const iconSizes = [ 'md', 'lg' ];

test.use({ viewport: { width: 180, height: 30 } });

// test.describe('icon size', () => {
// iconSizes.forEach((size) => {
// test(size, async({ mount }) => {
// const component = await mount(
// <TestApp>
// <TxEntity
// hash={ hash }
// iconSize={ size }
// />
// </TestApp>,
// );
test.describe('icon size', () => {
iconSizes.forEach((size) => {
test(size, async({ mount }) => {
const component = await mount(
<TestApp>
<UserOpEntity
hash={ hash }
iconSize={ size }
/>
</TestApp>,
);

// await expect(component).toHaveScreenshot();
// });
// });
// });
await expect(component).toHaveScreenshot();
});
});
});

test('loading', async({ mount }) => {
const component = await mount(
Expand Down
29 changes: 15 additions & 14 deletions ui/shared/entities/userOp/UserOpEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ const Link = chakra((props: LinkProps) => {
);
});

// type IconProps = Omit<EntityBase.IconBaseProps, 'name'> & {
// name?: EntityBase.IconBaseProps['name'];
// };

// const Icon = (props: IconProps) => {
// return (
// <EntityBase.Icon
// { ...props }
// name={ props.name ?? 'transactions_slim' }
// />
// );
// };
type IconProps = Omit<EntityBase.IconBaseProps, 'name'> & {
name?: EntityBase.IconBaseProps['name'];
};

const Icon = (props: IconProps) => {
return (
<EntityBase.Icon
{ ...props }
// change to slim!!
name={ props.name ?? 'user_op' }
/>
);
};

type ContentProps = Omit<EntityBase.ContentBaseProps, 'text'> & Pick<EntityProps, 'hash'>;

Expand Down Expand Up @@ -70,7 +71,7 @@ const UserOpEntity = (props: EntityProps) => {

return (
<Container className={ props.className }>
{ /* <Icon { ...partsProps }/> */ }
<Icon { ...partsProps }/>
<Link { ...linkProps }>
<Content { ...partsProps }/>
</Link>
Expand All @@ -84,7 +85,7 @@ export default React.memo(chakra(UserOpEntity));
export {
Container,
Link,
// Icon,
Icon,
Content,
Copy,
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 78a8e44

Please sign in to comment.