Skip to content

Commit c91e5f8

Browse files
authored
Merge pull request #98 from DevKor-github/fix/#96/post-todo
[#96] 포슀트 μžμž˜κ΅¬λ¦¬ν•œ λ””μžμΈ μˆ˜μ •
2 parents 4bafa8d + d238a8e commit c91e5f8

19 files changed

Lines changed: 257 additions & 84 deletions

File tree

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"react": "^19.1.0",
2323
"react-dom": "^19.1.0",
2424
"react-router": "^7.6.3",
25+
"react-textarea-autosize": "^8.5.9",
2526
"swiper": "^11.2.10",
2627
"zustand": "^5.0.6"
2728
},
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// μ±„νŒ…λ°© 듀어갔을 λ•Œ μ˜€λŠ” κ°’
2+
import client from '@/common/utils/client';
3+
import { useMutation } from '@tanstack/react-query';
4+
5+
const postChatRoom = async ({ chatRoomId }: { chatRoomId: number }) => {
6+
const res = await client.post(`/api/v1/chatroom/${chatRoomId}/enter`, null, {
7+
params: { pageSize: 5 },
8+
});
9+
10+
console.log(res.data.message);
11+
12+
return res;
13+
};
14+
15+
export const usePostChatRoom = () =>
16+
useMutation({
17+
mutationFn: postChatRoom,
18+
});

src/features/post/hooks/apis/usePostItem.ts renamed to src/features/post/apis/usePostItem.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import client from '@/common/utils/client';
2-
import { getPresignedUrl } from '../../apis/useGetPresignedUrl';
3-
import { s3PutImageToUrl } from '../../apis/usePutPresignedUrl';
4-
import type { PostItemRequest, PostPayload } from '../../types/post';
2+
import { getPresignedUrl } from './useGetPresignedUrl';
3+
import { s3PutImageToUrl } from './usePutPresignedUrl';
4+
import type { PostItemRequest, PostPayload } from '../types/post';
55
import type { ItemDetailResponse } from '@/features/detail/types';
66
import { useMutation } from '@tanstack/react-query';
77

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { ReactNode } from 'react';
2+
import * as s from './style.css';
3+
4+
interface Props {
5+
children: ReactNode;
6+
isIcon?: boolean;
7+
}
8+
9+
const AlertText = ({ children, isIcon }: Props) => {
10+
return (
11+
<div className={s.AlertText}>
12+
{isIcon && (
13+
<div className={s.Container}>
14+
<div className={s.Ellipse} />
15+
</div>
16+
)}
17+
{children}
18+
</div>
19+
);
20+
};
21+
22+
export default AlertText;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { css } from '@styled-system/css';
2+
3+
export const AlertText = css({
4+
display: 'flex',
5+
alignItems: 'center',
6+
gap: '0.25rem',
7+
color: '80',
8+
fontFamily: 'Pretendard',
9+
fontSize: '0.75rem',
10+
fontStyle: 'normal',
11+
fontWeight: '400',
12+
lineHeight: 'normal',
13+
letterSpacing: '-0.03rem',
14+
});
15+
16+
export const Container = css({
17+
w: '0.75rem',
18+
h: '0.75rem',
19+
aspectRatio: '1/1',
20+
display: 'flex',
21+
justifyContent: 'center',
22+
alignItems: 'center',
23+
});
24+
25+
export const Ellipse = css({
26+
w: '2px',
27+
h: '2px',
28+
borderRadius: 'full',
29+
backgroundColor: '80',
30+
});

β€Žsrc/features/post/components/InputField/index.tsxβ€Ž

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
import { MAX_PRICE } from '@/libs/constants';
22
import * as s from './style.css';
33
import { useState } from 'react';
4+
import { cx } from '@styled-system/css';
45

56
interface InputProps<T extends number | string> {
67
className?: string;
78
value: T;
89
setValue: (value: T) => void;
910
maxLength?: number;
11+
placeholder?: string;
1012
}
1113

12-
const InputField = <T extends number | string>({ className, value, setValue, maxLength }: InputProps<T>) => {
14+
const InputField = <T extends number | string>({
15+
className,
16+
value,
17+
setValue,
18+
maxLength,
19+
placeholder,
20+
}: InputProps<T>) => {
1321
const [isFocused, setIsFocused] = useState(false);
1422

1523
const isNumber = typeof value === 'number';
@@ -41,14 +49,15 @@ const InputField = <T extends number | string>({ className, value, setValue, max
4149

4250
return (
4351
<input
44-
className={`${s.Container({ isNumber })} ${className}`}
52+
className={cx(s.Container({ isNumber }), className, s.ContainerWithPlaceholder)}
4553
value={stringValue}
4654
onChange={handleChange}
4755
onFocus={handleFocus}
4856
onBlur={handleBlur}
4957
inputMode={isNumber ? 'numeric' : 'text'}
5058
pattern={isNumber ? '[0-9]*' : undefined}
5159
maxLength={maxLength}
60+
placeholder={placeholder}
5261
/>
5362
);
5463
};

β€Žsrc/features/post/components/InputField/style.css.tsβ€Ž

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { cva } from '@styled-system/css';
1+
import { css, cva } from '@styled-system/css';
22

33
export const Container = cva({
44
base: {
55
height: '2.75rem',
6-
backgroundColor: '#2C2C2E',
6+
backgroundColor: 'systemGray5',
77
padding: '0rem 1rem',
88
borderRadius: '0.375rem',
99
color: '100',
10-
opacity: '0.9',
1110
fontFamily: 'Pretendard',
1211
fontSize: '1rem',
1312
fontStyle: 'normal',
@@ -25,3 +24,9 @@ export const Container = cva({
2524
},
2625
},
2726
});
27+
28+
export const ContainerWithPlaceholder = css({
29+
_placeholder: {
30+
color: '54',
31+
},
32+
});
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
import type { TextareaHTMLAttributes } from 'react';
2+
import TextareaAutosize from 'react-textarea-autosize';
23
import * as s from './style.css';
34

45
const MultilineInputfield = (props: TextareaHTMLAttributes<HTMLTextAreaElement>) => {
5-
return <textarea className={s.Container} {...props}></textarea>;
6+
return (
7+
<div className={s.Container}>
8+
<TextareaAutosize
9+
minRows={3}
10+
onChange={props.onChange}
11+
maxLength={props.maxLength}
12+
value={props.value}
13+
placeholder={props.placeholder}
14+
className={s.InputField}
15+
/>
16+
<div className={s.MaxLength}>
17+
({typeof props.value === 'string' ? props.value.length : 0}/{props.maxLength})
18+
</div>
19+
</div>
20+
);
621
};
722

823
export default MultilineInputfield;
Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,46 @@
11
import { css } from '@styled-system/css';
22

33
export const Container = css({
4-
height: '8.625rem',
5-
backgroundColor: '#2C2C2E',
6-
width: '100%',
74
padding: '1rem',
5+
backgroundColor: 'systemGray5',
6+
width: '100%',
87
borderRadius: '0.375rem',
8+
display: 'flex',
9+
flexDir: 'column',
10+
gap: '1.5rem',
11+
});
12+
13+
export const InputField = css({
14+
w: '100%',
15+
h: '3.75rem',
916
color: '100',
10-
opacity: '0.9',
1117
fontFamily: 'Pretendard',
1218
fontSize: '1rem',
1319
fontStyle: 'normal',
1420
fontWeight: '400',
1521
lineHeight: '1.4',
1622
resize: 'none',
23+
'&::placeholder': {
24+
color: '54',
25+
},
1726
});
27+
28+
export const MaxLength = css({
29+
display: 'flex',
30+
justifyContent: 'end',
31+
fontSize: '0.6875rem',
32+
fontFamily: 'Pretendard',
33+
color: '80',
34+
fontStyle: 'normal',
35+
fontWeight: '400',
36+
lineHeight: '1.4',
37+
letterSpacing: '-0.0275rem',
38+
});
39+
40+
// color: var(--80, rgba(255, 255, 255, 0.80));
41+
// font-family: Pretendard;
42+
// font-size: 0.6875rem;
43+
// font-style: normal;
44+
// font-weight: 400;
45+
// line-height: 140%; /* 0.9625rem */
46+
// letter-spacing: -0.0275rem;

β€Žsrc/features/post/components/StepFunnel/Step2/style.css.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { css } from '@styled-system/css';
22

33
export const Grid = css({
44
display: 'grid',
5+
w: '100%',
56
gridTemplateColumns: 'repeat(2, 1fr)',
67
gap: '0.62rem',
78
});

0 commit comments

Comments
Β (0)