Skip to content

Commit

Permalink
chore: adjust code
Browse files Browse the repository at this point in the history
  • Loading branch information
Heising committed Mar 4, 2025
1 parent 7485ec0 commit 7f37fc3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
"@tdesign/common-js": "workspace:^",
"@tdesign/common-style": "workspace:^",
"@tdesign/components": "workspace:^",
"@tdesign/react-site": "workspace:^",
"@types/sortablejs": "^1.10.7",
"@types/tinycolor2": "^1.4.3",
"@types/validator": "^13.1.3",
Expand Down
18 changes: 7 additions & 11 deletions packages/components/button/_usage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
*/

// @ts-nocheck
import React, { useState, useEffect, useMemo } from "react";
import BaseUsage, {
useConfigChange,
usePanelChange,
} from "@site/src/components/BaseUsage";
import jsxToString from "react-element-to-jsx-string";
import React, { useState, useEffect, useMemo } from 'react';
import BaseUsage, { useConfigChange, usePanelChange } from '@tdesign/react-site/src/components/BaseUsage';
import jsxToString from 'react-element-to-jsx-string';

import configProps from "./props.json";

import { Button } from "tdesign-react";
import { Button } from '@tdesign/components';
import configProps from './props.json';

export default function Usage() {
const [configList, setConfigList] = useState(configProps);

const { changedProps, onConfigChange } = useConfigChange(configList);

const panelList = [{ label: "button", value: "button" }];
const panelList = [{ label: 'button', value: 'button' }];

const { panel, onPanelChange } = usePanelChange(panelList);

Expand All @@ -30,7 +26,7 @@ export default function Usage() {
}, [changedProps]);

const jsxStr = useMemo(() => {
if (!renderComp) return "";
if (!renderComp) return '';
return jsxToString(renderComp);
}, [renderComp]);

Expand Down
2 changes: 1 addition & 1 deletion packages/tdesign-react/site/src/components/Demo.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Button from '@tdesign/components/button';
import { Button } from '@tdesign/components';
import { Link, useLocation } from 'react-router-dom';

export const demoFiles = import.meta.glob('../../../../components/**/_example/*.tsx', { eager: true });
Expand Down
4 changes: 2 additions & 2 deletions packages/tdesign-react/site/src/components/Playground.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { HashRouter, Routes, Navigate, Route, useLocation, Link } from 'react-router-dom';
import ReactDOM from 'react-dom';
import Button from 'tdesign-react/button';
import 'tdesign-react/style/index.js';
import { Button } from '@tdesign/components';
import '@tdesign/components/style/index.js';

const demoFiles = import.meta.glob('../../../src/**/_example/*.jsx', { eager: true });
const demoObject = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from 'react';
import Tooltip from 'tdesign-react/tooltip';
import Loading from 'tdesign-react/loading';
import { Tooltip, Loading } from '@tdesign/components';

import { mainJsContent, htmlContent, pkgContent, styleContent, tsconfigContent } from './content';
import '../../styles/Codesandbox.less';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef, useState } from 'react';
import Tooltip from 'tdesign-react/tooltip';
import { Tooltip } from '@tdesign/components';

import {
htmlContent,
Expand Down

0 comments on commit 7f37fc3

Please sign in to comment.