Hide account list in sensitive collections (#38081)
This commit is contained in:
1 parent
0f37901955
commit
3557be5d4d
9 files changed
+267
-62
No files matched your search
@@ -50,6 +50,10 @@ const meta = {
|
||||
type: 'boolean',
|
||||
description: 'Whether to display the account menu or not',
|
||||
},
|
||||
withBorder: {
|
||||
type: 'boolean',
|
||||
description: 'Whether to display the bottom border or not',
|
||||
},
|
||||
},
|
||||
args: {
|
||||
name: 'Test User',
|
||||
@@ -60,6 +64,7 @@ const meta = {
|
||||
defaultAction: 'mute',
|
||||
withBio: false,
|
||||
withMenu: true,
|
||||
withBorder: true,
|
||||
},
|
||||
parameters: {
|
||||
state: {
|
||||
@@ -103,6 +108,12 @@ export const NoMenu: Story = {
|
||||
},
|
||||
};
|
||||
|
||||
export const NoBorder: Story = {
|
||||
args: {
|
||||
withBorder: false,
|
||||
},
|
||||
};
|
||||
|
||||
export const Blocked: Story = {
|
||||
args: {
|
||||
defaultAction: 'block',
|
||||
|
||||
@@ -73,6 +73,7 @@ interface AccountProps {
|
||||
defaultAction?: 'block' | 'mute';
|
||||
withBio?: boolean;
|
||||
withMenu?: boolean;
|
||||
withBorder?: boolean;
|
||||
extraAccountInfo?: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
@@ -85,6 +86,7 @@ export const Account: React.FC<AccountProps> = ({
|
||||
defaultAction,
|
||||
withBio,
|
||||
withMenu = true,
|
||||
withBorder = true,
|
||||
extraAccountInfo,
|
||||
children,
|
||||
}) => {
|
||||
@@ -290,6 +292,7 @@ export const Account: React.FC<AccountProps> = ({
|
||||
<div
|
||||
className={classNames('account', {
|
||||
'account--minimal': minimal,
|
||||
'account--without-border': !withBorder,
|
||||
})}
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -36,7 +36,7 @@ export const ItemList = forwardRef<
|
||||
emptyMessage?: React.ReactNode;
|
||||
}
|
||||
>(({ isLoading, emptyMessage, className, children, ...otherProps }, ref) => {
|
||||
if (Children.count(children) === 0 && emptyMessage) {
|
||||
if (!isLoading && Children.count(children) === 0 && emptyMessage) {
|
||||
return <div className='empty-column-indicator'>{emptyMessage}</div>;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user