Skip to content

Commit

Permalink
Feat: Chat-136-레이아웃-작성 (#7)
Browse files Browse the repository at this point in the history
* Chore: 컬러 정의 추가 및 svg, font asset 다운로드

* Chore: 폰트 정의 추가

* Feat: AI 변경 화면 header UI 구현

* Feat: AI 변경 화면 UI 구현 (체크박스 제외)

* Feat: 변경 가능/불가능일 때 각각 버튼 UI 구현

* Feat: 라디오버튼 UI 구현

* Feat: AI 변경 버튼 선택에 따른 UI 변경 구현

* Feat: 상단 header 버튼으로 화면 전환 구현

* Feat: 변경 버튼 onClick 이벤트 추가 (내용 X)

* Chore: Button 컴포넌트 이름 변경

* Chore: ConfirmButton css 수정
  • Loading branch information
hyunn522 authored Jan 6, 2024
1 parent 8d312d9 commit 79721e9
Show file tree
Hide file tree
Showing 21 changed files with 526 additions and 46 deletions.
8 changes: 8 additions & 0 deletions src/assets/chat-profile-chichi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/chat-profile-dada.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions src/assets/chat-profile-lulu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/assets/chichi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/dada.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/ic-checkbox-empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/ic-checkbox-fill.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 src/assets/ic-left-chevron.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export { ReactComponent as Dada } from './dada.svg';
export { ReactComponent as Chichi } from './chichi.svg';
export { ReactComponent as Lulu } from './lulu.svg';
export { ReactComponent as ChatDada } from './chat-profile-dada.svg';
export { ReactComponent as ChatChichi } from './chat-profile-chichi.svg';
export { ReactComponent as ChatLulu } from './chat-profile-lulu.svg';
export { ReactComponent as LeftChevron } from './ic-left-chevron.svg';
73 changes: 73 additions & 0 deletions src/assets/lulu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/components/Buttons/ChangeRadioBtn.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import '../../styles/variables/colors.scss';
@import '../../styles/variables/fonts.scss';

.changeRadio {
appearance: none;
width: 24px;
height: 24px;
margin: 0 0 0 3px;
background: url('../../assets/ic-checkbox-empty.svg');

&:checked {
background: url('../../assets/ic-checkbox-fill.svg');
}
}
20 changes: 20 additions & 0 deletions src/components/Buttons/ChangeRadioBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import styles from './ChangeRadioBtn.module.scss';

interface Props {
id: number;
onChange: (id: number) => void;
}

const ChangeRadioBtn = ({ id, onChange }: Props) => {
return (
<input
type="radio"
name="group"
id={`${id}`}
className={styles.changeRadio}
onChange={() => onChange(id)}
></input>
);
};

export default ChangeRadioBtn;
28 changes: 28 additions & 0 deletions src/components/Buttons/ConfirmButton.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@import '../../styles/variables/colors.scss';
@import '../../styles/variables/fonts.scss';

.changeBtn {
all: initial;
position: absolute;
bottom: 12px;

display: flex;
width: calc(100% - 32px);
height: min-content;
margin: 0 16px;
padding: 14px 0px;
justify-content: center;
align-items: center;
border-radius: 8px;
@include btn;
color: $BK70;
background-color: $BK30;
pointer-events: none; // 클릭 불가능하게 설정

&.abled {
// 버튼을 선택한 상태
background-color: $primary_default;
color: $WH;
pointer-events: auto; // 클릭 가능하게 설정
}
}
21 changes: 21 additions & 0 deletions src/components/Buttons/ConfirmButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styles from './ConfirmButton.module.scss';

interface Props {
children: string;
isAble: boolean;
id: number;
onClick: (id: number) => void;
}

const ChangeButton = ({ children, isAble, id, onClick }: Props) => {
return (
<button
className={`${styles.changeBtn} ${isAble ? styles.abled : ''}`}
onClick={() => onClick(id)}
>
{children}
</button>
);
};

export default ChangeButton;
18 changes: 18 additions & 0 deletions src/components/Headers/ChangeHeader.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import '../../styles/variables/colors.scss';
@import '../../styles/variables/fonts.scss';

.changeHeader {
display: flex;
justify-content: center;
padding: 15px 0px;

& :first-child {
position: absolute;
left: 15px;
}

& span {
@include sub18;
color: $BK90;
}
}
19 changes: 19 additions & 0 deletions src/components/Headers/ChangeHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useNavigate } from 'react-router-dom';
import { LeftChevron } from '../../assets';
import styles from './ChangeHeader.module.scss';

interface Props {
children: string;
}
const ChangeHeader = ({ children }: Props) => {
const navigate = useNavigate();

return (
<div className={styles.changeHeader}>
<LeftChevron onClick={() => navigate('/chat')} />
<span>{children}</span>
</div>
);
};

export default ChangeHeader;
15 changes: 15 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* font 설정 */
@font-face {
font-family: 'Pretendard-Bold';
src: url('./assets/fonts/Pretendard-Bold.woff');
}

@font-face {
font-family: 'Pretendard-SemiBold';
src: url('./assets/fonts/Pretendard-SemiBold.woff');
}

@font-face {
font-family: 'Pretendard-Regular';
src: url('./assets/fonts/Pretendard-Regular.woff');
}
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';

const root = ReactDOM.createRoot(
Expand Down
Loading

0 comments on commit 79721e9

Please sign in to comment.