Skip to content
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
11 changes: 5 additions & 6 deletions components/SummaryTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
const [creatingDoc, setCreatingDoc] = useState<boolean>(false);
const today = new Date().toISOString().split('T')[0];
const [selectedQuarter, setSelectedQuarter] = useState('');
const [creatingQuarterlyDoc, setCreatingQuarterlyDoc] = useState(false);
const quarterOptions = getQuarterOptions();

const defaultFormData = {
Expand Down Expand Up @@ -125,7 +124,7 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
const currentOrder = myVariable.agendaItemOrder ? myVariable.agendaItemOrder[myVariable.workgroup?.workgroup] : undefined;

async function handleCreateQuarterlyDoc() {
setCreatingQuarterlyDoc(true);
setCreatingDoc(true);

try {
const [quarter, year] = selectedQuarter.split(' ');
Expand All @@ -143,7 +142,7 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
console.error('Error creating Quarterly Google Doc:', error);
alert('There was an error creating the Quarterly Google Doc.');
} finally {
setCreatingQuarterlyDoc(false);
setCreatingDoc(false);
}
}

Expand Down Expand Up @@ -349,10 +348,10 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
type="button"
onClick={handleCreateQuarterlyDoc}
className={styles.exportButton}
disabled={creatingQuarterlyDoc || !selectedQuarter}
disabled={creatingDoc || !selectedQuarter}
>
{creatingQuarterlyDoc ? (
<span className={styles.flashingText}>Creating Quarterly Doc...</span>
{creatingDoc ? (
<span className={styles.flashingText}>Creating Google Doc...</span>
) : (
"Create Quarterly Google Doc"
)}
Expand Down
2 changes: 1 addition & 1 deletion styles/summarytemplate.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
margin-top: 0;
}

.quarterly-report-section .exportButton:disabled {
.exportButton:disabled {
background-color: #e0e0e0;
color: #a0a0a0;
cursor: not-allowed;
Expand Down