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

[FE] 방 생성, 수정 기능 추가(#743) #746

Merged
merged 43 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b0449dc
rename: 아래 화살표 버튼 plus에서 more로 변경
chlwlstlf Nov 9, 2024
8425976
feat: 방 생성하기 플로팅 버튼 생성
chlwlstlf Nov 9, 2024
ad90c04
feat: 달력, 시간 입력 error 속성 추가
chlwlstlf Nov 9, 2024
e0087ca
feat: ErrorText 공통 스타일 생성
chlwlstlf Nov 9, 2024
16983f0
feat: 방 생성 유효성 유틸 함수 만들기
chlwlstlf Nov 9, 2024
d74735a
refactor: Input 태그에서 글자수 태그에 absolute 제거
chlwlstlf Nov 9, 2024
61d487c
feat: 엔터키 눌러서 다음으로 이동하기
chlwlstlf Nov 9, 2024
3e0ad1c
feat: keyword 엔터로 추가, 클릭해서 삭제하기
chlwlstlf Nov 9, 2024
c426b26
fix: 키워드 입력할 때 다른 키도 허용
chlwlstlf Nov 9, 2024
847c327
design: 스켈레톤 세로 길이 변경
chlwlstlf Nov 11, 2024
372385a
fix: 로딩 중일 때 방 생성하기 클릭 안 되게 하기
chlwlstlf Nov 11, 2024
969ccad
feat: 키워드 호버했을 때 삭제 아이콘 표시
chlwlstlf Nov 11, 2024
377bc85
Merge branch 'develop' of https://github.com/woowacourse-teams/2024-c…
chlwlstlf Nov 13, 2024
8a84f3f
design: 글자수 확인 부분 absolute 제거
chlwlstlf Nov 13, 2024
41c179e
fix: input, textarea 글자수 absolute로 수정
chlwlstlf Nov 13, 2024
4e2d1f5
fix: textarea 글자수 absolute로 변경
chlwlstlf Nov 13, 2024
499897e
fix: 띄어쓰기만 입력했을 때는 생성 안 되게 하기
chlwlstlf Nov 13, 2024
e83793f
design: delete 아이콘 변경
chlwlstlf Nov 13, 2024
838984c
design: 방 생성 페이지 디자인 변경
chlwlstlf Nov 13, 2024
e6e7a06
Merge branch 'develop' of https://github.com/woowacourse-teams/2024-c…
chlwlstlf Nov 13, 2024
de38ed6
fix: isPrivate 필드 추가
chlwlstlf Nov 13, 2024
851e4d5
feat: 깃허브 링크 유효성 검사 함수 추가
chlwlstlf Nov 13, 2024
3761d5e
feat: 깃허브 링크 placeholder에 넣기
chlwlstlf Nov 14, 2024
2d3e307
feat: 방 상세페이지에서 수정 버튼 생성
chlwlstlf Nov 14, 2024
ad35966
feat: modal에서 버튼은 하단에, 닫기 버튼은 오른쪽 상단에 고정
chlwlstlf Nov 14, 2024
d540913
refactor: mocking 상태로 되돌리기
chlwlstlf Nov 14, 2024
372c407
fix: 로딩 중일 때만 방 생성하기 버튼 안 눌리기
chlwlstlf Nov 14, 2024
83623e0
design: 수정 버튼 모집 중, 방장일 때만 띄우기
chlwlstlf Nov 14, 2024
b813d5b
refactor: input forwardRef 제거
chlwlstlf Nov 14, 2024
4c61052
feat: 방 생성에서 안내 문구 추가
chlwlstlf Nov 14, 2024
d56d033
design: 방 정보에서 개행 인식하게 변경
chlwlstlf Nov 14, 2024
9067617
fix: isPrivate에서 isPublic으로 변경
chlwlstlf Nov 14, 2024
d93f379
feat: 레포지토리 공용 여부 안내 문구 추가
chlwlstlf Nov 14, 2024
1a3eec1
design: 상세 페이지 설명 글씨 줄이고 키워드 글씨 키우기
chlwlstlf Nov 15, 2024
e07f41c
feat: 방 상세페이지에 ControlButton 만들기
chlwlstlf Nov 15, 2024
4de4145
refactor: z-index 상수화하기
chlwlstlf Nov 15, 2024
2aace6c
feat: introPage에도 z-index 추가
chlwlstlf Nov 15, 2024
1b7dff7
feat: z-index에 header 추가
chlwlstlf Nov 15, 2024
75a4add
fix: 리뷰마감일 날짜 바꿨을 때 모집마감일 시간 바뀌는 오류 해결
chlwlstlf Nov 15, 2024
95e701e
feat: 깃허브 링크 유효성 검사 추가
chlwlstlf Nov 15, 2024
a541013
feat: selectedAction 생성해서 동적으로 모달 관리하기
chlwlstlf Nov 15, 2024
4bb672a
feat: 상세페이지 ControlButton 생성
chlwlstlf Nov 16, 2024
e699e6e
refactor: 유효성 검사 리팩토링
chlwlstlf Nov 16, 2024
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
8 changes: 6 additions & 2 deletions frontend/src/@types/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type IconKind =
| "person"
| "link"
| "calendar"
| "plus"
| "more"
| "star"
| "people"
| "pencil"
Expand All @@ -25,6 +25,10 @@ type IconKind =
| "close"
| "githubLogo"
| "notificationBell"
| "search";
| "search"
| "add"
| "delete"
| "edit"
| "control";

export default IconKind;
2 changes: 1 addition & 1 deletion frontend/src/@types/roomInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface BaseRoomInfo {
keywords: string[];
limitedParticipants: number;
classification: Classification;
isPrivate: boolean;
isPublic: boolean;
}
export interface CreateRoomInfo extends BaseRoomInfo {
recruitmentDeadline: Date;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/common/calendar/Calendar.style.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import styled from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

export const CalendarContainer = styled.section`
position: absolute;
z-index: 999;
z-index: ${Z_INDEX.dropdown};

width: 400px;
padding: 2rem;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/common/calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ const Calendar = ({ selectedDate, handleSelectedDate, options }: CalendarProps)
const checkIsAvailableClick = (day: number) => {
if (!options?.isPastDateDisabled) return true;

const targetDate = options.disabledBeforeDate || new Date();
const targetDate = new Date(options.disabledBeforeDate || new Date());
targetDate.setHours(0, 0, 0, 0);

const checkingDate = new Date(currentViewYear, currentViewMonth - 1, day);

return targetDate <= checkingDate;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const meta = {
description: "달력 날짜 선택 함수",
action: "selected",
},
error: {
control: {
type: "boolean",
},
},
},
} satisfies Meta<typeof CalendarDropdown>;

Expand All @@ -30,6 +35,7 @@ export const Default: Story = {
args: {
selectedDate: new Date(),
handleSelectedDate: () => {},
error: false,
},
render: (args) => {
const [selectedDate, setSelectedDate] = useState<Date>(args.selectedDate);
Expand All @@ -38,7 +44,13 @@ export const Default: Story = {
setSelectedDate(newSelectedDate);
};

return <CalendarDropdown selectedDate={selectedDate} handleSelectedDate={handleSelectedDate} />;
return (
<CalendarDropdown
selectedDate={selectedDate}
handleSelectedDate={handleSelectedDate}
error={false}
/>
);
},
};

Expand All @@ -49,6 +61,7 @@ export const 이전날짜_선택_불가_캘린더: Story = {
options: {
isPastDateDisabled: true,
},
error: false,
},
render: (args) => {
const [selectedDate, setSelectedDate] = useState<Date>(args.selectedDate);
Expand All @@ -62,6 +75,7 @@ export const 이전날짜_선택_불가_캘린더: Story = {
selectedDate={selectedDate}
handleSelectedDate={handleSelectedDate}
options={args.options}
error={false}
/>
);
},
Expand All @@ -74,6 +88,7 @@ export const 캘린더_드롭다운_에러: Story = {
options: {
isPastDateDisabled: true,
},
error: false,
},
render: (args) => {
const [selectedDate, setSelectedDate] = useState<Date>(args.selectedDate);
Expand All @@ -87,6 +102,7 @@ export const 캘린더_드롭다운_에러: Story = {
selectedDate={selectedDate}
handleSelectedDate={handleSelectedDate}
options={args.options}
error={false}
/>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const CalendarDropdownContainer = styled.section`
width: 130px;
`;

export const CalendarDropdownToggle = styled.input`
export const CalendarDropdownToggle = styled.input<{ $error: boolean }>`
cursor: pointer;

width: 100%;
Expand All @@ -15,7 +15,7 @@ export const CalendarDropdownToggle = styled.input`
text-align: center;
letter-spacing: 0.2rem;

border: 1px solid ${({ theme }) => theme.COLOR.grey1};
border: 1px solid ${({ theme, $error }) => ($error ? theme.COLOR.error : theme.COLOR.grey1)};
border-radius: 6px;
outline-color: ${({ theme }) => theme.COLOR.black};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import useDropdown from "@/hooks/common/useDropdown";
import Calendar, { CalendarProps } from "@/components/common/calendar/Calendar";
import { formatDate } from "@/utils/dateFormatter";

type CalendarDropdownProps = CalendarProps & InputHTMLAttributes<HTMLInputElement>;
type CalendarDropdownProps = CalendarProps &
InputHTMLAttributes<HTMLInputElement> & { error: boolean };

const CalendarDropdown = ({
selectedDate,
handleSelectedDate,
options,
error,
...rest
}: CalendarDropdownProps) => {
const { isDropdownOpen, handleToggleDropdown, dropdownRef } = useDropdown();
Expand All @@ -27,6 +29,7 @@ const CalendarDropdown = ({
value={formatDate(selectedDate)}
onClick={handleToggleDropdown}
placeholder="날짜를 선택하세요"
$error={error}
readOnly
{...rest}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const meta = {
description: "ContentSection 제목",
control: "text",
},
button: {
description: "ContentSection 버튼 (옵션)",
control: "object",
},
},
} satisfies Meta<typeof ContentSection>;

Expand All @@ -37,16 +33,3 @@ export const Default: Story = {
</ContentSection>
),
};

export const WithButton: Story = {
args: {
title: "버튼이 있는 ContentSection",
button: {
label: "클릭하세요",
onClick: () => alert("버튼이 클릭되었습니다!"),
},
},
render: (args) => (
<ContentSection {...args}>이 ContentSection에는 버튼이 포함되어 있습니다.</ContentSection>
),
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from "styled-components";

export const ContentSectionContainer = styled.div`
position: relative;
display: flex;
flex-direction: column;
gap: 1rem;
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/components/common/contentSection/ContentSection.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { ReactNode } from "react";
import Button, { ButtonProps } from "@/components/common/button/Button";
import * as S from "@/components/common/contentSection/ContentSection.style";

interface ContentSectionButton extends ButtonProps {
label: string;
}

interface ContentSectionProps {
title: string;
subtitle?: string;
controlSection?: ReactNode;
children?: ReactNode;
button?: ContentSectionButton | undefined;
}

const ContentSection = ({ title, subtitle, children, button }: ContentSectionProps) => {
const ContentSection = ({ title, subtitle, children, controlSection }: ContentSectionProps) => {
return (
<S.ContentSectionContainer>
<S.ContentSectionHeader>
Expand All @@ -22,11 +17,7 @@ const ContentSection = ({ title, subtitle, children, button }: ContentSectionPro
<S.ContentSectionSubtitle>{subtitle}</S.ContentSectionSubtitle>
</S.TitleContainer>

{button && (
<Button onClick={button.onClick} size="small">
{button.label}
</Button>
)}
{controlSection && controlSection}
</S.ContentSectionHeader>
{children}
</S.ContentSectionContainer>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/common/dropdown/Dropdown.style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { keyframes } from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

const dropdown = keyframes`
0% {
Expand Down Expand Up @@ -37,7 +38,7 @@ export const DropdownToggle = styled.button<{ $error: boolean }>`

export const DropdownMenu = styled.div`
position: absolute;
z-index: 1;
z-index: ${Z_INDEX.dropdown};
right: 0;

display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { keyframes } from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

const dropdown = keyframes`
0% {
Expand All @@ -17,7 +18,7 @@ export const ProfileContainer = styled.div`

export const DropdownMenu = styled.div`
position: absolute;
z-index: 1;
z-index: ${Z_INDEX.dropdown};
right: 0;

display: flex;
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/common/icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ import {
import { IoLogoGithub } from "react-icons/io";
import { IconType } from "react-icons/lib";
import {
MdAdd,
MdArrowBackIos,
MdArrowDropDown,
MdArrowForwardIos,
MdAutorenew,
MdCalendarMonth,
MdCheck,
MdClear,
MdDelete,
MdEdit,
MdExpandMore,
MdInfoOutline,
MdInsertLink,
MdMenu,
MdMoreHoriz,
MdNotificationsNone,
MdOutlineArrowDropDown,
MdOutlineArrowDropUp,
Expand All @@ -37,7 +41,7 @@ const ICON: { [key in IconKind]: IconType } = {
person: MdPerson,
link: MdInsertLink,
calendar: MdCalendarMonth,
plus: MdExpandMore,
more: MdExpandMore,
info: MdInfoOutline,
star: MdOutlineStar,
people: MdOutlinePeopleAlt,
Expand All @@ -61,6 +65,10 @@ const ICON: { [key in IconKind]: IconType } = {
githubLogo: IoLogoGithub,
notificationBell: MdNotificationsNone,
search: MdOutlineSearch,
add: MdAdd,
delete: MdDelete,
edit: MdEdit,
control: MdMoreHoriz,
};

interface IconProps {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/input/Input.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const StyledInput = styled.input<{ $error: boolean }>`

export const CharCount = styled.div`
position: absolute;
right: 10px;
right: 0;
bottom: -20px;

font: ${({ theme }) => theme.TEXT.xSmall};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Input = ({
{...rest}
/>
{showCharCount && (
<S.CharCount>
<S.CharCount aria-hidden>
{value.toString().length}
{rest.maxLength ? ` / ${rest.maxLength}자` : ""}
</S.CharCount>
Expand Down
53 changes: 53 additions & 0 deletions frontend/src/components/common/keyword/Keyword.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import styled from "styled-components";

export const KeywordContainer = styled.div`
display: flex;
flex-direction: column;
gap: 1rem;
`;

export const KeywordLabelContainer = styled.div`
display: flex;
flex-wrap: wrap;
gap: 1rem;
`;

export const KeywordButton = styled.button`
position: relative;

display: flex;
align-items: center;
justify-content: center;

width: fit-content;
height: fit-content;
padding: 0.4rem 0.8rem;

font: ${({ theme }) => theme.TEXT.small};
color: ${({ theme }) => theme.COLOR.grey4};
white-space: nowrap;

background-color: ${({ theme }) => theme.COLOR.grey0};
border: 1px solid ${({ theme }) => theme.COLOR.grey0};
border-radius: 15px;

svg {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

color: ${({ theme }) => theme.COLOR.white};

opacity: 0;
}

&:hover {
opacity: 0.5;
background-color: ${({ theme }) => theme.COLOR.grey3};
}

&:hover svg {
opacity: 1;
}
`;
Loading
Loading