Skip to content

Commit

Permalink
Merge branch 'fix/COT-100-resolve-attendance-mobile-issue' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Donghyun Hwang committed Dec 30, 2024
2 parents 5437b97 + b1eeabf commit 694d205
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"browserslist": "^4.18.1",
"camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"cotato-openapi-clients": "2.241122.0-attendance.2",
"cotato-openapi-clients": "2.241229.0",
"craco-alias": "^3.0.1",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.2.0",
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Attendance/List/AttendanceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ const AttendanceList = () => {
CotatoMemberAttendResponseOpenStatusEnum.Absent,
] as CotatoMemberAttendResponseOpenStatusEnum[];

attendance.openStatus = CotatoMemberAttendResponseOpenStatusEnum.Open;

if (
allowedAttendanceStatus.includes(
attendance.openStatus as CotatoMemberAttendResponseOpenStatusEnum,
Expand Down
13 changes: 12 additions & 1 deletion src/pages/Attendance/Report/AttendanceReportSubFilterActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import styled from 'styled-components';
import { useAttendanceReportFilter } from '../hooks/useAttendanceReportFilter';
import { useMatch } from 'react-router-dom';
import { STATUS_ASSETS } from '../constants';
import { useBreakpoints } from '@/hooks/useBreakpoints';
import { media } from '@theme/media';

//
//
Expand All @@ -14,6 +16,7 @@ import { STATUS_ASSETS } from '../constants';
const AttendanceReportSubFilterActions = () => {
//
const { currentStatus, toggleStatus } = useAttendanceReportFilter();
const { isMobileOrSmaller } = useBreakpoints();

/**
*
Expand Down Expand Up @@ -43,7 +46,7 @@ const AttendanceReportSubFilterActions = () => {
toggleStatus(status);
}}
>
{icon}
{isMobileOrSmaller ? null : icon}
<StyledTypography $disabled={disabled}>{text}</StyledTypography>
</StyledButton>
))}
Expand Down Expand Up @@ -83,10 +86,18 @@ const StyledButton = styled.button<{ $selected?: boolean; $disabled?: boolean }>
opacity: ${({ $disabled }) => ($disabled ? 0.8 : 1)};
cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};
${media.mobile`
height: 2.25rem;
`}
`;

const StyledTypography = styled(Typography)<{ $disabled?: boolean }>`
color: ${({ theme }) => theme.colors.common.black_const};
color: ${({ theme, $disabled }) =>
$disabled ? theme.colors.gray10 : theme.colors.common.black_const};
${media.mobile`
font-size: 0.75rem !important;
`}
`;
9 changes: 8 additions & 1 deletion src/pages/Attendance/Report/AttendanceReportSubFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ const AttendanceReportSubFilters = () => {
//
//
return (
<Stack direction="row" alignItems="center" justifyContent="space-between" width="100%">
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
width="100%"
flexWrap="wrap"
gap="0.75rem"
>
<AttendanceReportSubFilterActions />
<AttendanceReportSearch />
</Stack>
Expand Down
8 changes: 1 addition & 7 deletions src/pages/Attendance/Report/AttendanceReportTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ const AttendanceReportTable = () => {
</AttedanceTableLayout.TableCell>
<AttedanceTableLayout.TableCell>
<AttendanceStatusDropdown
status={
ATTENDANCE_ASSETS_TEXT_MAP[
record.result as keyof typeof ATTENDANCE_ASSETS_TEXT_MAP
]
}
status={record.result}
memberId={record?.memberInfo?.memberId}
attendanceId={attendanceId}
/>
Expand Down Expand Up @@ -175,8 +171,6 @@ const AttendanceReportTable = () => {
record.memberInfo?.name?.toLowerCase().includes(search.toLowerCase()),
);

console.log(filteredRecords);

setCurrentRecords(filteredRecords);
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4754,10 +4754,10 @@ cosmiconfig@^7, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
path-type "^4.0.0"
yaml "^1.10.0"

cotato-openapi-clients@2.241122.0-attendance.2:
version "2.241122.0-attendance.2"
resolved "https://registry.yarnpkg.com/cotato-openapi-clients/-/cotato-openapi-clients-2.241122.0-attendance.2.tgz#aa80dd9cd8785b54ef7589e8941bc45d1f69196d"
integrity sha512-OpL47pYA6cym+Reb8C7YrPuJDV9amRtNOcAtuvRpASgrVUWdwTCMHYctGrk1hv1qBbmdn0HWiOuB9mAUel/bTA==
cotato-openapi-clients@2.241229.0:
version "2.241229.0"
resolved "https://registry.yarnpkg.com/cotato-openapi-clients/-/cotato-openapi-clients-2.241229.0.tgz#e4b2949313ec55f2b049e3441b6e3976b8019420"
integrity sha512-VMPZI3YPrDLydoWkXDxZHNSlyzbRyqTTYzE4/gitiyp83+paypYngZq8tvbDQf1CWmnfIHS3Ggkqi1bV59fv8Q==
dependencies:
"@openapitools/openapi-generator-cli" "^2.13.4"
"@testing-library/jest-dom" "^5.17.0"
Expand Down

0 comments on commit 694d205

Please sign in to comment.