Conversation
feb-dain
reviewed
Aug 14, 2023
| ))} | ||
| <Button sx={{ color: '#fff', wordBreak: 'keep-all' }} onClick={() => handleClickMenu()}> | ||
| {isLoggedIn ? '로그아웃' : '간편로그인'} | ||
| </Button>{' '} |
Comment on lines
+19
to
+22
| const AdminTableBody = <T, K extends keyof T>({ data, columns }: TableRowsProps<T, K>) => { | ||
| const { openModal } = modalActions; | ||
|
|
||
| const handleOpenModal = () => { | ||
| function handleOpenModal() { |
Contributor
There was a problem hiding this comment.
컴포넌트는 function, 이벤트 핸들러 등의 함수는 화살표 함수 써주세요
| const [tableData, setTableData] = useState(stationMockData); | ||
| const token = memberTokenStore.getState(); | ||
| const { lastPage, stationSummaryList } = useFetchStations(token, 1); | ||
| if (token === '') return <LoginModalContent />; |
| function App() { | ||
| const [tableTitle, setTableTitle] = useState('충전소 관리'); | ||
| const [tableColumn, setTableColumn] = useState(stationColumns); | ||
| const [tableData, setTableData] = useState(stationMockData); |
Comment on lines
+21
to
+48
| const memberColumns: ColumnType<MemberDetails, keyof MemberDetails>[] = [ | ||
| { | ||
| key: 'id', | ||
| header: 'ID', | ||
| }, | ||
| { | ||
| key: 'email', | ||
| header: 'E-MAIL', | ||
| }, | ||
| { | ||
| key: 'role', | ||
| header: '회원 권한', | ||
| }, | ||
| ]; | ||
| const faultReportColumns: ColumnType<FaultReportDetails, keyof FaultReportDetails>[] = [ | ||
| { | ||
| key: 'id', | ||
| header: 'ID', | ||
| }, | ||
| { | ||
| key: 'stationId', | ||
| header: '충전소 ID', | ||
| }, | ||
| { | ||
| key: 'memberId', | ||
| header: '회원 ID', | ||
| }, | ||
| ]; |
Contributor
There was a problem hiding this comment.
이렇게 만든 이유가 있을까요??
Suggested change
| const memberColumns: ColumnType<MemberDetails, keyof MemberDetails>[] = [ | |
| { | |
| key: 'id', | |
| header: 'ID', | |
| }, | |
| { | |
| key: 'email', | |
| header: 'E-MAIL', | |
| }, | |
| { | |
| key: 'role', | |
| header: '회원 권한', | |
| }, | |
| ]; | |
| const faultReportColumns: ColumnType<FaultReportDetails, keyof FaultReportDetails>[] = [ | |
| { | |
| key: 'id', | |
| header: 'ID', | |
| }, | |
| { | |
| key: 'stationId', | |
| header: '충전소 ID', | |
| }, | |
| { | |
| key: 'memberId', | |
| header: '회원 ID', | |
| }, | |
| ]; | |
| const faultReportColumns = { | |
| id: 'ID', | |
| stationId: '충전소 ID' | |
| .... | |
| } | |
| const faultRepoutColumnList = getTypedObjectEntries(faultReportColumns) |
이렇게 만들어서 쓰면 안되나요??
Contributor
Author
There was a problem hiding this comment.
저는 혹시 key, header 외의 다른 속성들을 넣을 수 있지 않을까라는 생각에 했습니다. 하지만 굳이 지금 단계에선 과하고 코드의 복잡도만 높아지겠네요 수정하겠습니다
Comment on lines
24
to
25
| '충전기 신고 관리', | ||
| '간편 로그인', | ||
| ] as const; |
Contributor
There was a problem hiding this comment.
간편 로그인 왜 사라졌죠? 🤔 처음에 로그인 해야만 보이는 걸로 바꿔서 없앴나요?
Contributor
Author
There was a problem hiding this comment.
아니요 간편 로그인은 클릭했을 때 간편로그인 창이 떠야하지만, 나머지 메뉴 버튼들은 table이 나와야해서 성격이 달라 map으로 적용하기가 어려운 부분이 있어서 성격이 비슷한 친구들만 묶었습니다..
| export const useFetchStations = (token: string, page: number) => { | ||
| const [lastPage, setLastPage] = useState(1); | ||
| const [stationSummaryList, setStationSummaryList] = useState<StationProps[]>([]); | ||
| const [stationSummaryList, setStationSummaryList] = useState<StationDetails[]>([]); |
Contributor
There was a problem hiding this comment.
타입 이름 stationSummary가 아닐까요?
Comment on lines
+56
to
+66
| export const misinformnationMockData = Array.from( | ||
| { length: ROWS_PER_PAGE }, | ||
| () => misinformationMock | ||
| ); | ||
|
|
||
| export function getMockData<T>(title: string): Array<T> { | ||
| switch (title) { | ||
| case '충전소 관리': | ||
| return stationMockData as Array<T>; | ||
| case '충전소 제보 관리': | ||
| return misinformnationMockData as Array<T>; |
Contributor
There was a problem hiding this comment.
misinformation으로 바꿔주세요~ 오타났습니다
| role: string; | ||
| } | ||
|
|
||
| const memberColumns: ColumnType<MemberDetails, keyof MemberDetails>[] = [ |
Contributor
There was a problem hiding this comment.
이게 왜 type에 있죠...? constant 아닌가요? 이하 동문입니다~
| key: 'role', | ||
| header: '회원 권한', | ||
| }, | ||
| ]; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📄 Summary
🕰️ Actual Time of Completion
🙋🏻 More
close #14