Skip to content
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

update disable buttons statement #252

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function TcPublicMessageContainer({
</div>
</TcSelect>
</FormControl>
<div className="flex flex-col space-x-1">
<div className="flex flex-col">
<TcText text="Write message here:" variant="subtitle1" />
<TcText
text="Our bot will distribute the announcement through selected channels with the required access to share the designated message."
Expand Down
14 changes: 12 additions & 2 deletions src/pages/announcements/create-new-announcements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,12 @@ function CreateNewAnnouncements() {
<TcButton
text="Save as Draft"
variant="outlined"
disabled={!scheduledAt}
disabled={
!scheduledAt ||
!isDateValid ||
publicAnnouncements?.template == '' ||
publicAnnouncements?.options.channelIds?.length === 0
}
sx={{
maxWidth: {
xs: '100%',
Expand All @@ -257,7 +262,12 @@ function CreateNewAnnouncements() {
selectedRoles={roles}
selectedUsernames={users}
schaduledDate={scheduledAt || ''}
isDisabled={!scheduledAt || !isDateValid}
isDisabled={
!scheduledAt ||
!isDateValid ||
publicAnnouncements?.template == '' ||
publicAnnouncements?.options.channelIds?.length === 0
}
handleCreateAnnouncements={(e) =>
handleCreateAnnouncements(e)
}
Expand Down
7 changes: 6 additions & 1 deletion src/pages/announcements/edit-announcements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,12 @@ function Index() {
selectedRoles={roles}
selectedUsernames={users}
schaduledDate={scheduledAt || ''}
isDisabled={!scheduledAt || !isDateValid}
isDisabled={
!scheduledAt ||
!isDateValid ||
publicAnnouncements?.template == '' ||
publicAnnouncements?.options.channelIds?.length === 0
}
handleCreateAnnouncements={(e) => handleEditAnnouncements(e)}
/>
</div>
Expand Down
Loading