Skip to content

Commit

Permalink
Merge pull request #252 from TogetherCrew/fix/last-update-announcement
Browse files Browse the repository at this point in the history
update disable buttons statement
  • Loading branch information
mehdi-torabiv authored Feb 9, 2024
2 parents 1d127f6 + 6aea68d commit 25417a9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
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

0 comments on commit 25417a9

Please sign in to comment.