Skip to content

Commit

Permalink
feat(StackingGroup): use Avatar's text style for moreItems text (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoskolodny authored Nov 28, 2024
1 parent 5ed1ae3 commit e45e47c
Show file tree
Hide file tree
Showing 24 changed files with 5 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type AvatarProps = {
/**
* Not using TextPresets here because we don't want to scale the avatar text with the device settings
*/
const renderText = (size: number, text: string): JSX.Element | null => {
export const renderText = (size: number, text: string): JSX.Element | null => {
if (!text) {
return null;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 4 additions & 7 deletions src/stacking-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import * as React from 'react';
import {useIsInverseOrMediaVariant} from './theme-variant-context';
import {vars} from './skins/skin-contract.css';
import Inline from './inline';
import {Text4} from './text';
import * as styles from './stacking-group.css';
import * as mediaStyles from './image.css';
import {applyCssVars} from './utils/css';
import {renderText} from './avatar';

type Props = {
stacked?: boolean;
Expand All @@ -31,6 +31,7 @@ const StackingGroup = ({
const size = moreItemsStyle.size;

const borderRadius = moreItemsStyle.type === 'circle' ? '50%' : vars.borderRadii.mediaSmall;
const textColor = isInverse ? vars.colors.textPrimaryInverse : vars.colors.textBrand;

return (
<div
Expand All @@ -49,17 +50,13 @@ const StackingGroup = ({
style={{
width: size,
height: size,
color: textColor,
borderRadius,
backgroundColor: isInverse ? vars.colors.brandHigh : vars.colors.brandLow,
border: stacked ? `1px solid ${vars.colors.borderLow}` : 'none',
}}
>
<Text4
regular
color={isInverse ? vars.colors.textPrimaryInverse : vars.colors.textBrand}
>
{'+' + moreItemsCount}
</Text4>
{renderText(size, `+${moreItemsCount}`)}
</div>
)}
</Inline>
Expand Down

1 comment on commit e45e47c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-78s4r0fm7-flows-projects-65bb050e.vercel.app

Built with commit e45e47c.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.