Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: pnpm tsc #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"classnames": "^2.5.1",
"dayjs": "^1.11.13",
"numeral": "^2.0.6",
"querystring": "^0.2.1",
"rc-util": "^5.43.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
20 changes: 12 additions & 8 deletions src/components/Account/Center/AvatarList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ export type AvatarListProps = {
| React.ReactElement<AvatarItemProps>
| React.ReactElement<AvatarItemProps>[];
};
const avatarSizeToClassName = (size: SizeType | 'mini', styles: any) =>
classNames(styles.avatarItem, {
[styles.avatarItemLarge]: size === 'large',
[styles.avatarItemSmall]: size === 'small',
[styles.avatarItemMini]: size === 'mini',
});

const Item: React.FC<AvatarItemProps> = ({
src,
size,
tips,
onClick = () => {},
}) => {
const { styles } = useStyles();
const avatarSizeToClassName = (size?: SizeType | 'mini') =>
classNames(styles.avatarItem, {
[styles.avatarItemLarge]: size === 'large',
[styles.avatarItemSmall]: size === 'small',
[styles.avatarItemMini]: size === 'mini',
});
const cls = avatarSizeToClassName(size);

const cls = avatarSizeToClassName(size!, styles);

return (
<li className={cls} onClick={onClick}>
{tips ? (
Expand Down Expand Up @@ -62,13 +65,14 @@ const AvatarList: React.FC<AvatarListProps> & {
const childrenArray = React.Children.toArray(
children,
) as React.ReactElement<AvatarItemProps>[];

const childrenWithProps = childrenArray.slice(0, numToShow).map((child) =>
React.cloneElement(child, {
size,
}),
);
if (numToShow < numOfChildren) {
const cls = avatarSizeToClassName(size);
const cls = avatarSizeToClassName(size!, styles);
childrenWithProps.push(
<li key="exceed" className={cls}>
<Avatar
Expand Down
7 changes: 3 additions & 4 deletions src/components/Account/Settings/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@ant-design/pro-components';
import { Button, Input, Upload, message } from 'antd';
import { queryCity, queryProvince } from '@/services/api';
import type { CurrentUser } from '@/types';
import useStyles from './index.style';

const validatorPhone = (
Expand All @@ -27,7 +28,7 @@ const validatorPhone = (
};

interface BaseViewProps {
currentUser: API.CurrentUser;
currentUser: CurrentUser;
}
const BaseView: React.FC<BaseViewProps> = ({ currentUser }) => {
const { styles } = useStyles();
Expand Down Expand Up @@ -76,7 +77,7 @@ const BaseView: React.FC<BaseViewProps> = ({ currentUser }) => {
}}
initialValues={{
...currentUser,
phone: currentUser?.phone.split('-'),
phone: (currentUser?.phone || '').split('-'),
}}
hideRequiredMark
>
Expand Down Expand Up @@ -144,7 +145,6 @@ const BaseView: React.FC<BaseViewProps> = ({ currentUser }) => {
labelInValue: true,
}}
name="province"
className={styles.item}
request={async () => {
return queryProvince().then(({ data }) => {
return data.map((item) => {
Expand Down Expand Up @@ -172,7 +172,6 @@ const BaseView: React.FC<BaseViewProps> = ({ currentUser }) => {
},
]}
disabled={!province}
className={styles.item}
request={async () => {
if (!province?.key) {
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const ChartCard: React.FC<ChartCardProps> = (props) => {
height: contentHeight || 'auto',
}}
>
<div className={contentHeight && styles.contentFixed}>
<div className={contentHeight ? styles.contentFixed : undefined}>
{children}
</div>
</div>
Expand Down
55 changes: 0 additions & 55 deletions src/components/Dashboard/Analysis/Charts/MiniProgress/index.tsx

This file was deleted.

224 changes: 0 additions & 224 deletions src/components/Dashboard/Analysis/Charts/WaterWave/index.tsx

This file was deleted.

Loading