Fix the small mechanical rules. [skip build]
This commit is contained in:
@@ -88,12 +88,12 @@ export function RouteTransition({ children }: RouteTransitionProps) {
|
||||
};
|
||||
}, [location, displayLocation]);
|
||||
|
||||
const className =
|
||||
transitionStage === 'entering'
|
||||
? `${transitionContent} ${animateIn}`
|
||||
: transitionStage === 'exiting'
|
||||
? `${transitionContent} ${animateOut}`
|
||||
: transitionContent;
|
||||
let className = transitionContent;
|
||||
if (transitionStage === 'entering') {
|
||||
className = `${transitionContent} ${animateIn}`;
|
||||
} else if (transitionStage === 'exiting') {
|
||||
className = `${transitionContent} ${animateOut}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={transitionContainer}>
|
||||
|
||||
@@ -119,16 +119,17 @@ export function RoomMentionAutocomplete({
|
||||
}
|
||||
|
||||
const parentsList = Array.from(parents);
|
||||
const [firstParent] = parentsList;
|
||||
let chosenParent: string;
|
||||
|
||||
if (parentsList.length === 1) {
|
||||
chosenParent = parentsList[0];
|
||||
chosenParent = firstParent;
|
||||
} else {
|
||||
const orphanParents = parentsList.filter((p) => !roomToParents.has(p));
|
||||
if (orphanParents.length > 0) {
|
||||
chosenParent = guessPerfectParent(mx, currentRoomId, orphanParents) ?? orphanParents[0];
|
||||
} else {
|
||||
chosenParent = parentsList[0];
|
||||
chosenParent = firstParent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,17 +21,18 @@ export const Icon = forwardRef<SVGSVGElement, IconProps>(
|
||||
) => {
|
||||
const pixelSize = ICON_PIXEL_SIZES[size];
|
||||
|
||||
let iconStyle = style;
|
||||
if (size === 'Inherit') {
|
||||
iconStyle = { width: '1em', height: '1em', ...style };
|
||||
} else if (pixelSize) {
|
||||
iconStyle = { width: pixelSize, height: pixelSize, ...style };
|
||||
}
|
||||
|
||||
return (
|
||||
<LucideIconComponent
|
||||
ref={ref}
|
||||
className={classNames(iconStyles.Icon({ size }), className)}
|
||||
style={
|
||||
size === 'Inherit'
|
||||
? { width: '1em', height: '1em', ...style }
|
||||
: pixelSize
|
||||
? { width: pixelSize, height: pixelSize, ...style }
|
||||
: style
|
||||
}
|
||||
style={iconStyle}
|
||||
// Lucide icons are stroke-based; solid fill turns faces (e.g. Smile) into blobs.
|
||||
// Emphasize selection with a heavier stroke instead.
|
||||
strokeWidth={filled ? 2.75 : 2}
|
||||
|
||||
@@ -70,10 +70,10 @@ function cornerPeelPaths(
|
||||
const px = cx + ux * size;
|
||||
const py = cy + uy * size;
|
||||
|
||||
let ax = 0;
|
||||
let ay = 0;
|
||||
let bx = 0;
|
||||
let by = 0;
|
||||
let ax;
|
||||
let ay;
|
||||
let bx;
|
||||
let by;
|
||||
|
||||
if (id === 'tr') {
|
||||
ax = clamp(Math.abs(ux) > eps ? px + (py * uy) / ux : px, 0, w);
|
||||
|
||||
@@ -25,7 +25,7 @@ export const Time = as<'span', TimeProps & ComponentProps<typeof Text>>(
|
||||
({ compact, hour24Clock, dateFormatString, ts, ...props }, ref) => {
|
||||
const formattedTime = timeHourMinute(ts, hour24Clock);
|
||||
|
||||
let time = '';
|
||||
let time;
|
||||
if (compact) {
|
||||
time = formattedTime;
|
||||
} else if (today(ts)) {
|
||||
|
||||
@@ -24,17 +24,14 @@ export function SpeechBubble({
|
||||
}: SpeechBubbleProps) {
|
||||
const isMenu = variant === 'menu';
|
||||
|
||||
let tailClass: string | undefined;
|
||||
if (tail === 'top') {
|
||||
tailClass = isMenu ? css.SpeechBubbleMenuTailTop : css.SpeechBubbleTailTop;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
isMenu ? css.SpeechBubbleMenu : css.SpeechBubble,
|
||||
tail === 'top'
|
||||
? isMenu
|
||||
? css.SpeechBubbleMenuTailTop
|
||||
: css.SpeechBubbleTailTop
|
||||
: undefined,
|
||||
className,
|
||||
)}
|
||||
className={classNames(isMenu ? css.SpeechBubbleMenu : css.SpeechBubble, tailClass, className)}
|
||||
style={{
|
||||
...(tailX ? ({ ['--speech-tail-x' as string]: tailX } as React.CSSProperties) : null),
|
||||
...style,
|
||||
|
||||
@@ -564,10 +564,11 @@ export function TitleBar({ mx, children }: TitleBarProps) {
|
||||
|
||||
// Pick the best parent (or first if only one)
|
||||
const parentsList = Array.from(parents);
|
||||
const [firstParent] = parentsList;
|
||||
let chosenParent: string;
|
||||
|
||||
if (parentsList.length === 1) {
|
||||
chosenParent = parentsList[0];
|
||||
chosenParent = firstParent;
|
||||
} else {
|
||||
// Use heuristic to pick best parent
|
||||
// Prefer a parent that is itself a top-level space (orphan)
|
||||
@@ -577,7 +578,7 @@ export function TitleBar({ mx, children }: TitleBarProps) {
|
||||
chosenParent = guessPerfectParent(mx, currentRoomId, orphanParents) ?? orphanParents[0];
|
||||
} else {
|
||||
// All parents have parents themselves, just pick first and continue
|
||||
chosenParent = parentsList[0];
|
||||
chosenParent = firstParent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,6 @@ export function UserHero({ userId, avatarUrl, avatarMxc, presence, children }: U
|
||||
type UserHeroNameProps = {
|
||||
displayName?: string;
|
||||
userId: string;
|
||||
avatarMxc?: string;
|
||||
};
|
||||
export function UserHeroName({ displayName, userId }: UserHeroNameProps) {
|
||||
const username = getMxIdLocalPart(userId);
|
||||
|
||||
Reference in New Issue
Block a user