2021-08-06 00:17:05 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
|
|
|
|
import enMessages from '../../_locales/en/messages.json';
|
|
|
|
import { AvatarColors } from '../types/Colors';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { PropsType } from './BetterAvatarBubble';
|
|
|
|
import { BetterAvatarBubble } from './BetterAvatarBubble';
|
2021-09-18 00:30:08 +00:00
|
|
|
import { setupI18n } from '../util/setupI18n';
|
2021-08-06 00:17:05 +00:00
|
|
|
|
|
|
|
const i18n = setupI18n('en', enMessages);
|
|
|
|
|
|
|
|
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
|
|
|
children: overrideProps.children,
|
|
|
|
color: overrideProps.color,
|
|
|
|
i18n,
|
|
|
|
isSelected: Boolean(overrideProps.isSelected),
|
|
|
|
onDelete: action('onDelete'),
|
|
|
|
onSelect: action('onSelect'),
|
|
|
|
style: overrideProps.style,
|
|
|
|
});
|
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export default {
|
|
|
|
title: 'Components/BetterAvatarBubble',
|
|
|
|
};
|
2021-08-06 00:17:05 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const Children = (): JSX.Element => (
|
2021-08-06 00:17:05 +00:00
|
|
|
<BetterAvatarBubble
|
|
|
|
{...createProps({
|
|
|
|
children: <div>HI</div>,
|
|
|
|
color: AvatarColors[8],
|
|
|
|
})}
|
|
|
|
/>
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|
2021-08-06 00:17:05 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const Selected = (): JSX.Element => (
|
2021-08-06 00:17:05 +00:00
|
|
|
<BetterAvatarBubble
|
|
|
|
{...createProps({
|
|
|
|
color: AvatarColors[1],
|
|
|
|
isSelected: true,
|
|
|
|
})}
|
|
|
|
/>
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|
2021-08-06 00:17:05 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const Style = (): JSX.Element => (
|
2021-08-06 00:17:05 +00:00
|
|
|
<BetterAvatarBubble
|
|
|
|
{...createProps({
|
|
|
|
style: {
|
|
|
|
height: 120,
|
|
|
|
width: 120,
|
|
|
|
},
|
|
|
|
color: AvatarColors[2],
|
|
|
|
})}
|
|
|
|
/>
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|