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][Feat] #106 - AddChannel 페이지 구현 #161

Merged
merged 26 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
941ae50
[FE][Feat] #16 : InputComponent 구현
leedongyull Nov 6, 2024
ef9dc8d
[FE][FEAT] 페이지 구현
leedongyull Nov 7, 2024
4aea9e8
Merge branch 'main' of https://github.com/boostcampwm-2024/web28-DDar…
leedongyull Nov 7, 2024
d209411
[FE][FEAT] #106 : 기본 UI 구현
leedongyull Nov 10, 2024
be8cd95
Merge branch 'feature/fe/#134-makeLayoutComponent' of https://github.…
leedongyull Nov 11, 2024
7ae36c2
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 12, 2024
69c082c
[Fe][Rename] #106 : AddChannel 페이지 명 변경
leedongyull Nov 12, 2024
94f37b1
Merge branch 'feature/fe/#106-AddChannelUI' of https://github.com/boo…
leedongyull Nov 13, 2024
7297588
[FE][Fix] : Merge 작업
leedongyull Nov 13, 2024
180eda1
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 13, 2024
9b2ced0
[FE][Style] #106 : rem 단위로 변경 및 기획에 맞게 디자인 수정
leedongyull Nov 13, 2024
01a4683
[FE][Docs] #106 : tsDoc 설명 추가
leedongyull Nov 13, 2024
deb94fc
[FE][Style] #106 : 사용자 추가 버튼 height 추가
leedongyull Nov 14, 2024
bc28144
[FE][Feat] #106 : 사용자 삭제 UI 및 기능 간단히 구현
leedongyull Nov 14, 2024
5a1e8b2
[FE][Feat] #106 : 사용자 삭제 기능 구현 및 mock데이터 추가
leedongyull Nov 14, 2024
67169a6
[FE][Doc] #106 : 사용자 삭제 기능 tsDoc 추가
leedongyull Nov 14, 2024
5c6c96b
[FE][Feat] #106 : svg 대신 react-icons 사용
leedongyull Nov 14, 2024
31a1029
[FE][Style] #106 : 색상 변경 및 디자인 변경
leedongyull Nov 14, 2024
e4a8509
Delete package.json
leedongyull Nov 14, 2024
0cb24d8
Delete pnpm-lock.yaml
leedongyull Nov 14, 2024
3f948ee
Delete frontend/package.json
leedongyull Nov 14, 2024
65c9325
Delete backend/package.json
leedongyull Nov 14, 2024
0639b78
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 14, 2024
0d88c6a
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 14, 2024
5b98450
[FE][Feat] #106 : Footer 투명 추가
leedongyull Nov 14, 2024
f176c60
Merge branch 'feature/fe/#106-AddChannelUI' of https://github.com/boo…
leedongyull Nov 14, 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
66 changes: 33 additions & 33 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name": "ddara-backend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"description": "따라따라의 선따라길따라 BackEnd 코드",
"main": "index.js",
"scripts": {
"dev": "node src/index.js",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.1.1",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"express-validator": "^7.2.0",
"jsonwebtoken": "^9.0.2",
"pg": "^8.13.1",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"ws": "^8.11.0"
}
}
{
"name": "ddara-backend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"description": "따라따라의 선따라길따라 BackEnd 코드",
"main": "index.js",
"scripts": {
"dev": "node src/index.js",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.1.1",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"express-validator": "^7.2.0",
"jsonwebtoken": "^9.0.2",
"pg": "^8.13.1",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"ws": "^8.11.0"
}
}
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
128 changes: 64 additions & 64 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
{
"name": "ddara-frontend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource/pretendard": "^5.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.28.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-onboarding": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@types/navermaps": "^3.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"storybook": "^8.4.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.1"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
{
"name": "ddara-frontend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource/pretendard": "^5.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.28.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-onboarding": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@types/navermaps": "^3.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"storybook": "^8.4.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.1"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
10 changes: 9 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { UserRoute } from '@/pages/UserRoute';
import { DrawRoute } from '@/pages/DrawRoute';
import { HostView } from '@/pages/HostView';
import { GuestView } from '@/pages/GuestView';
import { Layout } from './component/Layout/Layout';

const ChannelRoutes = () => (
<Routes>
Expand All @@ -18,7 +19,14 @@ export const App = () => (
<Routes>
<Route path="/" element={<Main />} />
<Route path="/register" element={<Register />} />
<Route path="/add-channel" element={<AddChannel />} />
<Route
path="/add-channel"
element={
<Layout footerTitle="제작 완료">
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
<AddChannel />
</Layout>
}
/>
<Route path="/add-channel/:user" element={<UserRoute />} />
<Route path="/add-channel/:user/draw" element={<DrawRoute />} />
<Route path="/channel/:channelId/*" element={<ChannelRoutes />} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/component/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const Footer = (props: IFooterProps) => {
const buttonStyle = props.active ? buttonActiveType.ACTIVE : buttonActiveType.PASSIVE;

return (
<footer className="absolute bottom-5 w-[95%] h-[6%]">
<footer className="absolute bottom-5 h-[6%] w-[95%]">
<button
className={classNames(
'w-full',
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/component/Layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const Header = (props: IHeaderProps) => {
'w-full',
'h-16',
'p-4',
'flex ',
'items-center ',
'text-black ',
'flex',
'items-center',
'text-black',
'gap-[16px]',
background,
)}
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/component/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ interface ILayoutProps {
}

export const Layout = (props: ILayoutProps) => (
<div
className={classNames('flex', 'flex-col', 'items-center', 'w-full', 'h-full', 'bg-gray-400')}
>
<div className={classNames('flex', 'flex-col', 'items-center', 'h-[852px]', 'w-[393px]')}>
{/* Header */}
<Header
title={props.headerTitle}
Expand Down
28 changes: 28 additions & 0 deletions frontend/src/component/common/InputBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { ChangeEvent, FocusEvent } from 'react';

export interface IInputBoxProps {
type?: 'text' | 'number' | 'password' | 'email' | 'tel';
placeholder?: string;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
className?: string;
}

export const InputBox = ({
type = 'text',
placeholder = '',
onChange,
onFocus,
onBlur,
className = '',
}: IInputBoxProps) => (
<input
type={type}
placeholder={placeholder}
onChange={onChange}
onFocus={onFocus}
onBlur={onBlur}
className={`border-grayscale-75 focus:border-grayscale-400 flex h-11 w-full rounded border px-3 text-xs focus:border-2 focus:outline-none ${className}`}
/>
);
2 changes: 1 addition & 1 deletion frontend/src/component/maps/NaverMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ export const NaverMap = (props: INaverMapOptions) => {
}
}, []);

return <section ref={mapRef} className="w-full h-full" />;
return <section ref={mapRef} className="h-full w-full" />;
};
1 change: 1 addition & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
border-style: solid;
font-size: 100%;
font: inherit;
vertical-align: baseline;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import './index.css';
import { App } from './App2';
import { App } from './App';
// 우선은 폰트 다 포함시켰는데, 나중에 사용할 것들만 따로 뺴자.
import '@fontsource/pretendard/100.css';
import '@fontsource/pretendard/200.css';
Expand Down
63 changes: 62 additions & 1 deletion frontend/src/pages/AddChannel.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
export const AddChannel = () => <>Hello</>;
import { useState } from 'react';
import { InputBox } from '../component/common/InputBox';

interface IUser {
id: number;
name: string;
}

const Divider = () => <hr className="my-6 w-full border-gray-300" />;

export const AddChannel = () => {
const [users, setUsers] = useState<IUser[]>([{ id: 1, name: '사용자1' }]);

const addUser = () => {
if (users.length === 5) return;
const newUser: IUser = {
id: users.length + 1,
name: `사용자${users.length + 1}`,
};
setUsers([...users, newUser]);
};

return (
<main className="flex h-full w-full flex-col items-center px-8">
<InputBox placeholder="경로 이름을 입력해주세요. ex) 아들 집 가는 길" />
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
<Divider />
<section className="w-full space-y-4">
{users.map(user => (
<div className="flex flex-row items-center justify-center space-x-2" key={user.id}>
<div className="shadow-userName border-grayscale-200 flex h-12 w-16 items-center justify-center rounded-lg border text-xs">
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
{user.name}
</div>
<div className="text-grayscale-150 m-0 flex h-11 w-64 items-center justify-center rounded-md bg-gray-100 text-xs font-semibold">
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
클릭시 출발지/도착지, 경로 설정 가능
</div>
</div>
))}
</section>
<section className="my-4 flex flex-row items-center justify-center gap-[2px] text-xs text-gray-400">
<svg
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
xmlns="http://www.w3.org/2000/svg"
width="11px"
height="11px"
fill="black"
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
className="bi bi-info-circle-fill"
viewBox="0 0 16 16"
>
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2" />
</svg>
사용자 별로 출발지/도착지(마커), 경로(그림)을 설정할 수 있습니다.
</section>
<section className="flex w-full justify-end">
<button
onClick={addUser}
className="bg-grayscale-25 border-gray-75 w-64 rounded border p-2 text-xs"
>
사용자 추가
</button>
</section>
</main>
);
};
9 changes: 6 additions & 3 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ module.exports = {
colors: {
grayscale: {
white: '#FFFFFF',
25: '#FEFEFEF2',
leedongyull marked this conversation as resolved.
Show resolved Hide resolved
50: 'rgba(60, 60, 67, 0.36)',
100: '#B7B7B7',
25: '#FBFBFB',
50: '#A0AEC0',
75: '#E2E8F0',
100: '#EDF2F7',
150: '#AAB6C7',
200: '#6D6D6D',
400: '#555555',
800: '#3E3E3E',
Expand Down Expand Up @@ -48,6 +50,7 @@ module.exports = {
floatButton: '0 5px 10px rgba(0,0,0,0.3)',
floatMenuButton: '0 4px 4px rgba(0,0,0,0.25)',
float: '0 4px 20px rgba(0, 0, 0, 0.13)',
userName: '5px 4px 7.1px rgba(0, 0, 0, 0.05)',
basic: 'inset 0 0 3px rgba(0, 0, 0, 0.11)',
dark: '0px -6px 20px 0px rgba(0, 0, 0, 0.25)',
},
Expand Down
Loading