diff --git a/public/svgs/ic_ImagePlus.svg b/public/svgs/ic_ImagePlus.svg new file mode 100644 index 00000000..cc83ca50 --- /dev/null +++ b/public/svgs/ic_ImagePlus.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/svgs/ic_delete_black.svg b/public/svgs/ic_delete_black.svg new file mode 100644 index 00000000..cc7a1d98 --- /dev/null +++ b/public/svgs/ic_delete_black.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/svgs/ic_delete_white.svg b/public/svgs/ic_delete_white.svg new file mode 100644 index 00000000..494e5e5e --- /dev/null +++ b/public/svgs/ic_delete_white.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/svgs/ic_rightArror.svg b/public/svgs/ic_rightArror.svg new file mode 100644 index 00000000..ecd2f18a --- /dev/null +++ b/public/svgs/ic_rightArror.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/asset/svg/IcDeleteBlack.tsx b/src/asset/svg/IcDeleteBlack.tsx new file mode 100644 index 00000000..575cecd5 --- /dev/null +++ b/src/asset/svg/IcDeleteBlack.tsx @@ -0,0 +1,19 @@ +import * as React from "react"; +import type { SVGProps } from "react"; +const SvgIcDeleteBlack = (props: SVGProps) => ( + + + +); +export default SvgIcDeleteBlack; diff --git a/src/asset/svg/IcDeleteWhite.tsx b/src/asset/svg/IcDeleteWhite.tsx new file mode 100644 index 00000000..8683584e --- /dev/null +++ b/src/asset/svg/IcDeleteWhite.tsx @@ -0,0 +1,19 @@ +import * as React from "react"; +import type { SVGProps } from "react"; +const SvgIcDeleteWhite = (props: SVGProps) => ( + + + +); +export default SvgIcDeleteWhite; diff --git a/src/asset/svg/IcImagePlus.tsx b/src/asset/svg/IcImagePlus.tsx new file mode 100644 index 00000000..5529ef5f --- /dev/null +++ b/src/asset/svg/IcImagePlus.tsx @@ -0,0 +1,17 @@ +import * as React from "react"; +import type { SVGProps } from "react"; +const SvgIcImagePlus = (props: SVGProps) => ( + + + + +); +export default SvgIcImagePlus; diff --git a/src/asset/svg/IcRightArror.tsx b/src/asset/svg/IcRightArror.tsx new file mode 100644 index 00000000..3bb40af0 --- /dev/null +++ b/src/asset/svg/IcRightArror.tsx @@ -0,0 +1,19 @@ +import * as React from "react"; +import type { SVGProps } from "react"; +const SvgIcRightArror = (props: SVGProps) => ( + + + +); +export default SvgIcRightArror; diff --git a/src/asset/svg/index.ts b/src/asset/svg/index.ts index df50e6dd..1ce46ff0 100644 --- a/src/asset/svg/index.ts +++ b/src/asset/svg/index.ts @@ -1,31 +1,34 @@ +export { default as Check } from "./Check"; export { default as IcBottomSheetLine } from "./IcBottomSheetLine"; export { default as IcEllipse57 } from "./IcEllipse57"; +export { default as IcImagePlus } from "./IcImagePlus"; export { default as IcNormal } from "./IcNormal"; export { default as IcRightIcon } from "./IcRightIcon"; export { default as IcShape } from "./IcShape"; export { default as IcChevronLeft } from "./IcChevronLeft"; export { default as IcChevronRight } from "./IcChevronRight"; +export { default as IcClear } from "./IcClear"; export { default as IcDelete } from "./IcDelete"; +export { default as IcDeleteBlack } from "./IcDeleteBlack"; +export { default as IcDeleteWhite } from "./IcDeleteWhite"; export { default as IcEditPen } from "./IcEditPen"; export { default as IcEllipses } from "./IcEllipses"; +export { default as IcLeftarrow } from "./IcLeftarrow"; export { default as IcLogo } from "./IcLogo"; export { default as IcMessage } from "./IcMessage"; export { default as IcOut } from "./IcOut"; export { default as IcPlus } from "./IcPlus"; +export { default as IcPostImageSkeleton } from "./IcPostImageSkeleton"; +export { default as IcRightArror } from "./IcRightArror"; +export { default as IcSearch } from "./IcSearch"; +export { default as IcSearchFillter } from "./IcSearchFillter"; +export { default as IcSearchFillterBlue } from "./IcSearchFillterBlue"; export { default as IcSettings } from "./IcSettings"; export { default as IcTest } from "./IcTest"; export { default as IcToastError } from "./IcToastError"; -export { default as Check } from "./Check"; export { default as IcUp } from "./IcUp"; export { default as IcoMessage } from "./IcoMessage"; export { default as IcoSkeleton } from "./IcoSkeleton"; export { default as Plus } from "./Plus"; export { default as React } from "./React"; export { default as Vite } from "./Vite"; -export { default as IcClear } from "./IcClear"; -export { default as IcLeftarrow } from "./IcLeftarrow"; -export { default as IcPostImageSkeleton } from "./IcPostImageSkeleton"; -export { default as IcSearch } from "./IcSearch"; -export { default as IcSearchFillter } from "./IcSearchFillter"; -export { default as IcSearchFillterBlue } from "./IcSearchFillterBlue"; -export { default as IcRight } from "./IcRight"; diff --git a/src/common/component/BottomSheet/BottomSheet.css.ts b/src/common/component/BottomSheet/BottomSheet.css.ts index 3d11fe40..9553c669 100644 --- a/src/common/component/BottomSheet/BottomSheet.css.ts +++ b/src/common/component/BottomSheet/BottomSheet.css.ts @@ -2,7 +2,7 @@ import { semanticColor } from "@style/styles.css"; import { style } from "@vanilla-extract/css"; export const overlay = style({ - position: "absolute", + position: "fixed", top: 0, left: 0, zIndex: "99", diff --git a/src/common/component/CheckBoxText/CheckBoxText.tsx b/src/common/component/CheckBoxText/CheckBoxText.tsx index e48b0f19..21842a3a 100644 --- a/src/common/component/CheckBoxText/CheckBoxText.tsx +++ b/src/common/component/CheckBoxText/CheckBoxText.tsx @@ -1,12 +1,16 @@ import { checkboxText } from "./CheckBoxText.css"; -import { Check } from "@asset/svg"; +import Check from "@asset/svg/Check.tsx"; interface CheckBoxTextPropTypes { children: string; isSelected: boolean; onClick: () => void; } -const CheckBoxText = ({ children, isSelected, onClick }: CheckBoxTextPropTypes) => { +const CheckBoxText = ({ + children, + isSelected, + onClick, +}: CheckBoxTextPropTypes) => { const handleClickTextBox = () => { onClick(); }; @@ -19,7 +23,13 @@ const CheckBoxText = ({ children, isSelected, onClick }: CheckBoxTextPropTypes) onClick={handleClickTextBox} > {children} - {isSelected && } + {isSelected && ( + + )} ); }; diff --git a/src/common/component/Chip/Chip.tsx b/src/common/component/Chip/Chip.tsx index 62bcf6b7..3e094fa8 100644 --- a/src/common/component/Chip/Chip.tsx +++ b/src/common/component/Chip/Chip.tsx @@ -12,14 +12,19 @@ interface ChipProps { type CombinedChipProps = ChipProps & Exclude; -const Chip = ({ label, icon = false, color = "blue", onClick, isSelected = false }: CombinedChipProps) => { - +const Chip = ({ + label, + icon = false, + color = "blue", + onClick, + isSelected = false, +}: CombinedChipProps) => { const [isActive, setIsActive] = useState(isSelected); - + useEffect(() => { setIsActive(isSelected); }, [isSelected]); - + const handleClick = () => { if (color === "gray" || (size === "large" && icon === false)) return; if (!icon) setIsActive(!isActive); @@ -37,6 +42,8 @@ const Chip = ({ label, icon = false, color = "blue", onClick, isSelected = false {label} {icon && ( ) => void; + onChange?: (e: React.ChangeEvent) => void; onClick?: () => void; onKeyDown?: (e: React.KeyboardEvent) => void; onClearClick?: () => void; maxLength?: number; // input 입력 가능길이 } +type propsType = WrapVariants & TextFieldProps & InputVariants; + /** * TextField 공통 컴포넌트 * @param icon 오른쪽 아이콘 + * @param leftIcon 왼쪽 아이콘 * @param state 상태 (default, error) * @param active 활성화 여부 + * @param isDelete value 가 생기면 삭제 아이콘 표시 여부 * @param placeholder placeholder * @param value 입력값 * @param onChange 입력값 변경 함수 @@ -27,14 +36,18 @@ interface TextFieldProps { * @param onKeyDown 엔터키 입력 함수 * @param onClearClick 입력값 삭제 함수 * @constructor minjeoong - */ export const TextField = React.forwardRef( + */ + +export const TextField = React.forwardRef( ( { icon, + leftIcon, state = "default", active = true, placeholder = "검색어를 입력해주세요", value, + isDelete = "true", onChange, onClick, onKeyDown, @@ -45,18 +58,21 @@ interface TextFieldProps { ) => { return (
- - {value ? : icon} +
+ {leftIcon && leftIcon} + +
+ {value && isDelete ? : icon}
); } diff --git a/src/common/component/TextField/styles.css.ts b/src/common/component/TextField/styles.css.ts index 972d59c1..f684c0fb 100644 --- a/src/common/component/TextField/styles.css.ts +++ b/src/common/component/TextField/styles.css.ts @@ -1,4 +1,4 @@ -import { recipe } from "@vanilla-extract/recipes"; +import { recipe, RecipeVariants } from "@vanilla-extract/recipes"; import { color, font } from "@style/styles.css.ts"; export const styles = { @@ -12,6 +12,7 @@ export const styles = { padding: "1rem 2rem", border: `0.1rem solid ${color.gray.gray200}`, borderRadius: "8px", + background: color.gray.gray000, }, variants: { state: { @@ -19,6 +20,9 @@ export const styles = { error: { border: `0.1rem solid ${color.red.warning_red200}`, }, + write: { + padding: "1.2rem", + }, centerPlaceholder: { maxWidth: "12rem" }, }, active: { @@ -36,6 +40,13 @@ export const styles = { }, }), + leftWrap: recipe({ + base: { + display: "flex", + alignItems: "center", + gap: "1rem", + }, + }), input: recipe({ base: [ font.body01, @@ -43,6 +54,7 @@ export const styles = { letterSpacing: "-0.28px", fontWeight: 500, height: "auto", + maxWidth: "100%", color: color.gray.gray900, border: "none", width: "100%", @@ -64,6 +76,11 @@ export const styles = { }, state: { default: {}, + write: { + "::placeholder": { + color: color.gray.gray600, + }, + }, error: {}, centerPlaceholder: { maxWidth: "8rem", textAlign: "center" }, }, @@ -82,3 +99,6 @@ export const styles = { }, }), }; + +export type WrapVariants = RecipeVariants; +export type InputVariants = RecipeVariants; diff --git a/src/page/community/component/DropDown/DropDown.css.ts b/src/page/community/component/DropDown/DropDown.css.ts index 44d9044a..42fe1fc1 100644 --- a/src/page/community/component/DropDown/DropDown.css.ts +++ b/src/page/community/component/DropDown/DropDown.css.ts @@ -2,9 +2,10 @@ import { createVar, style } from "@vanilla-extract/css"; import { color, font } from "@style/styles.css.ts"; export const container = style({ + position: "absolute", backgroundColor: "white", - margin: "0 2rem", - width: "calc(100% - 4rem)", + width: "calc(100vw - 4rem)", + maxWidth: "72.8rem", borderRadius: "1.6rem", boxShadow: "0px 2px 10px 0px rgba(0, 0, 0, 0.15)", fontSize: "1.4rem", diff --git a/src/page/community/component/DropDown/DropDown.tsx b/src/page/community/component/DropDown/DropDown.tsx index 74764ed5..9c2233a1 100644 --- a/src/page/community/component/DropDown/DropDown.tsx +++ b/src/page/community/component/DropDown/DropDown.tsx @@ -4,13 +4,23 @@ import React from "react"; type DropDownType = { isOpen: boolean; items: Array<{ icon: React.ReactNode; label: string }>; - onClickItem: (item: string) => void; + onClickItem: (target: string, value: string) => void; + toggleDropDown: () => void; }; -const DropDown = ({ isOpen, items, onClickItem }: DropDownType) => { +const DropDown = ({ + isOpen, + items, + onClickItem, + toggleDropDown, +}: DropDownType) => { if (!isOpen) { return; } + const onClick = (label: string) => { + onClickItem("category", label); + toggleDropDown(); + }; return (
@@ -18,7 +28,7 @@ const DropDown = ({ isOpen, items, onClickItem }: DropDownType) => {
onClickItem(item.label)} + onClick={() => onClick(item.label)} > {item.icon} {item.label} diff --git a/src/page/community/component/ImageCover/ImageCover.css.ts b/src/page/community/component/ImageCover/ImageCover.css.ts new file mode 100644 index 00000000..2b7660b3 --- /dev/null +++ b/src/page/community/component/ImageCover/ImageCover.css.ts @@ -0,0 +1,32 @@ +import { createVar, style } from "@vanilla-extract/css"; +import { color, font } from "@style/styles.css.ts"; + +export const container = style({ + position: "relative", + borderRadius: "0.8rem", +}); + +export const deleteButton = style({ + position: "absolute", + right: 0, + top: 0, + zIndex: 3, +}); + +export const ghost = style({ + position: "absolute", + top: 0, + left: 0, + width: "10.4rem", + height: "10.4rem", + zIndex: 1, + borderRadius: "0.8rem", + background: + "linear-gradient(0deg, rgba(217, 217, 217, 0.00) 0%, rgba(115, 115, 115, 0.30) 100%)", +}); + +export const image = style({ + width: "10.4rem", + height: "10.4rem", + borderRadius: "0.8rem", +}); diff --git a/src/page/community/component/ImageCover/ImageCover.tsx b/src/page/community/component/ImageCover/ImageCover.tsx new file mode 100644 index 00000000..b87204ac --- /dev/null +++ b/src/page/community/component/ImageCover/ImageCover.tsx @@ -0,0 +1,33 @@ +import { container, deleteButton, ghost, image } from "./ImageCover.css.ts"; +import React from "react"; +import { IcDeleteWhite } from "@asset/svg"; + +interface ImageSlideType { + key: number; + imageSrc: string; + onDeleteClick: (id: number) => void; +} + +/** + * 이미지 백그라운드에 그라디언트 적용 및 X 아이콘 + * @param key 삭제할 때 사용할 이미지 id + * @param imageSrc + * @param onDeleteClick + * @constructor + */ + +const ImageCover = ({ key, imageSrc, onDeleteClick }: ImageSlideType) => { + return ( +
+ onDeleteClick(key)} + /> + image +
+
+ ); +}; + +export default ImageCover; diff --git a/src/page/community/component/Tag/Tag.tsx b/src/page/community/component/Tag/Tag.tsx index 33fc3ab6..fdf98a99 100644 --- a/src/page/community/component/Tag/Tag.tsx +++ b/src/page/community/component/Tag/Tag.tsx @@ -1,24 +1,19 @@ import { tagContainer } from "@page/community/component/Tag/Tag.css.ts"; -import { IcLeftarrow, IcRight } from "@asset/svg"; import React from "react"; import { color } from "@style/styles.css.ts"; +import IcRight from "@asset/svg/IcRight.tsx"; interface tagType { - label: string; - value?: string; - setTag: (tag: string) => void; + placeholder: string; + value?: string | undefined; + onClick: () => void; + isActive: boolean; } -const Tag = ({ label, value, setTag }: tagType) => { - const isActive = value === label; - - const onClickTag = () => { - setTag(label); - }; - +const Tag = ({ placeholder, value, onClick, isActive }: tagType) => { return ( -