Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#73] 게시물 작성 페이지 구현 #102

Merged
merged 21 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
09627cb
fix: 헤더에 아이콘 높이 지정
minjeoong Jan 16, 2025
4ebbafc
feat: 게시물 생성 페이지 헤더 구성
minjeoong Jan 16, 2025
c527587
feat: 게시물 생성 페이지 글 작성 섹션까지
minjeoong Jan 16, 2025
1f84961
Merge remote-tracking branch 'origin/develop' into feat/#73/postWrite
minjeoong Jan 17, 2025
1f4c9a1
feat: textField state 하나 추가
minjeoong Jan 17, 2025
8fd4ae4
Merge remote-tracking branch 'origin/develop' into feat/#73/postWrite
minjeoong Jan 17, 2025
7223830
fix: fextField state 하나 추가
minjeoong Jan 17, 2025
a40d5da
Merge remote-tracking branch 'origin/develop' into feat/#73/postWrite
minjeoong Jan 17, 2025
cc64c04
feat: 드롭다운 구조 변경
minjeoong Jan 17, 2025
8d12c9e
Merge remote-tracking branch 'origin/develop' into feat/#73/postWrite
minjeoong Jan 17, 2025
fae909b
feat: 글쓰기 페이지 전체 구성
minjeoong Jan 17, 2025
46f3ad8
feat: 태그에 icon 따라서 변경되도록 수정, 이미지 ref 따라가도록 수정
minjeoong Jan 17, 2025
286768e
fix: bottomSheet 바닥에서 열리도록 수정, button 크기 조정
minjeoong Jan 17, 2025
bf02430
fix: bottomSheet 구조 변경
minjeoong Jan 17, 2025
72eb64a
feat: bottom sheet 열릴 때 스크롤 안되도록 구현
minjeoong Jan 17, 2025
573cea5
feat: x 버튼 안 보이는 것 살리기
minjeoong Jan 17, 2025
5d4604b
fix: chip 스크롤 바 제거
minjeoong Jan 17, 2025
95725fa
fix: bottomsheet 강아지, 고양이만 하나만 선택 가능하도록 수정
minjeoong Jan 17, 2025
84e7767
feat: tag 필터랑 동기화 작업
minjeoong Jan 17, 2025
0c0b1ac
feat: fill 다 채워져 있는지 확인하는 코드 추가
minjeoong Jan 17, 2025
4f4ccec
feat: 빌드 에러 해결
minjeoong Jan 17, 2025
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
4 changes: 4 additions & 0 deletions public/svgs/ic_ImagePlus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/ic_delete_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/ic_delete_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svgs/ic_rightArror.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/asset/svg/IcDeleteBlack.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from "react";
import type { SVGProps } from "react";
const SvgIcDeleteBlack = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
{...props}
>
<path
stroke="#222"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="m16.167 7.833-8.334 8.334m0-8.334 8.334 8.334"
/>
</svg>
);
export default SvgIcDeleteBlack;
19 changes: 19 additions & 0 deletions src/asset/svg/IcDeleteWhite.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from "react";
import type { SVGProps } from "react";
const SvgIcDeleteWhite = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 20 20"
{...props}
>
<path
stroke="#fff"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="m14.167 5.833-8.334 8.334m0-8.334 8.334 8.334"
/>
</svg>
);
export default SvgIcDeleteWhite;
17 changes: 17 additions & 0 deletions src/asset/svg/IcImagePlus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from "react";
import type { SVGProps } from "react";
const SvgIcImagePlus = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 167 167"
{...props}
>
<path fill="#D9D9D9" d="M0 0h167v167H0z" />
<path
fill="#222"
d="M76.255 93.414H51.338V78.78h24.917V53.863h14.502V78.78h25.049v14.634h-25.05v24.917H76.256z"
/>
</svg>
);
export default SvgIcImagePlus;
19 changes: 19 additions & 0 deletions src/asset/svg/IcRightArror.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from "react";
import type { SVGProps } from "react";
const SvgIcRightArror = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 20 20"
{...props}
>
<path
stroke="#717171"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="m7.5 15 5-5-5-5"
/>
</svg>
);
export default SvgIcRightArror;
19 changes: 11 additions & 8 deletions src/asset/svg/index.ts
Original file line number Diff line number Diff line change
@@ -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";
2 changes: 1 addition & 1 deletion src/common/component/BottomSheet/BottomSheet.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { semanticColor } from "@style/styles.css";
import { style } from "@vanilla-extract/css";

export const overlay = style({
position: "absolute",
position: "fixed",
Copy link
Collaborator

Choose a reason for hiding this comment

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

p5) 최고 ㅜ

top: 0,
left: 0,
zIndex: "99",
Expand Down
16 changes: 13 additions & 3 deletions src/common/component/CheckBoxText/CheckBoxText.tsx
Original file line number Diff line number Diff line change
@@ -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();
};
Expand All @@ -19,7 +23,13 @@ const CheckBoxText = ({ children, isSelected, onClick }: CheckBoxTextPropTypes)
onClick={handleClickTextBox}
>
<span style={{ width: "100%" }}>{children}</span>
{isSelected && <Check width={24} height={24} style={{ position: "relative", bottom: "3" }} />}
{isSelected && (
<Check
width={24}
height={24}
style={{ position: "relative", bottom: "3" }}
/>
)}
</div>
);
};
Expand Down
15 changes: 11 additions & 4 deletions src/common/component/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ interface ChipProps {

type CombinedChipProps = ChipProps & Exclude<ChipType, undefined>;

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);
Expand All @@ -37,6 +42,8 @@ const Chip = ({ label, icon = false, color = "blue", onClick, isSelected = false
{label}
{icon && (
<IcDelete
width={24}
height={24}
color={color === "gray" ? "#717171" : "#14B5F0"}
style={{
position: "relative",
Expand Down
2 changes: 2 additions & 0 deletions src/common/component/HeaderNav/HeaderNav.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ export const btnItem = recipe({
base: [
font.body01,
{
height: "2.4rem",
color: color.gray.gray600,
backgroundColor: "transparent",
padding: "0",
border: "none",
alignContent: "center",
textDecoration: "none",
transition: "background-color 0.3s",
":focus": {
Expand Down
48 changes: 32 additions & 16 deletions src/common/component/TextField/index.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
import React from "react";
import { styles } from "@common/component/TextField/styles.css.ts";
import {
InputVariants,
styles,
WrapVariants,
} from "@common/component/TextField/styles.css.ts";
import { IcClear } from "@asset/svg";

interface TextFieldProps {
icon?: React.ReactNode;
state?: "default" | "error" | "centerPlaceholder";
leftIcon?: React.ReactNode;
active?: boolean;
isDelete?: boolean;
placeholder?: string;
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
onClick?: () => void;
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => 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 입력값 변경 함수
* @param onClick input 클릭 함수
* @param onKeyDown 엔터키 입력 함수
* @param onClearClick 입력값 삭제 함수
* @constructor minjeoong
*/ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
*/

export const TextField = React.forwardRef<HTMLInputElement, propsType>(
(
{
icon,
leftIcon,
state = "default",
active = true,
placeholder = "검색어를 입력해주세요",
value,
isDelete = "true",
onChange,
onClick,
onKeyDown,
Expand All @@ -45,18 +58,21 @@ interface TextFieldProps {
) => {
return (
<div className={styles.wrapper({ state, active })} onClick={onClick}>
<input
ref={ref}
type="text"
className={styles.input({ state, active })}
placeholder={placeholder}
value={value}
onChange={onChange}
onKeyDown={onKeyDown}
disabled={!active}
maxLength={maxLength}
/>
{value ? <IcClear onClick={onClearClick} /> : icon}
<div className={styles.leftWrap()}>
{leftIcon && leftIcon}
Copy link
Collaborator

Choose a reason for hiding this comment

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

p5) 👍

<input
ref={ref}
type="text"
className={styles.input({ state, active })}
placeholder={placeholder}
value={value}
onChange={onChange}
onKeyDown={onKeyDown}
disabled={!active}
maxLength={maxLength}
/>
</div>
{value && isDelete ? <IcClear onClick={onClearClick} /> : icon}
</div>
);
}
Expand Down
22 changes: 21 additions & 1 deletion src/common/component/TextField/styles.css.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -12,13 +12,17 @@ export const styles = {
padding: "1rem 2rem",
border: `0.1rem solid ${color.gray.gray200}`,
borderRadius: "8px",
background: color.gray.gray000,
},
variants: {
state: {
default: {},
error: {
border: `0.1rem solid ${color.red.warning_red200}`,
},
write: {
padding: "1.2rem",
},
centerPlaceholder: { maxWidth: "12rem" },
},
active: {
Expand All @@ -36,13 +40,21 @@ export const styles = {
},
}),

leftWrap: recipe({
base: {
display: "flex",
alignItems: "center",
gap: "1rem",
},
}),
input: recipe({
base: [
font.body01,
{
letterSpacing: "-0.28px",
fontWeight: 500,
height: "auto",
maxWidth: "100%",
color: color.gray.gray900,
border: "none",
width: "100%",
Expand All @@ -64,6 +76,11 @@ export const styles = {
},
state: {
default: {},
write: {
"::placeholder": {
color: color.gray.gray600,
},
},
error: {},
centerPlaceholder: { maxWidth: "8rem", textAlign: "center" },
},
Expand All @@ -82,3 +99,6 @@ export const styles = {
},
}),
};

export type WrapVariants = RecipeVariants<typeof styles.wrapper>;
export type InputVariants = RecipeVariants<typeof styles.input>;
5 changes: 3 additions & 2 deletions src/page/community/component/DropDown/DropDown.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Copy link
Collaborator

Choose a reason for hiding this comment

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

p5) 이번 pr은 확실히 css 수정이 많네요 고생하셨어요!

maxWidth: "72.8rem",
borderRadius: "1.6rem",
boxShadow: "0px 2px 10px 0px rgba(0, 0, 0, 0.15)",
fontSize: "1.4rem",
Expand Down
Loading
Loading