-
Notifications
You must be signed in to change notification settings - Fork 3
[Feat/#14] 학생회비 납부자 페이지 구현 #32
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
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
5b970e4
feat: shadcn 버튼, 체크박스 추가
daun-up 4bad500
style: tailwind.config 변경
daun-up 7872725
feat: 학생회비 납부자 조회하기 ui 퍼블리싱
daun-up e973281
chore: package.json @radix-ui/react-label 추가
daun-up b58080a
chore: package.json @radix-ui/react-label 추가
daun-up 0444313
fix: eslint 수정
daun-up adb2423
feat: 이름 등록 input 구현
daun-up a296f7e
feat: 학번 등록 input 구현
daun-up 43f0818
feat: button 컴포넌트에 primary, secondary 속성 추가
daun-up 40969c9
feat: sidebar sheet 컴포넌트 구현
daun-up cc4eec7
chore: yarn.lock
daun-up d2b7626
chore: package.json
daun-up 385267c
fix: yarn.lock 충돌 문제
daun-up 564ca0c
init: 모바일 뷰를 위한 레이아웃 구현
hyeonjin6530 36d5dfb
feat: 관리자 대시보드 기본적인 퍼블리싱
sinji2102 fed7402
feat: mobile header 공통 컴포넌트 svg 제외 구현
sinji2102 7907fa1
feat: svg 포함 구현
sinji2102 7ea2941
chore: hamburger 오타 수정
sinji2102 a32a863
feat: 명세서에 맞춰 기본적인 컴포넌트 연결
sinji2102 71c60e7
feat: 시간 변환 함수 구현
sinji2102 f54ff97
feat: 대시보드 svg 아이콘 세팅
sinji2102 1f4c54a
chore: 불필요한 use client 제거
sinji2102 12bb630
fix: yarn.lock 충돌 문제
sinji2102 df3cb1d
feat: NotificationItem 배경색, 폰트 색, 아이콘 제외 퍼블리싱
sinji2102 941d61c
design: 세팅에 없는 색 추가 및 svg 경로 수정
sinji2102 661511e
feat: 명세서에 맞춰 타입 수정
sinji2102 25a2553
feat: 알림 타입 const, 시간 계산 함수 추가
sinji2102 0e28f51
design: 디자인 시스템 네이밍 밀린 거 수정
sinji2102 b840b16
feat: 알림 상태별 색상 지정
sinji2102 360b277
feat: 유저 알림 퍼블리싱 및 타입 오류 해결
sinji2102 bf2025e
rename: 컨벤션에 맞도록 NotificationItem 컴포넌트 경로 수정
sinji2102 da13e89
feat: 알림 페이지 헤더 적용 및 헤더 높이 수정
sinji2102 00d5853
fix: svg 오류 해결
sinji2102 f20bff8
comment: 주석 제거
sinji2102 62f3ef8
style: const 띄어쓰기 오타 수정
sinji2102 5264ab2
feat: 드롭다운 공통 컴포넌트 hook 생성
sinji2102 1e2f110
feat: 위치 커스텀 가능하도록 수정
sinji2102 155deae
style: 인라인 스타일을 사용하지 않도록 수정
sinji2102 b9543b7
comment: 필요없는 주석 제거
sinji2102 c591214
feat: 드롭다운 연결
sinji2102 3a0c094
feat: 드롭다운 기능 연결 및 버튼 텍스트 수정
sinji2102 c19d409
fix: yarn build시 나오는 함수 오류 수정
sinji2102 bca6634
fix: svg allow 관련 config 파일 수정
sinji2102 b128f37
fix: frontend 파일 제거
sinji2102 8ecd412
fix: 완료 버튼 위치 변경
daun-up df80e38
comment: 불필요한 주석 삭제
daun-up a99ebda
feat: 삭제 버튼 위치 변경 및 스타일 수정
daun-up b993ec6
Merge branch 'develop' into feat/#14-sidebar-sheet
daun-up File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,3 +38,5 @@ yarn-error.log* | |
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| *.idea | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daun-up marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,193 @@ | ||
| import Sidebar from '@/components/desktop/SideBar'; | ||
| 'use client'; | ||
|
|
||
| import Sidebar from 'src/components/desktop/Sidebar'; | ||
| import Search from '@/components/desktop/Search'; | ||
| import { useState } from 'react'; | ||
| import AddStudentId from '@/components/desktop/AddStudentId'; | ||
| import { Button } from '@/components/ui/button'; | ||
| import TableComponent from './_components/TableComponent'; | ||
| import AddInput from '../../../components/desktop/AddInput'; | ||
|
|
||
| const dummyData = [ | ||
| { name: '조다운', student_id: '20223139', admin: true }, | ||
| { name: '조다운', student_id: '20223139', admin: true }, | ||
| { name: '조다운', student_id: '20223139', admin: false }, | ||
| { name: '이정욱', student_id: '20223888', admin: true }, | ||
| { name: '윤신지', student_id: '20223122', admin: false }, | ||
| { name: '황수민', student_id: '20223130', admin: true }, | ||
| ]; | ||
|
|
||
| const dummyData2 = [ | ||
| { name: '조다운', student_id: '20223139' }, | ||
| { name: '황현진', student_id: '20223158' }, | ||
| ]; | ||
|
|
||
| export default function PayerInquiryPage() { | ||
| const [data, setData] = useState(dummyData); // 기존 데이터 | ||
| const [addedData, setAddedData] = useState(dummyData2); // 추가된 데이터 | ||
| const [isDeleteModeOriginal, setIsDeleteModeOriginal] = useState(false); // 기존 데이터 삭제 모드 | ||
| const [isDeleteModeAdded, setIsDeleteModeAdded] = useState(false); // 추가된 데이터 삭제 모드 | ||
| const [selectedOriginal, setSelectedOriginal] = useState<string[]>([]); // 기존 데이터에서 선택된 항목 | ||
| const [selectedAdded, setSelectedAdded] = useState<string[]>([]); // 추가된 데이터에서 선택된 항목 | ||
|
|
||
| const [newStudentId, setNewStudentId] = useState(''); | ||
| const [newStudentName, setNewStudentName] = useState(''); | ||
|
|
||
| // 학번 입력 핸들러 | ||
| const handleStudentIdChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
| setNewStudentId(e.target.value); | ||
| }; | ||
|
|
||
| // 이름 입력 핸들러 | ||
| const handleStudentNameChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
| setNewStudentName(e.target.value); | ||
| }; | ||
|
|
||
| // 추가 버튼 클릭 시 실행될 함수 | ||
| const handleAddStudent = () => { | ||
| if (!newStudentId || !newStudentName) { | ||
| alert('이름과 학번을 입력해주세요.'); | ||
| return; | ||
| } | ||
|
|
||
| // 학번이 8자리 숫자인지 검증 | ||
| const studentIdPattern = /^\d{8}$/; | ||
| if (!studentIdPattern.test(newStudentId)) { | ||
| alert('학번은 8자리 숫자로 입력해야 합니다.'); | ||
| return; | ||
| } | ||
daun-up marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const newEntry = { name: newStudentName, student_id: newStudentId }; | ||
| setAddedData([...addedData, newEntry]); // 추가된 데이터 업데이트 | ||
| setNewStudentId(''); | ||
| setNewStudentName(''); | ||
| }; | ||
|
|
||
| // 기존 데이터 삭제 | ||
| const handleDeleteOriginal = () => { | ||
| const updatedData = data.filter( | ||
| (item) => !selectedOriginal.includes(item.student_id), | ||
| ); | ||
| setData(updatedData); | ||
| setIsDeleteModeOriginal(false); | ||
| setSelectedOriginal([]); | ||
| }; | ||
|
|
||
| // 추가된 데이터 삭제 | ||
| const handleDeleteAdded = () => { | ||
| const updatedData = addedData.filter( | ||
| (item) => !selectedAdded.includes(item.student_id), | ||
| ); | ||
| setAddedData(updatedData); | ||
| setIsDeleteModeAdded(false); | ||
| setSelectedAdded([]); | ||
| }; | ||
|
|
||
| // 기존 데이터 삭제 모드 토글 | ||
| const toggleDeleteModeOriginal = () => { | ||
| setIsDeleteModeOriginal((prev) => !prev); | ||
| setSelectedOriginal([]); | ||
| }; | ||
|
|
||
| // 추가된 데이터 삭제 모드 토글 | ||
| const toggleDeleteModeAdded = () => { | ||
| setIsDeleteModeAdded((prev) => !prev); | ||
| setSelectedAdded([]); | ||
| }; | ||
|
|
||
| const api = () => { | ||
| console.log('api 적용할 곳입니다.'); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="flex flex-col justify-center gap-8 px-64"> | ||
| <div className="flex flex-col justify-center gap-8 px-4 md:px-16 lg:px-64"> | ||
| <div className="pt-20 text-center"> | ||
| <p className="text-2xl">학생회비 납부자 조회하기</p> | ||
| </div> | ||
| <div className="flex justify-center gap-4"> | ||
| <div className="flex flex-wrap justify-center gap-2"> | ||
| <Search /> | ||
| <Sidebar | ||
| triggerText="새로운 납부자 추가하기" | ||
| title="Settings" | ||
| description="Manage your preferences" | ||
| title="학생회비 납부자 추가하기" | ||
| description="설명" | ||
| > | ||
daun-up marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <p>Here you can change your account settings.</p> | ||
| <div className="flex w-full flex-col items-center justify-center"> | ||
| <div className="flex items-end justify-center gap-4"> | ||
| <AddStudentId | ||
| value={newStudentId} | ||
| onChange={handleStudentIdChange} | ||
| /> | ||
| <AddInput | ||
| value={newStudentName} | ||
| onChange={handleStudentNameChange} | ||
| onClick={handleAddStudent} | ||
| /> | ||
| </div> | ||
| <div className="flex w-full flex-col"> | ||
| <TableComponent | ||
| data={addedData} | ||
| headers={['추가된 이름', '추가된 학번']} | ||
| showCheckboxes={isDeleteModeAdded} | ||
| selected={selectedAdded} | ||
| setSelected={setSelectedAdded} | ||
| /> | ||
| <div className="flex justify-end gap-2"> | ||
| <Button | ||
| size="sm" | ||
| type="button" | ||
| variant="deleteSecondary" | ||
| onClick={toggleDeleteModeAdded} | ||
| > | ||
| {isDeleteModeAdded ? '취소' : '삭제'} | ||
| </Button> | ||
| {isDeleteModeAdded && ( | ||
| <Button | ||
| size="sm" | ||
| variant="deletePrimary" | ||
| type="button" | ||
| onClick={handleDeleteAdded} | ||
| > | ||
| 완료 | ||
| </Button> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div className="bottom-0 flex justify-center gap-2 pt-10"> | ||
| <Button type="button" variant="primary" onClick={api}> | ||
| 적용하기 | ||
| </Button> | ||
| </div> | ||
| </Sidebar> | ||
| </div> | ||
| <TableComponent data={dummyData} /> | ||
| <div className="flex flex-col justify-between"> | ||
| <TableComponent | ||
| data={data} | ||
| showCheckboxes={isDeleteModeOriginal} | ||
| selected={selectedOriginal} | ||
| setSelected={setSelectedOriginal} | ||
| /> | ||
| <div className="flex justify-end gap-2"> | ||
| <Button | ||
| size="sm" | ||
| type="button" | ||
| variant="deleteSecondary" | ||
| onClick={toggleDeleteModeOriginal} | ||
| > | ||
| {isDeleteModeOriginal ? '취소' : '삭제'} | ||
| </Button> | ||
|
|
||
| {isDeleteModeOriginal && ( | ||
| <Button | ||
| type="button" | ||
| size="sm" | ||
| variant="deleteSecondary" | ||
| className={`btn whitespace-nowrap rounded-md px-3 py-2 text-sm text-white-primary ${isDeleteModeOriginal ? 'bg-gray-primary' : 'bg-gray-secondary'}`} | ||
| onClick={handleDeleteOriginal} | ||
| > | ||
| 완료 | ||
| </Button> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { Input } from '@/components/ui/input'; | ||
| import { Plus } from 'lucide-react'; | ||
|
|
||
| interface AddInputProps { | ||
| value: string; | ||
| onClick: () => void; | ||
| onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
| } | ||
|
|
||
| export default function AddInput({ onClick, value, onChange }: AddInputProps) { | ||
| return ( | ||
| <Input | ||
| Icon={ | ||
| <Plus | ||
| className="h-5 w-5 cursor-pointer text-muted-foreground" | ||
| onClick={onClick} | ||
| /> | ||
| } | ||
| value={value} | ||
| onChange={onChange} | ||
| placeholder="이름을 입력해주세요." | ||
| /> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.