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

Chip 부분만 revert하고 변경사항들은 반영 #929

Merged
merged 2 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions pages/post/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export default function PostPage() {
!!comment
);

console.log({ comments });

const handleClickComment = () => {
const refCurrent = commentRef.current;
if (refCurrent) {
Expand Down
59 changes: 0 additions & 59 deletions src/components/form/Presentation/JoinablePartsField/index.tsx

This file was deleted.

45 changes: 23 additions & 22 deletions src/components/form/Presentation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import TextInput from '../TextInput';
import ImagePreview from './ImagePreview';
import { MAX_FILE_SIZE } from '@type/form';
import NeedMentor from '../CheckBox/NeedMentor';
import { parts } from '@data/options';
import { useRouter } from 'next/router';
import { getPresignedUrl, uploadImage } from '@api/API_LEGACY/meeting';
import { imageS3Bucket } from '@constants/url';
Expand All @@ -21,7 +22,6 @@ import { fontsObject } from '@sopt-makers/fonts';
import { colors } from '@sopt-makers/colors';
import CheckSelectedIcon from '@assets/svg/checkBox/form_selected.svg';
import CheckUnselectedIcon from '@assets/svg/checkBox/form_unselected.svg';
import JoinablePartsField from '@components/form/Presentation/JoinablePartsField';
import { IconAlertCircle } from '@sopt-makers/icons';
import { useDialog } from '@sopt-makers/ui';
import sopt_schedule_tooltip from 'public/assets/images/sopt_schedule_tooltip.png';
Expand Down Expand Up @@ -431,23 +431,23 @@ function Presentation({
};
return (
<STargetFieldWrapper>
<STargetChipContainer>
<FormController
name="detail.joinableParts"
render={({ field: { value, onChange } }) => (
<JoinablePartsField value={value} onChange={onChange} />
)}
></FormController>
</STargetChipContainer>
<FormController
name="detail.joinableParts"
defaultValue={[parts[0]]}
render={({ field: { value, onChange, onBlur } }) => (
<Select options={parts} value={value} onChange={onChange} onBlur={onBlur} multiple />
)}
></FormController>

{/* 모집 인원 */}
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex' }}>
<SMemberCountWrapper>
<FormController
name="capacity"
render={({ field, fieldState: { error } }) => (
<TextInput
type="number"
placeholder="총 인원 수"
placeholder="인원"
right={<span style={{ marginLeft: '10px', color: '#a9a9a9' }}>명</span>}
required
{...field}
Expand Down Expand Up @@ -599,18 +599,19 @@ const SNeedMentorFieldWrapper = styled('div', {
});
const STargetFieldWrapper = styled('div', {
display: 'flex',
flexDirection: 'column',
gap: '$16',
alignItems: 'center',
gap: '10px',
marginBottom: '16px',
});
height: '52px',
'@tablet': {
height: '48px',
},

const STargetChipContainer = styled('div', {
display: 'flex',
gap: '$10',
flexWrap: 'wrap',
'@media(max-width: 525px)': {
flexDirection: 'column',
alignItems: 'flex-start',

'@media(max-width: 430px)': {
maxWidth: '320px',
marginBottom: '52px',
},
});

Expand Down Expand Up @@ -681,8 +682,8 @@ const SSectionCountBox = styled('div', {
});

const SMemberCountWrapper = styled('div', {
width: '119px',
height: '48px',
width: '94px',
height: '52px',
});

const SFormCheckBox = styled('div', {
Expand Down
3 changes: 3 additions & 0 deletions src/components/form/TableOfContents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ function TableOfContents({ label }: TableOfContentsProps) {
const isTitleValid = form.title && !errors.title;

const isCategoryValid = form.category?.value && !errors.category;
// console.log('카테고리', '' + form.category?.value, isCategoryValid);
const isImageValid = form.files && form.files.length > 0;
console.log('이미지', isImageValid);
const isDescriptionValid = form.detail && form.detail.desc && !errors.detail;
console.log('모임소개', isImageValid);
const isApplicationDateValid = form.startDate && form.endDate && !errors.startDate && !errors.endDate;
const isTargetValid =
form.detail &&
Expand Down
11 changes: 6 additions & 5 deletions src/components/form/TextInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,23 @@ const SContainer = styled('div', {
const SInputWrapper = styled('div', {
display: 'flex',
alignItems: 'center',

// height: '$48',
});
const SInput = styled('input', {
width: '100%',
padding: '11px 16px',
padding: '18px 20px',
display: 'flex',
alignItems: 'center',
fontAg: '16_medium_150',
lineHeight: '26px',
fontAg: '16_medium_100',
color: '$gray10',
background: '$gray800',
borderRadius: 10,
'&::placeholder': {
color: '$gray300',
},

'@tablet': {
padding: '16px',
},
});
const STextCount = styled('span', {
width: '100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dayjs.locale('ko');
import { PART_NAME } from '@constants/option';
import { useCallback, useRef, useState } from 'react';
import { GetMeetingResponse } from '@api/API_LEGACY/meeting';
import { Chip } from '@sopt-makers/ui';

interface InformationPanelProps {
detailData: GetMeetingResponse;
Expand Down Expand Up @@ -89,12 +88,9 @@ const InformationPanel = ({ detailData }: InformationPanelProps) => {
<STitle>{title}</STitle>
{title === '모집 대상' && (
<STarget>
{partList?.map(part => (
<Chip key={part} style={{ width: '80px', boxShadow: 'none' }} active>
{part}
</Chip>
))}
{generation}
대상 기수 : {generation}
<br />
대상 파트 : {partList?.join(', ')}
</STarget>
)}
<SDescription>{handleContent(content)}</SDescription>
Expand Down
4 changes: 2 additions & 2 deletions src/constants/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const PART_NAME: Record<string, string> = {
PM: '기획',
DESIGN: '디자인',
IOS: 'iOS',
ANDROID: 'Android',
ANDROID: '안드로이드',
SERVER: '서버',
WEB: '웹',
};
Expand All @@ -22,7 +22,7 @@ export const APPROVAL_STATUS_KOREAN_TO_ENGLISH: StringKeyObject = {
};
export const APPLICATION_TYPE = ['신청', '초대'];
export const CATEGORY_OPTIONS = ['스터디', '행사'];
export const PART_OPTIONS = ['기획', '디자인', 'Android', 'iOS', '웹', '서버'];
export const PART_OPTIONS = ['기획', '디자인', '안드로이드', 'iOS', '웹', '서버'];
export const PART_VALUES = ['PM', 'DESIGN', 'ANDROID', 'IOS', 'WEB', 'SERVER'];
export const ACTION_STATUS = ['모집 전', '모집 중', '모집 마감', '활동 중', '활동 종료'];

Expand Down
9 changes: 5 additions & 4 deletions src/data/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export const generationOptions = [
];

export const parts = [
{ label: '전체파트', value: 'all', order: 1 },
{ label: '대상 파트', value: null },
{ label: '전체', value: 'all', order: 1 },
{ label: '기획', value: 'PM', order: 2 },
{ label: '디자인', value: 'DESIGN', order: 3 },
{ label: '서버', value: 'SERVER', order: 7 },
{ label: 'iOS', value: 'IOS', order: 6 },
{ label: 'Android', value: 'ANDROID', order: 5 },
{ label: '웹', value: 'WEB', order: 4 },
{ label: '안드로이드', value: 'ANDROID', order: 5 },
{ label: 'iOS', value: 'IOS', order: 6 },
{ label: '서버', value: 'SERVER', order: 7 },
];
Loading