Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions dist/cspr-design.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1263,17 +1263,14 @@ const p1 = (e, o, g = 20, C = 5) => {
big: "contentQuaternary"
};
return o[e] || o.default;
}, il = (e = "default") => {
const o = {
tiny: 0,
small: 0,
default: 4,
average: 4,
medium: 4,
big: 0
};
return o[e] || o.default;
}, ha = be.div.withConfig({
}, il = (e = "default") => ({
tiny: 0,
small: 0,
default: 4,
average: 4,
medium: 4,
big: 0
})[e], ha = be.div.withConfig({
displayName: "avatar__BackgroundWrapper",
componentId: "sc-1p1ar3a-0"
})(({
Expand Down Expand Up @@ -43654,15 +43651,16 @@ const Kw = {
] });
}, Hc = ({
publicKey: e,
prefix: o
prefix: o,
avatarSize: g
}) => {
const {
getAccountInfo: g,
csprLiveDomainPath: C
} = br(), P = yn(["small", "default"], []), x = g(e), r = lo(x?.account_info || x?.centralized_account_info), c = x?.account_info?.info?.owner?.name;
getAccountInfo: C,
csprLiveDomainPath: P
} = 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;
return e ? /* @__PURE__ */ Pe(Pt, { children: [
/* @__PURE__ */ $(Oe, { size: 3, variation: "darkGray", children: o }),
/* @__PURE__ */ $(Dn, { logo: r && r?.logo, name: c, hash: e, loading: !e, navigateToPath: `${C}/account/${e}`, avatarSize: P, hashFontSize: "sm", minifiedCopyNotification: !0 })
/* @__PURE__ */ $(Dn, { logo: c && c?.logo, name: n, hash: e, loading: !e, navigateToPath: `${P}/account/${e}`, avatarSize: x, hashFontSize: "sm", minifiedCopyNotification: !0 })
] }) : null;
}, Xw = ({
deploy: e
Expand Down Expand Up @@ -43699,8 +43697,8 @@ const Kw = {
return /* @__PURE__ */ Pe(je, { align: "center", gap: 8, children: [
/* @__PURE__ */ $(Oe, { size: 3, monotype: !0, variation: "black", children: kd[g?.name || ""] }),
P && /* @__PURE__ */ $(ua, { amount: P, rate: o }),
/* @__PURE__ */ $(Hc, { publicKey: C.validator?.parsed, prefix: x }),
/* @__PURE__ */ $(Hc, { publicKey: C.new_validator?.parsed, prefix: "to" })
/* @__PURE__ */ $(Hc, { publicKey: C.validator?.parsed, prefix: x, avatarSize: "small" }),
/* @__PURE__ */ $(Hc, { publicKey: C.new_validator?.parsed, prefix: "to", avatarSize: "small" })
] });
}, eC = ({
deploy: e
Expand Down
4 changes: 2 additions & 2 deletions dist/cspr-design.umd.js

Large diffs are not rendered by default.

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

2 changes: 1 addition & 1 deletion src/lib/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const getMargin = (size: string = 'default') => {
big: 0,
};

return marginMap[size] || marginMap.default;
return marginMap[size];
};

export const BackgroundWrapper = styled.div<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import CsprAmountWithFiat from '../../cspr-amount-with-fiat/cspr-amount-with-fia
import { useDeployActionDataContext } from '../services/deploy-action-context';
import {AuctionContractIcon} from '../../../icons-index';
import FlexRow from '../../flex-row/flex-row';
import Avatar from '../../avatar/avatar';
import Avatar, { AvatarProps } from '../../avatar/avatar';
import BodyText from '../../body-text/body-text';
import Link from '../../link/link';
import { AccountInfoResult, Deploy } from '../../../types/types';
Expand Down Expand Up @@ -49,9 +49,12 @@ const AuctionContractIdentifier = ({
);
};

const ValidatorAccountInfo = ({ publicKey, prefix }) => {
const ValidatorAccountInfo = ({ publicKey, prefix, avatarSize }) => {
const { getAccountInfo, csprLiveDomainPath } = useDeployActionDataContext();
const avatarSize = useMatchMedia(['small', 'default'], []);
const accountAvatarSize: AvatarProps['size'] =
avatarSize == undefined
? useMatchMedia(['small', 'default'], [])
: avatarSize;

const accountInfo = getAccountInfo<AccountInfoResult>(publicKey);
const validatorLogo = deriveAccountInfo(
Expand All @@ -70,7 +73,7 @@ const ValidatorAccountInfo = ({ publicKey, prefix }) => {
hash={publicKey}
loading={!publicKey}
navigateToPath={`${csprLiveDomainPath}/account/${publicKey}`}
avatarSize={avatarSize}
avatarSize={accountAvatarSize}
hashFontSize={'sm'}
minifiedCopyNotification
/>
Expand Down Expand Up @@ -143,10 +146,12 @@ const DelegationAuctionAction = ({ deploy }: { deploy: Deploy }) => {
<ValidatorAccountInfo
publicKey={args.validator?.parsed as string}
prefix={initialValidatorPrefix}
avatarSize={'small'}
/>
<ValidatorAccountInfo
publicKey={args.new_validator?.parsed as string}
prefix={'to'}
avatarSize={'small'}
/>
</FlexRow>
);
Expand Down
Loading