feat: 添加 Props 类型

This commit is contained in:
zdl
2025-11-25 15:46:20 +08:00
parent 4d9c29c02e
commit 24750018cd
5 changed files with 31 additions and 4 deletions

View File

@@ -1,5 +1,15 @@
import { Link } from "react-router-dom";
import { svgs } from "./svgs";
import React from "react";
interface ButtonProps {
className?: string;
href?: string;
onClick?: () => void;
children: React.ReactNode;
px?: string;
white?: boolean;
}
const Button = ({
className,
@@ -8,7 +18,7 @@ const Button = ({
children,
px,
white,
}) => {
}: ButtonProps) => {
const classes = `button relative inline-flex items-center justify-center h-11 ${
px || "px-7"
} ${white ? "text-n-8" : "text-n-1"} transition-colors hover:text-color-1 ${

View File

@@ -1,6 +1,11 @@
import { useState } from "react";
import React from "react";
const Image = ({ className, ...props }) => {
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
className?: string;
}
const Image = ({ className, ...props }: ImageProps) => {
const [loaded, setLoaded] = useState(false);
return (

View File

@@ -1,10 +1,20 @@
import React from "react";
interface SectionProps {
className?: string;
crosses?: boolean;
crossesOffset?: string;
customPaddings?: boolean;
children: React.ReactNode;
}
const Section = ({
className,
crosses,
crossesOffset,
customPaddings,
children,
}) => (
}: SectionProps) => (
<div
className={`relative ${
customPaddings ||

View File

@@ -51,6 +51,8 @@ export interface RawDataPoint {
close: number;
/** 成交量 */
volume: number;
/** 成交额(可选) */
turnover?: number;
/** 均价(分时图专用) */
avg_price?: number;
/** 昨收价(用于百分比计算和基准线)- 分时图专用 */

View File

@@ -45,7 +45,7 @@ import FullCalendar from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid';
import interactionPlugin from '@fullcalendar/interaction';
import { DateClickArg } from '@fullcalendar/interaction';
import { EventClickArg } from '@fullcalendar/common';
import type { EventClickArg } from '@fullcalendar/core';
import dayjs, { Dayjs } from 'dayjs';
import 'dayjs/locale/zh-cn';