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
4 changes: 4 additions & 0 deletions dist/cspr-design.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,7 @@ const g1 = (e, o, g = 20, C = 5) => {
small: 2,
default: 2,
average: 4,
semiMedium: 4,
medium: 12,
big: 12
};
Expand All @@ -1249,6 +1250,7 @@ const g1 = (e, o, g = 20, C = 5) => {
small: 20,
average: 28,
default: 32,
semiMedium: 56,
medium: 80,
big: 124
};
Expand All @@ -1259,6 +1261,7 @@ const g1 = (e, o, g = 20, C = 5) => {
small: "contentTertiary",
default: "contentQuaternary",
average: "contentQuaternary",
semiMedium: "contentQuaternary",
medium: "contentQuaternary",
big: "contentQuaternary"
};
Expand All @@ -1268,6 +1271,7 @@ const g1 = (e, o, g = 20, C = 5) => {
small: 0,
default: 4,
average: 4,
semiMedium: 4,
medium: 4,
big: 0
})[e], ma = be.div.withConfig({
Expand Down
2 changes: 1 addition & 1 deletion dist/cspr-design.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/components/avatar/avatar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export declare const isValidAccountHash: (accountHash?: string | null) => accoun
export interface AvatarProps<T = any> {
hash?: string | null;
src?: string | null;
size?: 'default' | 'big' | 'average' | 'medium' | 'small' | 'tiny';
size?: 'default' | 'big' | 'average' | 'semiMedium' | 'medium' | 'small' | 'tiny';
loading?: boolean;
transparentBg?: boolean;
[key: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/components/avatar/avatar.d.ts.map

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

10 changes: 9 additions & 1 deletion src/lib/components/avatar/avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ const meta = {
control: { type: 'text' },
},
size: {
options: ['tiny', 'small', 'default', 'average', 'medium', 'big'],
options: [
'tiny',
'small',
'default',
'semiMedium',
'average',
'medium',
'big',
],
control: { type: 'radio' },
},
loading: {
Expand Down
15 changes: 13 additions & 2 deletions src/lib/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';
import SvgIcon from '../svg-icon/svg-icon';
import { getImageProxyUrl } from '../../utils/cache-asset';
import Identicon from '../identicon/identicon.tsx';
import { Erc20AvatarIcon, HashIcon } from '../../icons-index.ts';
import { HashIcon } from '../../icons-index.ts';
import Skeleton from 'react-loading-skeleton';

export const isValidAccountHash = (
Expand All @@ -20,7 +20,14 @@ export const isValidAccountHash = (
export interface AvatarProps<T = any> {
hash?: string | null;
src?: string | null;
size?: 'default' | 'big' | 'average' | 'medium' | 'small' | 'tiny';
size?:
| 'default'
| 'big'
| 'average'
| 'semiMedium'
| 'medium'
| 'small'
| 'tiny';
loading?: boolean;
transparentBg?: boolean;
[key: string]: any;
Expand All @@ -32,6 +39,7 @@ const getCornerRadius = (size: string = 'default') => {
small: 2,
default: 2,
average: 4,
semiMedium: 4,
medium: 12,
big: 12,
};
Expand All @@ -45,6 +53,7 @@ const getSize = (size: string = 'default'): number => {
small: 20,
average: 28,
default: 32,
semiMedium: 56,
medium: 80,
big: 124,
};
Expand All @@ -58,6 +67,7 @@ const getBgColor = (size: string = 'default') => {
small: 'contentTertiary',
default: 'contentQuaternary',
average: 'contentQuaternary',
semiMedium: 'contentQuaternary',
medium: 'contentQuaternary',
big: 'contentQuaternary',
};
Expand All @@ -71,6 +81,7 @@ const getMargin = (size: string = 'default') => {
small: 0,
default: 4,
average: 4,
semiMedium: 4,
medium: 4,
big: 0,
};
Expand Down
Loading