feat: 添加 Props 类型
This commit is contained in:
@@ -1,5 +1,15 @@
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { svgs } from "./svgs";
|
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 = ({
|
const Button = ({
|
||||||
className,
|
className,
|
||||||
@@ -8,7 +18,7 @@ const Button = ({
|
|||||||
children,
|
children,
|
||||||
px,
|
px,
|
||||||
white,
|
white,
|
||||||
}) => {
|
}: ButtonProps) => {
|
||||||
const classes = `button relative inline-flex items-center justify-center h-11 ${
|
const classes = `button relative inline-flex items-center justify-center h-11 ${
|
||||||
px || "px-7"
|
px || "px-7"
|
||||||
} ${white ? "text-n-8" : "text-n-1"} transition-colors hover:text-color-1 ${
|
} ${white ? "text-n-8" : "text-n-1"} transition-colors hover:text-color-1 ${
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import { useState } from "react";
|
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);
|
const [loaded, setLoaded] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
interface SectionProps {
|
||||||
|
className?: string;
|
||||||
|
crosses?: boolean;
|
||||||
|
crossesOffset?: string;
|
||||||
|
customPaddings?: boolean;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
const Section = ({
|
const Section = ({
|
||||||
className,
|
className,
|
||||||
crosses,
|
crosses,
|
||||||
crossesOffset,
|
crossesOffset,
|
||||||
customPaddings,
|
customPaddings,
|
||||||
children,
|
children,
|
||||||
}) => (
|
}: SectionProps) => (
|
||||||
<div
|
<div
|
||||||
className={`relative ${
|
className={`relative ${
|
||||||
customPaddings ||
|
customPaddings ||
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ export interface RawDataPoint {
|
|||||||
close: number;
|
close: number;
|
||||||
/** 成交量 */
|
/** 成交量 */
|
||||||
volume: number;
|
volume: number;
|
||||||
|
/** 成交额(可选) */
|
||||||
|
turnover?: number;
|
||||||
/** 均价(分时图专用) */
|
/** 均价(分时图专用) */
|
||||||
avg_price?: number;
|
avg_price?: number;
|
||||||
/** 昨收价(用于百分比计算和基准线)- 分时图专用 */
|
/** 昨收价(用于百分比计算和基准线)- 分时图专用 */
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import FullCalendar from '@fullcalendar/react';
|
|||||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||||
import interactionPlugin from '@fullcalendar/interaction';
|
import interactionPlugin from '@fullcalendar/interaction';
|
||||||
import { DateClickArg } 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, { Dayjs } from 'dayjs';
|
||||||
import 'dayjs/locale/zh-cn';
|
import 'dayjs/locale/zh-cn';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user