Skip to content

Commit

Permalink
Merge pull request #430 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-2670 & 2671 feat: status indicators on planned sessions and changes in weekdays
  • Loading branch information
itsvick authored Nov 26, 2024
2 parents 3c6d8f4 + 64fd2ae commit 610ddf1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/PlannedSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,8 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
</Typography>

<WeekDays
useAbbreviation={true}
// useAbbreviation={true}
multiselect={true}
selectedDays={
selectedDays?.length
? editSession?.recurrencePattern?.daysOfWeek
Expand Down
3 changes: 2 additions & 1 deletion src/components/SessionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ const SessionsCard: React.FC<SessionsCardProps> = ({
>
<Box>
<Box display={'flex'} gap={1.5}>
{data?.isRecurring === false ? getStatusIcon() : ''}
{/* {data?.isRecurring === false ? getStatusIcon() : ''} */}
{getStatusIcon()}
<Typography
color={theme.palette.warning['300']}
fontWeight={'400'}
Expand Down
8 changes: 5 additions & 3 deletions src/components/WeekDays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ interface WeekDaysProps {
useAbbreviation?: boolean;
onSelectionChange?: (selectedDays: string[]) => void;
selectedDays?: any[];
multiselect?: boolean;
}

const WeekDays: React.FC<WeekDaysProps> = ({
useAbbreviation,
onSelectionChange,
selectedDays = [],
multiselect,
}) => {
const theme = useTheme<any>();
const [localSelectedDays, setLocalSelectedDays] = useState<number[]>([]);
Expand Down Expand Up @@ -105,14 +107,14 @@ const WeekDays: React.FC<WeekDaysProps> = ({
key={`${day}-${index}`}
ref={index === currentDayIndex ? selectedItemRef : null}
style={{
backgroundColor: useAbbreviation
backgroundColor: multiselect
? localSelectedDays.includes(index)
? theme.palette.primary.main
: 'inherit'
: index === currentDayIndex
? theme.palette.primary.main
: 'inherit',
cursor: useAbbreviation ? 'pointer' : 'default',
cursor: multiselect ? 'pointer' : 'default',
border: `1px solid ${theme?.palette?.warning['A100']}`,
borderRadius: '4px',
justifyContent: 'center',
Expand All @@ -122,7 +124,7 @@ const WeekDays: React.FC<WeekDaysProps> = ({
>
<Box
className="card flex-center"
sx={{ width: 'auto', height: '50px' }}
sx={{ width: '2.6rem', height: '50px' }}
>
<CardContent align-item="center">
<Typography
Expand Down

0 comments on commit 610ddf1

Please sign in to comment.