Commit 1822bf68 authored by tom's avatar tom

fix skeleton for dynamicaly truncated strings

parent b51bbe4a
declare module 'react-identicons' declare module 'react-identicons';
declare module 'use-font-face-observer';
...@@ -13,7 +13,9 @@ export const recipe = defineRecipe({ ...@@ -13,7 +13,9 @@ export const recipe = defineRecipe({
color: 'transparent', color: 'transparent',
pointerEvents: 'none', pointerEvents: 'none',
userSelect: 'none', userSelect: 'none',
flexShrink: '0', // we have to override the property set by chakra in order to make the skeleton shrink
// when the text is too long
flexShrink: 'initial',
'&::before, &::after, *': { '&::before, &::after, *': {
visibility: 'hidden', visibility: 'hidden',
}, },
......
...@@ -28,7 +28,6 @@ interface Props { ...@@ -28,7 +28,6 @@ interface Props {
as?: React.ElementType; as?: React.ElementType;
} }
// TODO @tom2drum fix truncation when loading
const HashStringShortenDynamic = ({ hash, fontWeight = '400', isTooltipDisabled, tailLength = TAIL_LENGTH, as = 'span' }: Props) => { const HashStringShortenDynamic = ({ hash, fontWeight = '400', isTooltipDisabled, tailLength = TAIL_LENGTH, as = 'span' }: Props) => {
const elementRef = useRef<HTMLSpanElement>(null); const elementRef = useRef<HTMLSpanElement>(null);
const [ displayedString, setDisplayedString ] = React.useState(hash); const [ displayedString, setDisplayedString ] = React.useState(hash);
......
...@@ -30,7 +30,7 @@ const MenuShowcase = () => { ...@@ -30,7 +30,7 @@ const MenuShowcase = () => {
<MenuRoot> <MenuRoot>
<MenuTrigger asChild> <MenuTrigger asChild>
<IconButton variant="dropdown" size="sm" loading> <IconButton variant="dropdown" size="sm" loadingSkeleton>
<IconSvg name="dots" boxSize="18px"/> <IconSvg name="dots" boxSize="18px"/>
</IconButton> </IconButton>
</MenuTrigger> </MenuTrigger>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment