Skip to content

Commit

Permalink
lint 수정했다
Browse files Browse the repository at this point in the history
  • Loading branch information
healtheloper committed Nov 24, 2023
1 parent cf7c92a commit 2382553
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/co-design-core/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { forwardRef } from 'react';
import { CoComponentProps, CoSize, CoPalette, PolymorphicComponentProps, PolymorphicRef, useCoTheme, ClassNames } from '@co-design/styles';
import { CoComponentProps, CoSize, PolymorphicComponentProps, PolymorphicRef, useCoTheme, ClassNames } from '@co-design/styles';
import { View } from '../View';
import useStyles, { ButtonVariant } from './Button.style';
import { Spinner, SpinnerProps } from '../Spinner';
Expand Down
5 changes: 2 additions & 3 deletions packages/co-design-core/src/components/Switch/Switch.style.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { createStyles, CoSize, CoPalette, defaultFontStyles } from '@co-design/styles';
import { createStyles, CoSize, defaultFontStyles } from '@co-design/styles';
import { getFieldValue } from '../../utils';

interface SwitchStyles {
color: CoPalette;
size: CoSize;
disabled: boolean;
}

export default createStyles((theme, { size, color, disabled }: SwitchStyles) => {
export default createStyles((theme, { size, disabled }: SwitchStyles) => {
const switchHeight = {
xsmall: 16,
small: 16,
Expand Down
11 changes: 3 additions & 8 deletions packages/co-design-core/src/components/Switch/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
import { useId } from '@co-design/hooks';
import { CoComponentProps, CoSize, CoPalette, ClassNames, useCoTheme } from '@co-design/styles';
import { CoComponentProps, ClassNames } from '@co-design/styles';
import { View } from '../View';
import useStyles from './Switch.style';

Expand All @@ -15,9 +15,6 @@ export interface SwitchProps
/** 우측 영역에 label을 추가합니다. */
label?: React.ReactNode;

/** Switch 컴포넌트의 색상을 정합니다. */
color?: CoPalette;

/** Switch 컴포넌트의 크기를 정합니다. */
size?: 'small' | 'medium';

Expand All @@ -26,10 +23,8 @@ export interface SwitchProps
}

export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
({ id, size = 'small', color, label, className, style, co, overrideStyles, disabled = false, ...props }: SwitchProps, ref) => {
const theme = useCoTheme();
const _color = color || theme.primaryColor;
const { classes, cx } = useStyles({ size, color: _color, disabled }, { overrideStyles, name: 'Switch' });
({ id, size = 'small', label, className, style, co, overrideStyles, disabled = false, ...props }: SwitchProps, ref) => {
const { classes, cx } = useStyles({ size, disabled }, { overrideStyles, name: 'Switch' });
const uuid = useId(id);

return (
Expand Down
1 change: 0 additions & 1 deletion packages/co-design-core/src/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import ToastIcon from './ToastIcon';
import useStyles from './Toast.style';
import { View } from '../View';
import { Button } from '../Button';
import { IconButton } from '../IconButton';

export type ToastStylesNames = ClassNames<typeof useStyles>;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useEffect } from 'react';
import { useEffect } from 'react';
import Toast from '../core';

export default {
title: '@co-design/core/ToastArea',
};

export const Default = {
render: (props) => {
render: () => {
useEffect(() => {
Toast.success('마운트 시 알림');
}, []);
Expand Down

0 comments on commit 2382553

Please sign in to comment.