Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into today-name-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
kavigupta committed Jan 6, 2025
2 parents db1bb55 + 92e2a7d commit e7865d7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
3 changes: 2 additions & 1 deletion react/src/components/quiz-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ function QuizPanelNoResets(props: { quizDescriptor: QuizDescriptor, todayName?:
Promise.all(promises).then((newQuestions) => {
setWaitingForNextQuestion(false)
setQuestions([...questions, ...newQuestions.filter((question): question is QuizQuestion => question !== undefined)])
}).catch(() => {
}).catch((err: unknown) => {
console.error('Error fetching questions', err)
setWaitingForNextQuestion(false)
})
}
Expand Down
32 changes: 18 additions & 14 deletions react/src/quiz/quiz-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@ export function QuizResult(props: QuizResultProps): ReactNode {
)
}

export function buttonStyle(color: string): CSSProperties {
return {
textAlign: 'center',
fontSize: '2em',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
margin: '0 auto',
padding: '0.25em 1em',
backgroundColor: color,
borderRadius: '0.25em',
border: 'none',
color: '#fff',
}
}

interface ShareButtonProps {
buttonRef: React.RefObject<HTMLButtonElement>
todayName: string | undefined
Expand All @@ -164,20 +181,7 @@ function ShareButton({ buttonRef, todayName, correctPattern, quizKind }: ShareBu
return (
<button
className="serif"
style={{
textAlign: 'center',
fontSize: '2em',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
margin: '0 auto',
padding: '0.25em 1em',
backgroundColor: colors.hueColors.green,
borderRadius: '0.25em',
border: 'none',
color: '#fff',
}}
style={buttonStyle(colors.hueColors.green)}
ref={buttonRef}
onClick={async () => {
const [text, url] = await summary(juxtaColors, todayName, correctPattern, quizKind)
Expand Down

0 comments on commit e7865d7

Please sign in to comment.