Skip to content

Commit

Permalink
style: lint 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Todari committed Jul 29, 2024
1 parent cd8c922 commit 286ae97
Show file tree
Hide file tree
Showing 31 changed files with 102 additions and 56 deletions.
3 changes: 2 additions & 1 deletion HDesign/src/components/BillItem/BillItem.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Theme} from '@/theme/theme.type';
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

export const textStyle = (theme: Theme) =>
css({
color: theme.colors.black,
Expand Down
10 changes: 7 additions & 3 deletions HDesign/src/components/BillItem/BillItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/** @jsxImportSource @emotion/react */
import React from 'react';
import {useTheme} from '@theme/HDesignProvider';
import {BillItemProps} from './BillItem.type';
import {textStyle} from './BillItem.style';

import Text from '@components/Text/Text';

import {useTheme} from '@theme/HDesignProvider';

import DragHandleItem from '../DragHandleItem/DragHandleItem';
import Flex from '../Flex/Flex';

import {BillItemProps} from './BillItem.type';
import {textStyle} from './BillItem.style';

export const BillItem: React.FC<BillItemProps> = ({
name = '',
price = 0,
Expand Down
2 changes: 1 addition & 1 deletion HDesign/src/components/BottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import {createPortal} from 'react-dom';

import {BottomSheetProps} from '@components/BottomSheet/BottomSheet.type';
import {useBottomSheet} from './useBottomSheet';
import FixedButton from '@components/FixedButton/FixedButton';

import {useTheme} from '@theme/HDesignProvider';

import {useBottomSheet} from './useBottomSheet';
import {bottomSheetContainerStyle, dimmedLayerStyle, indicatorStyle} from './BottomSheet.style';

const BottomSheet: React.FC<BottomSheetProps> = ({
Expand Down
1 change: 1 addition & 0 deletions HDesign/src/components/BottomSheet/BottomSheet.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ComponentPropsWithoutRef} from 'react';
import {ButtonVariants} from '@components/Button/Button.type';

import {Theme} from '@theme/theme.type';

import {FixedButtonProps} from '../FixedButton/FixedButton.type';

export interface BottomSheetStyleProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';
import {ColorKeys} from '@/token/colors';
import {css} from '@emotion/react';

export const dragHandleItemStyle = (theme: Theme, hasDragHandle: boolean, backgroundColor: ColorKeys) =>
css({
Expand Down
12 changes: 7 additions & 5 deletions HDesign/src/components/DragHandleItem/DragHandleItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/** @jsxImportSource @emotion/react */
import React from 'react';

import {StrictPropsWithChildren} from '@/types/strictPropsWithChildren';
import {COLORS, ColorKeys} from '@/token/colors';

import {useTheme} from '@theme/HDesignProvider';

import IconButton from '../IconButton/IconButton';
import {StrictPropsWithChildren} from '@/types/strictPropsWithChildren';

import {dragHandleItemStyle, prefixStyle} from './DragHandleItem.style';
import {COLORS, ColorKeys} from '@/token/colors';

interface DragHandleItemCustomProps {
hasDragHandle?: boolean;
Expand All @@ -15,12 +17,12 @@ interface DragHandleItemCustomProps {

export type DragHandleItemProps = React.ComponentProps<'div'> & DragHandleItemCustomProps;

export const DragHandleItem = ({
export function DragHandleItem({
hasDragHandle = false,
backgroundColor = 'white',
children,
...htmlProps
}: StrictPropsWithChildren<DragHandleItemProps>) => {
}: StrictPropsWithChildren<DragHandleItemProps>) {
const {theme} = useTheme();

// TODO: (@toari) : μ‚¬λžŒ 수 λ§Žμ„ λ•Œ UX writing 처리
Expand All @@ -32,5 +34,5 @@ export const DragHandleItem = ({
</div>
</div>
);
};
}
export default DragHandleItem;
3 changes: 2 additions & 1 deletion HDesign/src/components/ExpenseList/ExpenseList.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Theme} from '@/theme/theme.type';
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

export const expenseItemStyle = () =>
css({
display: 'flex',
Expand Down
12 changes: 7 additions & 5 deletions HDesign/src/components/ExpenseList/ExpenseList.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/** @jsxImportSource @emotion/react */

import {useTheme} from '@theme/HDesignProvider';
import Text from '@components/Text/Text';

import {Arrow} from '@assets/index';

import {useTheme} from '@theme/HDesignProvider';

import {ExpenseItemProps, ExpenseListProps} from './ExpenseList.type';
import {expenseItemStyle, expenseListStyle, expenseItemLeftStyle, TextStyle} from './ExpenseList.style';

// TODO: (@soha) λ”°λ‘œ 파일 λΆ„λ¦¬ν• κΉŒ 고민쀑.. μ—¬κΈ°μ„œλ§Œ μ‚¬μš©ν•  것 κ°™κΈ΄ ν•œλ°.. 흠
const ExpenseItem = ({name, price, ...buttonProps}: ExpenseItemProps) => {
function ExpenseItem({name, price, ...buttonProps}: ExpenseItemProps) {
const {theme} = useTheme();
return (
<button css={expenseItemStyle} {...buttonProps}>
Expand All @@ -21,9 +23,9 @@ const ExpenseItem = ({name, price, ...buttonProps}: ExpenseItemProps) => {
</div>
</button>
);
};
}

const ExpenseList = ({expenseList = []}: ExpenseListProps) => {
function ExpenseList({expenseList = []}: ExpenseListProps) {
const {theme} = useTheme();
return (
<div css={expenseListStyle(theme)}>
Expand All @@ -32,6 +34,6 @@ const ExpenseList = ({expenseList = []}: ExpenseListProps) => {
))}
</div>
);
};
}

export default ExpenseList;
4 changes: 3 additions & 1 deletion HDesign/src/components/Flex/Flex.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {css} from '@emotion/react';

import {changeCamelCaseToKebabCase} from '@/utils/ return str.replace(/([a-z])([A-Z])/changeCamelCaseToKebabCase';

import {FlexDirectionStrictType, FlexProps} from './Flex.type';
import {css} from '@emotion/react';

export const flexStyle = ({
justifyContent = 'flexStart',
Expand Down
7 changes: 4 additions & 3 deletions HDesign/src/components/Flex/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/** @jsxImportSource @emotion/react */
import {StrictPropsWithChildren} from '@/types/strictPropsWithChildren';
import {FlexProps} from './Flex.type';
import {useTheme} from '@/theme/HDesignProvider';

import {FlexProps} from './Flex.type';
import {flexStyle} from './Flex.style';

// TODO: (@weadie) μ§€μ •λœ ν”„λ‘­ 말고 λ‹€λ₯Έ 프둭도 κ°€μ Έμ˜¬ 수 있게 ν•˜μž.
const Flex = ({children, ...props}: StrictPropsWithChildren<FlexProps>) => {
function Flex({children, ...props}: StrictPropsWithChildren<FlexProps>) {
const {theme} = useTheme();
return <div css={flexStyle({theme, ...props})}>{children}</div>;
};
}

export default Flex;
1 change: 0 additions & 1 deletion HDesign/src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import {forwardRef} from 'react';

import {IconButtonProps} from '@components/IconButton/IconButton.type';

import {InputDelete, Plus, Buljusa} from '@/assets';

const ICON = {
Expand Down
3 changes: 2 additions & 1 deletion HDesign/src/components/InOutItem/InOutItem.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Theme} from '@/theme/theme.type';
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

export const inOutItemStyle = (theme: Theme) =>
css({
display: 'flex',
Expand Down
6 changes: 4 additions & 2 deletions HDesign/src/components/InOutItem/InOutItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/** @jsxImportSource @emotion/react */
import React from 'react';

import Text from '@components/Text/Text';

import {useTheme} from '@theme/HDesignProvider';

import DragHandleItem from '../DragHandleItem/DragHandleItem';

import {InOutItemProps, InOutType} from './InOutItem.type';
import {textStyle} from './InOutItem.style';
import Text from '@components/Text/Text';
import DragHandleItem from '../DragHandleItem/DragHandleItem';

const IN_OUT_TEXT: Record<InOutType, string> = {
IN: 'λ“€μ–΄μ˜΄',
Expand Down
1 change: 1 addition & 0 deletions HDesign/src/components/Input/Input.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {css} from '@emotion/react';

import {Theme} from '@theme/theme.type';

import {InputType} from './Input.type';

const inputBoxBackgroundColorByInputType = (theme: Theme, inputType: InputType = 'input') => {
Expand Down
3 changes: 2 additions & 1 deletion HDesign/src/components/Search/Search.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import type {Meta, StoryObj} from '@storybook/react';

import React from 'react';

import Search from '@components/Search/Search';

const meta = {
Expand Down
3 changes: 2 additions & 1 deletion HDesign/src/components/Search/Search.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Theme} from '@/theme/theme.type';
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

export const searchStyle = css({
position: 'relative',

Expand Down
10 changes: 6 additions & 4 deletions HDesign/src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/** @jsxImportSource @emotion/react */
import Flex from '@components/Flex/Flex';

import {useTheme} from '@theme/HDesignProvider';

import Input from '../Input/Input';
import {InputProps} from '../Input/Input.type';
import {searchStyle, searchTermsStyle} from './Search.style';

import {searchStyle, searchTermsStyle, searchTermStyle} from './Search.style';
import useSearch from './useSearch';
import {searchTermStyle} from './Search.style';
import {useTheme} from '@theme/HDesignProvider';
import Flex from '@components/Flex/Flex';

export interface SearchProps extends InputProps {
searchTerms: string[];
Expand Down
3 changes: 2 additions & 1 deletion HDesign/src/components/StepItem/StepItem.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Theme} from '@/theme/theme.type';
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

export const stepItemStyle = (theme: Theme) =>
css({
display: 'flex',
Expand Down
6 changes: 4 additions & 2 deletions HDesign/src/components/StepItem/StepItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/** @jsxImportSource @emotion/react */
import {useTheme} from '@/theme/HDesignProvider';
import {StepItemCustomProps} from './StepItem.type';
import {nameStyle, personCountStyle, stepItemStyle, totalAmountStyle, totalTitleStyle} from './StepItem.style';

import Text from '../Text/Text';
import BillItem from '../BillItem/BillItem';
import {BillItemCustomProps} from '../BillItem/BillItem.type';
import Flex from '../Flex/Flex';

import {nameStyle, personCountStyle, stepItemStyle, totalAmountStyle, totalTitleStyle} from './StepItem.style';
import {StepItemCustomProps} from './StepItem.type';

export const StepItem: React.FC<StepItemCustomProps> = ({
name = '',
personCount = 0,
Expand Down
5 changes: 3 additions & 2 deletions HDesign/src/components/Switch/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/** @jsxImportSource @emotion/react */
import TextButton from '../TextButton/TextButton';

import {switchContainerStyle} from './Switch.style';
import {SwitchProps} from './Switch.type';

const Switch = ({value, values, onChange}: SwitchProps) => {
function Switch({value, values, onChange}: SwitchProps) {
return (
<div css={switchContainerStyle}>
{values.map((item, index) => (
Expand All @@ -18,6 +19,6 @@ const Switch = ({value, values, onChange}: SwitchProps) => {
))}
</div>
);
};
}

export default Switch;
4 changes: 3 additions & 1 deletion HDesign/src/components/Tabs/Tabs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import type {Meta, StoryObj} from '@storybook/react';

import React from 'react';

import Tabs from '@/components/Tabs/Tabs';

import Tab from './Tab';

const meta = {
Expand Down
3 changes: 2 additions & 1 deletion HDesign/src/components/Tabs/Tabs.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Theme} from '@/theme/theme.type';
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

export const tabListStyle = (theme: Theme) =>
css({
position: 'relative',
Expand Down
6 changes: 4 additions & 2 deletions HDesign/src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import React, {useState} from 'react';
import {css} from '@emotion/react';

import {useTheme} from '@theme/HDesignProvider';
import {tabListStyle, indicatorStyle, tabItemStyle, tabTextStyle} from './Tabs.style';
import {TabsProps} from './Tab.type';

import Text from '../Text/Text';
import Flex from '../Flex/Flex';

import {tabListStyle, indicatorStyle, tabItemStyle, tabTextStyle} from './Tabs.style';
import {TabsProps} from './Tab.type';

const Tabs: React.FC<TabsProps> = ({children, tabsContainerStyle}) => {
const {theme} = useTheme();
const [activeTabIndex, setActiveTabIndex] = useState(0);
Expand Down
4 changes: 3 additions & 1 deletion HDesign/src/components/TextButton/TextButton.style.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {css} from '@emotion/react';

import {Theme} from '@/theme/theme.type';

import {TextColor} from './TextButton.type';
import {css} from '@emotion/react';

interface TextButtonStyleProps {
textColor: TextColor;
Expand Down
7 changes: 5 additions & 2 deletions HDesign/src/components/TextButton/TextButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/** @jsxImportSource @emotion/react */
import {forwardRef} from 'react';
import {TextButtonProps} from './TextButton.type';
import Text from '../Text/Text';

import {useTheme} from '@/theme/HDesignProvider';

import Text from '../Text/Text';

import {TextButtonProps} from './TextButton.type';
import {textButtonStyle} from './TextButton.style';

export const TextButton: React.FC<TextButtonProps> = forwardRef<HTMLButtonElement, TextButtonProps>(function Button(
Expand Down
5 changes: 3 additions & 2 deletions HDesign/src/components/TopNav/Back.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/** @jsxImportSource @emotion/react */
import React from 'react';
import {useNavigate} from 'react-router-dom';

import TextButton from '@components/TextButton/TextButton';

const Back = () => {
function Back() {
const navigate = useNavigate();

return (
<TextButton onClick={() => navigate(-1)} textSize="bodyBold" textColor="gray">
λ’€λ‘œκ°€κΈ°
</TextButton>
);
};
}

export default Back;
Loading

0 comments on commit 286ae97

Please sign in to comment.