Skip to content

Commit

Permalink
Merge branch 'release-1.0.0' into forty
Browse files Browse the repository at this point in the history
  • Loading branch information
Aar-if authored Dec 4, 2024
2 parents 1f3a6cc + a8eb6dd commit e1612eb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@
"START_DATE_ERROR": "Start date cannot be later than end date.",
"END_DATE_ERROR": "End date cannot be earlier than start date.",
"IDENTIFIER_NOT_FOUND": "Identifier not found! Cannot Open Content!",
"SELECT_SESSION":"Please click on any session to schedule a session",
"MEETING_LINK_REQUIRED": "Please Enter Meeting Link!",
"WEEKDAY_ERROR": "Please select at least one weekday for the recurring event.",
"MULTIDAY_EVENT_ERROR": "Recurring events cannot span multiple days.",
Expand Down
8 changes: 5 additions & 3 deletions src/components/CenterSessionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const CenterSessionModal: React.FC<SessionsModalProps> = ({
secondary,
handlePrimaryModel,
handleEditModal,
disable=false
}) => {
const theme = useTheme<any>();
const { t } = useTranslation();
Expand Down Expand Up @@ -166,9 +167,9 @@ const CenterSessionModal: React.FC<SessionsModalProps> = ({
color="primary"
className="one-line-text"
sx={{
'&.Mui-disabled': {
backgroundColor: theme?.palette?.primary?.main,
},
// '&.Mui-disabled': {
// backgroundColor: theme?.palette?.primary?.main,
// },
minWidth: '84px',
padding: theme.spacing(1),
fontWeight: '500',
Expand All @@ -179,6 +180,7 @@ const CenterSessionModal: React.FC<SessionsModalProps> = ({
},
}}
onClick={handlePrimaryModel || handleEditModal}
disabled={disable}
>
{primary}
</Button>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/centers/[cohortId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ const CohortPage = () => {
React.useState(false);
const [openAddLearnerModal, setOpenAddLearnerModal] = React.useState(false);
const [openSchedule, setOpenSchedule] = React.useState(false);
const [disableNextButton, setDisableNextButton] = React.useState(true);

const [eventDeleted, setEventDeleted] = React.useState(false);
const [eventUpdated, setEventUpdated] = React.useState(false);
const [deleteModal, setDeleteModal] = React.useState(false);
Expand All @@ -178,6 +180,7 @@ const CohortPage = () => {
const [initialSlideIndex, setInitialSlideIndex] = useState<any>();

const handleClick = (selection: string) => {
setDisableNextButton(false);
setClickedBox(selection);
};

Expand All @@ -186,6 +189,7 @@ const CohortPage = () => {
};

const handleCentermodel = () => {

setOpenSchedule(true);
};

Expand Down Expand Up @@ -738,6 +742,7 @@ const CohortPage = () => {
: handleCentermodel
}
handleEditModal={handleEditEvent}
disable={onEditEvent?false: disableNextButton}
>
{deleteModal
? DeleteSession && <DeleteSession />
Expand All @@ -758,10 +763,16 @@ const CohortPage = () => {
/>
)
: Schedule && (
<>
{!clickedBox &&(<Typography sx={{m:2}}>
{t('CENTER_SESSION.SELECT_SESSION')}
</Typography>)}
<Schedule
clickedBox={clickedBox}
handleClick={handleClick}
/>
</>

)}
</CenterSessionModal>

Expand Down
1 change: 1 addition & 0 deletions src/utils/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export interface SessionsModalProps {
handlePrimaryModel?: () => void;
secondary?: string;
handleEditModal?: () => void;
disable?:boolean
}

export interface PlannedModalProps {
Expand Down

0 comments on commit e1612eb

Please sign in to comment.