Skip to content

Commit cf67975

Browse files
feat: improve tokenChain logo on deposit, and pusher adjustment
1 parent d99232f commit cf67975

File tree

12 files changed

+556
-1383
lines changed

12 files changed

+556
-1383
lines changed

examples/nextjs-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"@farcaster/frame-sdk": "^0.0.26",
1414
"@headlessui/react": "^2.2.0",
1515
"@rainbow-me/rainbowkit": "^2.2.8",
16-
"@rozoai/intent-common": "0.1.6-beta.1",
17-
"@rozoai/intent-pay": "0.1.5-beta.2",
16+
"@rozoai/intent-common": "workspace:*",
17+
"@rozoai/intent-pay": "workspace:*",
1818
"@tanstack/react-query": "^5.51.11",
1919
"@types/react-syntax-highlighter": "^15.5.13",
2020
"@wagmi/core": "^2.22.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "index.js",
77
"scripts": {
88
"build": "pnpm --filter @rozoai/intent-common build && pnpm --filter @rozoai/intent-pay build",
9-
"dev": "pnpm --concurrent --filter '@rozoai/*' dev",
9+
"dev": "pnpm -r --parallel --filter '@rozoai/*' dev",
1010
"dev:common": "pnpm --filter @rozoai/intent-common build --watch",
1111
"dev:pay": "pnpm --filter @rozoai/intent-pay dev",
1212
"dev:example": "pnpm --filter @rozoai/pay-nextjs-app-example dev",

packages/connectkit/bundle-analysis.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/connectkit/package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@albedo-link/intent": "^0.13.0",
4848
"@reown/appkit": "^1.7.0",
4949
"@rollup/plugin-typescript": "^12.1.2",
50-
"@rozoai/intent-common": "0.1.6-beta.1",
50+
"@rozoai/intent-common": "workspace:*",
5151
"@solana/spl-token": "^0.4.14",
5252
"@solana/wallet-adapter-base": "^0.9.27",
5353
"@solana/wallet-adapter-react": "^0.15.39",
@@ -80,18 +80,10 @@
8080
"peerDependenciesMeta": {
8181
"@worldcoin/minikit-js": {
8282
"optional": true
83-
},
84-
"@creit.tech/stellar-wallets-kit": {
85-
"optional": true
86-
},
87-
"@stellar/stellar-sdk": {
88-
"optional": true
8983
}
9084
},
9185
"devDependencies": {
92-
"@creit.tech/stellar-wallets-kit": "^1.9.5",
9386
"@rollup/plugin-json": "^6.1.0",
94-
"@stellar/stellar-sdk": "^14.2.0",
9587
"@types/node": "^20.14.12",
9688
"@types/qrcode": "^1.4.2",
9789
"@types/react": "^18.2.47",

packages/connectkit/src/components/Common/OptionsList/index.tsx

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export interface Option {
1919
title: string;
2020
subtitle?: string;
2121
icons: (React.ReactNode | string)[];
22+
rightIcons?: (React.ReactNode | string)[];
23+
iconsPosition?: "left" | "right";
2224
onClick: () => void;
2325
disabled?: boolean;
2426
}
@@ -131,9 +133,18 @@ const OptionItem = ({ option }: { option: Option }) => {
131133
return icon;
132134
});
133135

136+
const hydratedRightIcons =
137+
option.rightIcons?.map((icon, index) => {
138+
if (typeof icon === "string") {
139+
return <img key={`${option.id}-right-${index}`} src={icon} alt="" />;
140+
}
141+
return icon;
142+
}) || [];
143+
144+
const iconsPosition = option.iconsPosition || "right";
134145
const iconContent = (() => {
135146
return (
136-
<IconStackContainer>
147+
<IconStackContainer $position={iconsPosition}>
137148
{hydratedIcons.map((icon, index) => (
138149
<IconStackItem
139150
key={index}
@@ -147,22 +158,51 @@ const OptionItem = ({ option }: { option: Option }) => {
147158
);
148159
})();
149160

161+
const rightIconContent =
162+
hydratedRightIcons.length > 0 ? (
163+
<RightIconStackContainer>
164+
{hydratedRightIcons.map((icon, index) => (
165+
<RightIconStackItem
166+
key={index}
167+
$marginRight={index !== hydratedRightIcons.length - 1 ? -8 : 0}
168+
$zIndex={hydratedRightIcons.length - index}
169+
>
170+
{icon}
171+
</RightIconStackItem>
172+
))}
173+
</RightIconStackContainer>
174+
) : null;
175+
150176
return (
151177
<OptionButton
152178
type="button"
153179
onClick={option.onClick}
154180
disabled={option.disabled}
155181
>
156182
{iconContent}
157-
<OptionLabel>
183+
<OptionLabel
184+
$hasRightIcons={hydratedRightIcons.length > 0}
185+
$iconsPosition={iconsPosition}
186+
>
158187
<OptionTitle>{option.title}</OptionTitle>
159188
{option.subtitle && <OptionSubtitle>{option.subtitle}</OptionSubtitle>}
160189
</OptionLabel>
190+
{rightIconContent}
161191
</OptionButton>
162192
);
163193
};
164194

165-
const IconStackContainer = styled(motion.div)`
195+
const IconStackContainer = styled(motion.div)<{
196+
$position?: "left" | "right";
197+
}>`
198+
position: absolute;
199+
${(props) => (props.$position === "left" ? "left: 20px;" : "right: 20px;")}
200+
display: flex;
201+
align-items: center;
202+
justify-content: center;
203+
`;
204+
205+
const RightIconStackContainer = styled(motion.div)`
166206
position: absolute;
167207
right: 20px;
168208
display: flex;
@@ -196,3 +236,30 @@ const IconStackItem = styled(motion.div)<{
196236
}
197237
border-radius: 22.5%;
198238
`;
239+
240+
const RightIconStackItem = styled(motion.div)<{
241+
$marginRight?: number;
242+
$zIndex?: number;
243+
}>`
244+
display: block;
245+
overflow: hidden;
246+
user-select: none;
247+
display: flex;
248+
align-items: center;
249+
justify-content: center;
250+
margin-right: ${(props) => props.$marginRight || 0}px;
251+
z-index: ${(props) => props.$zIndex || 2};
252+
width: 24px;
253+
height: 24px;
254+
overflow: hidden;
255+
svg,
256+
img {
257+
display: block;
258+
position: relative;
259+
pointer-events: none;
260+
overflow: hidden;
261+
width: 100%;
262+
height: 100%;
263+
}
264+
border-radius: 22.5%;
265+
`;

packages/connectkit/src/components/Common/OptionsList/styles.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,23 @@ export const OptionButton = styled(motion.button)`
9999
}
100100
`;
101101

102-
export const OptionLabel = styled(motion.span)`
102+
export const OptionLabel = styled(motion.span)<{
103+
$hasRightIcons?: boolean;
104+
$iconsPosition?: "left" | "right";
105+
}>`
103106
display: flex;
104107
flex-direction: column;
105108
align-items: flex-start;
106109
gap: 2px;
107110
width: 100%;
108111
overflow: hidden;
109112
padding: 2px 0;
110-
padding-right: 38px;
113+
padding-left: ${(props) => (props.$iconsPosition === "left" ? "42px" : "0")};
114+
padding-right: ${(props) => {
115+
if (props.$hasRightIcons) return "38px";
116+
if (props.$iconsPosition === "right") return "38px";
117+
return "0";
118+
}};
111119
`;
112120

113121
export const OptionTitle = styled(motion.span)`

0 commit comments

Comments
 (0)