Fix the ref, upload, keyframes, and implicit-any type errors. [skip build]
This commit is contained in:
@@ -6,8 +6,8 @@ type ConfirmPasswordMatchProps = {
|
||||
children: (
|
||||
match: boolean,
|
||||
doMatch: () => void,
|
||||
passRef: RefObject<HTMLInputElement>,
|
||||
confPassRef: RefObject<HTMLInputElement>,
|
||||
passRef: RefObject<HTMLInputElement | null>,
|
||||
confPassRef: RefObject<HTMLInputElement | null>,
|
||||
) => ReactNode;
|
||||
};
|
||||
export function ConfirmPasswordMatch({ initialValue, children }: ConfirmPasswordMatchProps) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { style } from '@vanilla-extract/css';
|
||||
import { keyframes, style } from '@vanilla-extract/css';
|
||||
|
||||
const transitionContainer = style({
|
||||
position: 'relative',
|
||||
@@ -14,36 +14,34 @@ const transitionContent = style({
|
||||
height: '100%',
|
||||
});
|
||||
|
||||
const routeFadeSlideIn = keyframes({
|
||||
from: {
|
||||
opacity: 0,
|
||||
transform: 'translateX(12px)',
|
||||
},
|
||||
to: {
|
||||
opacity: 1,
|
||||
transform: 'translateX(0)',
|
||||
},
|
||||
});
|
||||
|
||||
const animateIn = style({
|
||||
animation: 'routeFadeSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
'@keyframes': {
|
||||
routeFadeSlideIn: {
|
||||
from: {
|
||||
opacity: 0,
|
||||
transform: 'translateX(12px)',
|
||||
},
|
||||
to: {
|
||||
opacity: 1,
|
||||
transform: 'translateX(0)',
|
||||
},
|
||||
},
|
||||
animation: `${routeFadeSlideIn} 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,
|
||||
});
|
||||
|
||||
const routeFadeSlideOut = keyframes({
|
||||
from: {
|
||||
opacity: 1,
|
||||
transform: 'translateX(0)',
|
||||
},
|
||||
to: {
|
||||
opacity: 0,
|
||||
transform: 'translateX(-12px)',
|
||||
},
|
||||
});
|
||||
|
||||
const animateOut = style({
|
||||
animation: 'routeFadeSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards',
|
||||
'@keyframes': {
|
||||
routeFadeSlideOut: {
|
||||
from: {
|
||||
opacity: 1,
|
||||
transform: 'translateX(0)',
|
||||
},
|
||||
to: {
|
||||
opacity: 0,
|
||||
transform: 'translateX(-12px)',
|
||||
},
|
||||
},
|
||||
},
|
||||
animation: `${routeFadeSlideOut} 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards`,
|
||||
});
|
||||
|
||||
interface RouteTransitionProps {
|
||||
|
||||
@@ -192,7 +192,7 @@ const DEFAULT_CATEGORY_ID = makeNavCategoryId('direct', 'direct');
|
||||
* Props for the DirectList component
|
||||
*/
|
||||
export type DirectListProps = {
|
||||
scrollRef: React.RefObject<HTMLDivElement>;
|
||||
scrollRef: React.RefObject<HTMLDivElement | null>;
|
||||
showCreateButton?: boolean;
|
||||
showCategoryHeader?: boolean;
|
||||
};
|
||||
|
||||
@@ -296,7 +296,7 @@ function StickerSidebar({ activeGroupAtom, packs, onScrollToGroup }: StickerSide
|
||||
}
|
||||
|
||||
type EmojiGroupHolderProps = {
|
||||
contentScrollRef: RefObject<HTMLDivElement>;
|
||||
contentScrollRef: RefObject<HTMLDivElement | null>;
|
||||
previewAtom: PrimitiveAtom<PreviewData | undefined>;
|
||||
children?: ReactNode;
|
||||
onGroupItemClick: MouseEventHandler;
|
||||
|
||||
@@ -121,6 +121,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
url: data.mxc,
|
||||
info: getImageInfo(imgEl, data.file),
|
||||
};
|
||||
if (!data.file.name) return;
|
||||
const image = PackImageReader.fromPackImage(
|
||||
getFileNameWithoutExt(data.file.name),
|
||||
packImage,
|
||||
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
export const ScrollTopContainer = as<
|
||||
'div',
|
||||
{
|
||||
scrollRef?: RefObject<HTMLElement>;
|
||||
anchorRef: RefObject<HTMLElement>;
|
||||
scrollRef?: RefObject<HTMLElement | null>;
|
||||
anchorRef: RefObject<HTMLElement | null>;
|
||||
onVisibilityChange?: (onTop: boolean) => void;
|
||||
}
|
||||
>(({ className, scrollRef, anchorRef, onVisibilityChange, ...props }, ref) => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { style, keyframes } from '@vanilla-extract/css';
|
||||
import { color, config } from 'folds';
|
||||
import { AppRegionStyleRule } from '../../../types/utils';
|
||||
|
||||
const wipeIn = keyframes({
|
||||
'0%': {
|
||||
@@ -23,7 +24,7 @@ const wipeOut = keyframes({
|
||||
},
|
||||
});
|
||||
|
||||
export const NewMessagePill = style({
|
||||
const newMessagePill: AppRegionStyleRule = {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: config.space.S100,
|
||||
@@ -45,7 +46,9 @@ export const NewMessagePill = style({
|
||||
backgroundColor: '#388E3C',
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const NewMessagePill = style(newMessagePill);
|
||||
|
||||
export const NewMessagePillExiting = style({
|
||||
animation: `${wipeOut} 0.2s ease-in forwards`,
|
||||
@@ -65,7 +68,7 @@ export const TitleBar = style({
|
||||
WebkitUserSelect: 'none',
|
||||
});
|
||||
|
||||
export const TitleBarDragRegion = style({
|
||||
const titleBarDragRegion: AppRegionStyleRule = {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '100%',
|
||||
@@ -74,14 +77,18 @@ export const TitleBarDragRegion = style({
|
||||
cursor: 'default',
|
||||
WebkitAppRegion: 'drag',
|
||||
color: color.Surface.OnContainer,
|
||||
});
|
||||
};
|
||||
|
||||
export const TitleBarBackButton = style({
|
||||
export const TitleBarDragRegion = style(titleBarDragRegion);
|
||||
|
||||
const titleBarBackButton: AppRegionStyleRule = {
|
||||
WebkitAppRegion: 'no-drag',
|
||||
flexShrink: 0,
|
||||
});
|
||||
};
|
||||
|
||||
export const SyncStatusBadge = style({
|
||||
export const TitleBarBackButton = style(titleBarBackButton);
|
||||
|
||||
const syncStatusBadge: AppRegionStyleRule = {
|
||||
position: 'absolute',
|
||||
left: '50%',
|
||||
top: '50%',
|
||||
@@ -94,7 +101,9 @@ export const SyncStatusBadge = style({
|
||||
zIndex: 1001,
|
||||
pointerEvents: 'none',
|
||||
WebkitAppRegion: 'no-drag',
|
||||
});
|
||||
};
|
||||
|
||||
export const SyncStatusBadge = style(syncStatusBadge);
|
||||
|
||||
export const SyncStatusSuccess = style({
|
||||
backgroundColor: color.Success.Container,
|
||||
|
||||
@@ -49,7 +49,7 @@ export function TitleBar({ mx, children }: TitleBarProps) {
|
||||
const roomId = useAtomValue(activeRoomIdAtom);
|
||||
const [notifications, setNotifications] = useState<NewMessageNotification[]>([]);
|
||||
const dismissTimersRef = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());
|
||||
const lastMxRef = useRef<MatrixClient | undefined>();
|
||||
const lastMxRef = useRef<MatrixClient | undefined>(undefined);
|
||||
const navigate = useNavigate();
|
||||
const roomToParents = useAtomValue(roomToParentsAtom);
|
||||
const mDirects = useAtomValue(mDirectAtom);
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
import { keyframes, style } from '@vanilla-extract/css';
|
||||
import { color, config, toRem } from 'folds';
|
||||
import { AppRegionStyleRule } from '../../../types/utils';
|
||||
|
||||
const indeterminate = keyframes({
|
||||
'0%': { transform: 'translateX(-100%)' },
|
||||
'100%': { transform: 'translateX(250%)' },
|
||||
});
|
||||
|
||||
export const IdleSlot = style({
|
||||
const idleSlot: AppRegionStyleRule = {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
height: '100%',
|
||||
WebkitAppRegion: 'no-drag',
|
||||
flexShrink: 0,
|
||||
});
|
||||
};
|
||||
|
||||
export const IdleSlot = style(idleSlot);
|
||||
|
||||
export const GhostCheck = style({
|
||||
all: 'unset',
|
||||
@@ -38,7 +41,7 @@ export const GhostCheck = style({
|
||||
},
|
||||
});
|
||||
|
||||
export const Bar = style({
|
||||
const bar: AppRegionStyleRule = {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: config.space.S200,
|
||||
@@ -52,7 +55,9 @@ export const Bar = style({
|
||||
WebkitAppRegion: 'no-drag',
|
||||
flexShrink: 0,
|
||||
boxSizing: 'border-box',
|
||||
});
|
||||
};
|
||||
|
||||
export const Bar = style(bar);
|
||||
|
||||
export const BarTrack = style({
|
||||
position: 'relative',
|
||||
@@ -92,7 +97,7 @@ export const BarLabel = style({
|
||||
textAlign: 'right',
|
||||
});
|
||||
|
||||
export const Chip = style({
|
||||
const chip: AppRegionStyleRule = {
|
||||
height: toRem(22),
|
||||
maxWidth: toRem(260),
|
||||
padding: `0 ${config.space.S100} 0 ${config.space.S200}`,
|
||||
@@ -102,7 +107,9 @@ export const Chip = style({
|
||||
WebkitAppRegion: 'no-drag',
|
||||
flexShrink: 0,
|
||||
boxSizing: 'border-box',
|
||||
});
|
||||
};
|
||||
|
||||
export const Chip = style(chip);
|
||||
|
||||
export const ChipText = style({
|
||||
maxWidth: toRem(140),
|
||||
|
||||
Reference in New Issue
Block a user