Skip to content

Commit

Permalink
Merge branch 'develop' into feat/11/AddBottomSheet
Browse files Browse the repository at this point in the history
  • Loading branch information
klmhyeonwoo authored Jul 16, 2024
2 parents 3c673bb + fa8ed1e commit 2bfefcd
Show file tree
Hide file tree
Showing 21 changed files with 29 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/app/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { useAtom } from "jotai";

import Button from "@/component/Button/Button";
import { Modal } from "@/component/common/Modal/Modal";
import { Toast } from "@/component/common/Toast/Toast";
import { Modal } from "@/component/common/Modal";
import { Toast } from "@/component/common/Toast";
import { useModal } from "@/hooks/useModal";
import { useToast } from "@/hooks/useToast";
import { messageAtom } from "@/store/messageAtom.tsx";
Expand Down
3 changes: 3 additions & 0 deletions src/app/test/Staging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { Input, InputLabelContainer, Label } from "@/component/common/Input";
import Radio from "@/component/common/RadioButton/Radio";

Check failure on line 9 in src/app/test/Staging.tsx

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'Radio'.

Check failure on line 9 in src/app/test/Staging.tsx

View workflow job for this annotation

GitHub Actions / build

Cannot find module '@/component/common/RadioButton/Radio' or its corresponding type declarations.
import RadioButtonGroup from "@/component/common/RadioButton/RadioButtonGroup";
import { useBottomSheet } from "@/hooks/useBottomSheet.ts";
import { CheckBox, CheckBoxGroup } from "@/component/common/checkBox";
import { Input, InputLabelContainer, Label } from "@/component/common/input";
import { Radio, RadioButtonGroup } from "@/component/common/radioButton";
import { useCheckBox } from "@/hooks/useCheckBox";
import { useInput } from "@/hooks/useInput";
import { useRadioButton } from "@/hooks/useRadioButton";
Expand Down
6 changes: 2 additions & 4 deletions src/component/common/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Props = {

const DEFAULT_ICON_COLOR = "#000000";

function Icon({ icon, color = DEFAULT_ICON_COLOR, size = "2rem", onClick, ...props }: Props) {
export const Icon = memo(function Icon({ icon, color = DEFAULT_ICON_COLOR, size = "2rem", onClick, ...props }: Props) {
// eslint-disable-next-line import/namespace
const SVGIcon = icons[icon];
const widthRem = typeof size === "number" ? `${size}rem` : size;
Expand All @@ -31,6 +31,4 @@ function Icon({ icon, color = DEFAULT_ICON_COLOR, size = "2rem", onClick, ...pro
{...props}
/>
);
}

export default memo(Icon);
});
1 change: 1 addition & 0 deletions src/component/common/Icon/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Icon } from "@/component/common/Icon/Icon";
2 changes: 1 addition & 1 deletion src/component/common/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from "@emotion/react";
import { useEffect, useRef } from "react";

import { Portal } from "@/component/common/Portal/Portal";
import { Portal } from "@/component/common/Portal";
import { useModal } from "@/hooks/useModal";

export function Modal() {
Expand Down
1 change: 1 addition & 0 deletions src/component/common/Modal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Modal } from "@/component/common/Modal/Modal";
1 change: 1 addition & 0 deletions src/component/common/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Portal } from "@/component/common/Portal/Portal";
4 changes: 2 additions & 2 deletions src/component/common/Toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from "@emotion/react";

import { Portal } from "@/component/common/Portal/Portal";
import { ToastItem } from "@/component/common/Toast/ToastItem";
import { Portal } from "@/component/common/Portal";
import { ToastItem } from "@/component/common/Toast";
import { useToast } from "@/hooks/useToast";

export function Toast() {
Expand Down
2 changes: 1 addition & 1 deletion src/component/common/Toast/ToastItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { css } from "@emotion/react";
import { useRef, useState } from "react";

import { Icon } from "@/component/common/Icon";
import { useToast } from "@/hooks/useToast";
import { ANIMATION } from "@/style/common/animation";
import { toastMap } from "@/style/common/toast";
import { ToastType } from "@/types/toast";
import { collapseToast } from "@/util/toast/collapseToast";
import Icon from "@/component/common/Icon/Icon";

export function ToastItem({ type, content, id, duration = 3000 }: ToastType) {
const { removeToast } = useToast();
Expand Down
2 changes: 2 additions & 0 deletions src/component/common/Toast/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Toast } from "./Toast";
export { ToastItem } from "./ToastItem";
2 changes: 1 addition & 1 deletion src/component/common/appBar/AppBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from "@emotion/react";
import { useNavigate } from "react-router-dom";

import Icon from "@/component/common/Icon/Icon";
import { Icon } from "@/component/common/Icon";

export type AppBarProps = {
title?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type CheckBoxProps = {
children: React.ReactNode;
};

const CheckBox = ({ value, children }: CheckBoxProps) => {
export function CheckBox({ value, children }: CheckBoxProps) {
const checkboxContext = useContext(CheckBoxContext);
return (
<ListItemCard variant={checkboxContext?.isChecked(value) ? "theme" : "default"}>
Expand Down Expand Up @@ -41,6 +41,4 @@ const CheckBox = ({ value, children }: CheckBoxProps) => {
/>
</ListItemCard>
);
};

export default CheckBox;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type CheckBoxGroupProps = {
children: React.ReactNode;
} & CheckBoxContextState;

const CheckBoxGroup = ({ children, ...props }: CheckBoxGroupProps) => {
export function CheckBoxGroup({ children, ...props }: CheckBoxGroupProps) {
return (
<div
css={css`
Expand All @@ -24,6 +24,4 @@ const CheckBoxGroup = ({ children, ...props }: CheckBoxGroupProps) => {
<CheckBoxContext.Provider value={props}>{children}</CheckBoxContext.Provider>
</div>
);
};

export default CheckBoxGroup;
}
2 changes: 2 additions & 0 deletions src/component/common/checkBox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { CheckBox } from "./CheckBox";
export { CheckBoxGroup } from "./CheckBoxGroup";
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type RadioProps = {
children: React.ReactNode;
};

const Radio = ({ value, children }: RadioProps) => {
export function Radio({ value, children }: RadioProps) {
const radioContext = useContext(RadioContext);
return (
<ListItemCard variant={radioContext?.isChecked(value) ? "theme" : "default"}>
Expand Down Expand Up @@ -42,6 +42,4 @@ const Radio = ({ value, children }: RadioProps) => {
/>
</ListItemCard>
);
};

export default Radio;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type RadioButtonGroupProps = {
children: React.ReactNode;
} & RadioContextState;

const RadioButtonGroup = ({ children, ...props }: RadioButtonGroupProps) => {
export function RadioButtonGroup({ children, ...props }: RadioButtonGroupProps) {
return (
<div
css={css`
Expand All @@ -25,6 +25,4 @@ const RadioButtonGroup = ({ children, ...props }: RadioButtonGroupProps) => {
<RadioContext.Provider value={props}>{children}</RadioContext.Provider>
</div>
);
};

export default RadioButtonGroup;
}
2 changes: 2 additions & 0 deletions src/component/common/radioButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Radio } from "./Radio";
export { RadioButtonGroup } from "./RadioButtonGroup";

0 comments on commit 2bfefcd

Please sign in to comment.