Skip to content

Commit 4553d61

Browse files
Merge pull request #54 from make-software/CLICK-987
fixed ActivityFeedItem avatar's size
2 parents aca7bb3 + 185d8d9 commit 4553d61

5 files changed

Lines changed: 29 additions & 26 deletions

File tree

dist/cspr-design.es.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,17 +1263,14 @@ const p1 = (e, o, g = 20, C = 5) => {
12631263
big: "contentQuaternary"
12641264
};
12651265
return o[e] || o.default;
1266-
}, il = (e = "default") => {
1267-
const o = {
1268-
tiny: 0,
1269-
small: 0,
1270-
default: 4,
1271-
average: 4,
1272-
medium: 4,
1273-
big: 0
1274-
};
1275-
return o[e] || o.default;
1276-
}, ha = be.div.withConfig({
1266+
}, il = (e = "default") => ({
1267+
tiny: 0,
1268+
small: 0,
1269+
default: 4,
1270+
average: 4,
1271+
medium: 4,
1272+
big: 0
1273+
})[e], ha = be.div.withConfig({
12771274
displayName: "avatar__BackgroundWrapper",
12781275
componentId: "sc-1p1ar3a-0"
12791276
})(({
@@ -43654,15 +43651,16 @@ const Kw = {
4365443651
] });
4365543652
}, Hc = ({
4365643653
publicKey: e,
43657-
prefix: o
43654+
prefix: o,
43655+
avatarSize: g
4365843656
}) => {
4365943657
const {
43660-
getAccountInfo: g,
43661-
csprLiveDomainPath: C
43662-
} = br(), P = yn(["small", "default"], []), x = g(e), r = lo(x?.account_info || x?.centralized_account_info), c = x?.account_info?.info?.owner?.name;
43658+
getAccountInfo: C,
43659+
csprLiveDomainPath: P
43660+
} = br(), x = g ?? yn(["small", "default"], []), r = C(e), c = lo(r?.account_info || r?.centralized_account_info), n = r?.account_info?.info?.owner?.name;
4366343661
return e ? /* @__PURE__ */ Pe(Pt, { children: [
4366443662
/* @__PURE__ */ $(Oe, { size: 3, variation: "darkGray", children: o }),
43665-
/* @__PURE__ */ $(Dn, { logo: r && r?.logo, name: c, hash: e, loading: !e, navigateToPath: `${C}/account/${e}`, avatarSize: P, hashFontSize: "sm", minifiedCopyNotification: !0 })
43663+
/* @__PURE__ */ $(Dn, { logo: c && c?.logo, name: n, hash: e, loading: !e, navigateToPath: `${P}/account/${e}`, avatarSize: x, hashFontSize: "sm", minifiedCopyNotification: !0 })
4366643664
] }) : null;
4366743665
}, Xw = ({
4366843666
deploy: e
@@ -43699,8 +43697,8 @@ const Kw = {
4369943697
return /* @__PURE__ */ Pe(je, { align: "center", gap: 8, children: [
4370043698
/* @__PURE__ */ $(Oe, { size: 3, monotype: !0, variation: "black", children: kd[g?.name || ""] }),
4370143699
P && /* @__PURE__ */ $(ua, { amount: P, rate: o }),
43702-
/* @__PURE__ */ $(Hc, { publicKey: C.validator?.parsed, prefix: x }),
43703-
/* @__PURE__ */ $(Hc, { publicKey: C.new_validator?.parsed, prefix: "to" })
43700+
/* @__PURE__ */ $(Hc, { publicKey: C.validator?.parsed, prefix: x, avatarSize: "small" }),
43701+
/* @__PURE__ */ $(Hc, { publicKey: C.new_validator?.parsed, prefix: "to", avatarSize: "small" })
4370443702
] });
4370543703
}, eC = ({
4370643704
deploy: e

dist/cspr-design.umd.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib/components/deploy-actions/components/DeployActionAuction.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/avatar/avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const getMargin = (size: string = 'default') => {
7575
big: 0,
7676
};
7777

78-
return marginMap[size] || marginMap.default;
78+
return marginMap[size];
7979
};
8080

8181
export const BackgroundWrapper = styled.div<{

src/lib/components/deploy-actions/components/DeployActionAuction.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import CsprAmountWithFiat from '../../cspr-amount-with-fiat/cspr-amount-with-fia
66
import { useDeployActionDataContext } from '../services/deploy-action-context';
77
import {AuctionContractIcon} from '../../../icons-index';
88
import FlexRow from '../../flex-row/flex-row';
9-
import Avatar from '../../avatar/avatar';
9+
import Avatar, { AvatarProps } from '../../avatar/avatar';
1010
import BodyText from '../../body-text/body-text';
1111
import Link from '../../link/link';
1212
import { AccountInfoResult, Deploy } from '../../../types/types';
@@ -49,9 +49,12 @@ const AuctionContractIdentifier = ({
4949
);
5050
};
5151

52-
const ValidatorAccountInfo = ({ publicKey, prefix }) => {
52+
const ValidatorAccountInfo = ({ publicKey, prefix, avatarSize }) => {
5353
const { getAccountInfo, csprLiveDomainPath } = useDeployActionDataContext();
54-
const avatarSize = useMatchMedia(['small', 'default'], []);
54+
const accountAvatarSize: AvatarProps['size'] =
55+
avatarSize == undefined
56+
? useMatchMedia(['small', 'default'], [])
57+
: avatarSize;
5558

5659
const accountInfo = getAccountInfo<AccountInfoResult>(publicKey);
5760
const validatorLogo = deriveAccountInfo(
@@ -70,7 +73,7 @@ const ValidatorAccountInfo = ({ publicKey, prefix }) => {
7073
hash={publicKey}
7174
loading={!publicKey}
7275
navigateToPath={`${csprLiveDomainPath}/account/${publicKey}`}
73-
avatarSize={avatarSize}
76+
avatarSize={accountAvatarSize}
7477
hashFontSize={'sm'}
7578
minifiedCopyNotification
7679
/>
@@ -143,10 +146,12 @@ const DelegationAuctionAction = ({ deploy }: { deploy: Deploy }) => {
143146
<ValidatorAccountInfo
144147
publicKey={args.validator?.parsed as string}
145148
prefix={initialValidatorPrefix}
149+
avatarSize={'small'}
146150
/>
147151
<ValidatorAccountInfo
148152
publicKey={args.new_validator?.parsed as string}
149153
prefix={'to'}
154+
avatarSize={'small'}
150155
/>
151156
</FlexRow>
152157
);

0 commit comments

Comments
 (0)