Skip to content

Commit

Permalink
feat: remove code sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
zrll12 committed Sep 30, 2024
1 parent 60ed896 commit 9ff21ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions doc/docs/components/button/controls.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {useState} from "react";
import {Button} from "@qwqui/core";
import CodePreview from "@uiw/react-code-preview";
import { useState } from "react";
import { Button } from "@qwqui/core";

export const ButtonControls = () => {
const [color, setColor] = useState('blue');
Expand All @@ -10,7 +9,7 @@ export const ButtonControls = () => {
const [strong, setStrong] = useState(false);

const code = `
import {Button} from "@qwqui/core";
import { Button } from "@qwqui/core";
ReactDOM.createRoot(_mount_).render(
<div>
Expand All @@ -20,7 +19,7 @@ ReactDOM.createRoot(_mount_).render(
`

const codeStr = `
import {Button} from "@qwqui/core";
import { Button } from "@qwqui/core";
function Demo() {
return <Button color="${color}" size="${size}"${useCustomRadius ? ` radius="${radius}"` : ''}${strong ? ` strong={${strong}}` : ''}>Button</Button>;
Expand Down Expand Up @@ -74,8 +73,7 @@ function Demo() {
</label>
</div>


<CodePreview code={code} dependencies={{Button}} noCode/>
<Button color={color} size={size} radius={useCustomRadius ? radius : undefined} strong={strong}>Button</Button>
<pre style={{backgroundColor: "var(--gray-50)", padding: 20, fontSize: 14}} className={'code'}>
{codeStr}
</pre>
Expand Down
1 change: 0 additions & 1 deletion doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@qwqui/core": "workspace:^",
"@qwqui/theme": "workspace:^",
"@rspress/plugin-preview": "^1.31.1",
"@uiw/react-code-preview": "^5.2.2",
"rspress": "^1.31.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/button/src/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
color: var(--color);
background-color: var(--background-color);

transition: background-color 0.2s, color 0.2s;
transition: all 0.2s;

&:hover {
background-color: var(--background-color-hover);
Expand Down

0 comments on commit 9ff21ec

Please sign in to comment.