Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Separator from '../Separator';
import { JSX, ClassAttributes, HTMLAttributes } from 'react';
import Separator, {SeparatorProps} from '../Separator';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
import React from 'react';
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consolidate and clean up React imports.

There are multiple redundant imports and unused types.

-import { JSX, ClassAttributes, HTMLAttributes } from 'react';
import Separator, {SeparatorProps} from '../Separator';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
-import React from 'react';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { JSX, ClassAttributes, HTMLAttributes } from 'react';
import Separator, {SeparatorProps} from '../Separator';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
import React from 'react';
import Separator, {SeparatorProps} from '../Separator';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
🧰 Tools
🪛 ESLint

[error] 1-1: '/home/jailuser/git/node_modules/react/index.js' imported multiple times.

(import/no-duplicates)


[error] 2-2: A space is required after '{'.

(object-curly-spacing)


[error] 2-2: A space is required before '}'.

(object-curly-spacing)


[error] 4-4: '/home/jailuser/git/node_modules/react/index.js' imported multiple times.

(import/no-duplicates)


const textClasses = 'text-gray-950 text-sm font-light';
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'Components/Separator',
component: Separator,
render: (args) => <SandboxEditor>
render: (args: JSX.IntrinsicAttributes & SeparatorProps) => <SandboxEditor>
<div className='mt-5'>
<div className='text-gray-950 font-bold text-xl'>Did you know Rad UI is great toolkit for your SaaS needs?</div>
<Separator {...args} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Button from '~/components/ui/Button/Button';
export default {
title: 'WIP/Skeleton',
component: Skeleton,
render: (args) => {
render: () => {
const [loading, setLoading] = React.useState(true);

const timeOutLoading = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import Strong from '../Strong';
import Text from '~/components/ui/Text/Text';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
import React from 'react';

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'Components/Strong',
component: Strong,
render: (args) => <SandboxEditor>
render: () => <SandboxEditor>
<div className='mt-5'>
<Text className="text-gray-900">This is a very <Strong className='text-gray-1000'>Strong</Strong> word</Text>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { useState } from 'react';
import Switch from '../Switch';
import { JSX, useState } from 'react';
import Switch, { SwitchProps } from '../Switch';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
import React from 'react';
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consolidate React imports.

Multiple React imports can be consolidated.

-import { JSX, useState } from 'react';
import Switch, { SwitchProps } from '../Switch';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
-import React from 'react';

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 ESLint

[error] 1-1: '/home/jailuser/git/node_modules/react/index.js' imported multiple times.

(import/no-duplicates)


[error] 4-4: '/home/jailuser/git/node_modules/react/index.js' imported multiple times.

(import/no-duplicates)


export default {
title: 'Components/Switch',
component: Switch,
render: (args) => <CheckBox {...args}/>
render: (args: JSX.IntrinsicAttributes & SwitchProps) => <CheckBox {...args}/>
};

const CheckBox = (args) => {
const CheckBox = (args: SwitchProps) => {
const variants = ['classic', 'surface', 'solid'];
const [isChecked, setIsChecked] = useState(true);

const handleChange = (state) => {
const handleChange = (state: boolean | ((prevState: boolean) => boolean)) => {
setIsChecked(state);
};
return <SandboxEditor className="flex flex-col gap-2">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import Table from '../Table';
import Heading from '~/components/ui/Heading/Heading';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
import React from 'react';

export default {
title: 'WIP/Table',
component: Table
};

// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
const Template = (args) => {
const Template = (args: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace any type with proper TableProps type.

Using any type defeats TypeScript's type safety. Consider importing and using the proper props type.

-const Template = (args: any) => {
+import { TableProps } from '../Table';
+const Template = (args: TableProps) => {

Committable suggestion skipped: line range outside the PR's diff.

const columns = [
{ name: 'Name', id: 'name' },
{ name: 'Age', id: 'age' }
Expand Down
Loading