-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tailwind (should merge after cleanup) #18
Conversation
<motion.div | ||
initial={{ scale: 0 }} | ||
animate={{ scale: 1 }} | ||
className="flex gap-2" | ||
> | ||
{currentSectionNumber !== 0 && ( | ||
<button | ||
type="button" | ||
onClick={() => setSectionNumber(currentSectionNumber - 1)} | ||
className="btn btn-secondary flex items-center gap-2" | ||
> | ||
<ArrowLeft className="w-4 h-4" /> | ||
Previous | ||
</button> | ||
)} | ||
{currentSectionNumber !== sections.length - 1 && ( | ||
<button | ||
type="button" | ||
onClick={() => setSectionNumber(currentSectionNumber + 1)} | ||
className="btn btn-primary flex items-center gap-2" | ||
> | ||
Next | ||
<ArrowRight className="w-4 h-4" /> | ||
</button> | ||
)} | ||
</motion.div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider moving this to a variable or different component, currently it is way too nested.
{areYouSure ? ( | ||
<motion.div | ||
initial={{ opacity: 0, scale: 0.95 }} | ||
animate={{ opacity: 1, scale: 1 }} | ||
exit={{ opacity: 0, scale: 0.95 }} | ||
className="absolute bottom-full mb-2 right-0 bg-white rounded-lg shadow-lg p-4 min-w-[200px] dark:bg-dark-card dark:border dark:border-dark-border" | ||
> | ||
<div className="flex items-center gap-2 text-amber-600 mb-3 dark:text-amber-500"> | ||
<AlertTriangle className="w-5 h-5" /> | ||
<span className="font-medium dark:text-dark-text">Are you sure?</span> | ||
</div> | ||
<div className="flex justify-end gap-2"> | ||
<button | ||
type="button" | ||
onClick={() => setAreYouSure(false)} | ||
className="btn btn-secondary flex items-center gap-2" | ||
> | ||
<X className="w-4 h-4" /> | ||
No | ||
</button> | ||
<button | ||
type="button" | ||
onClick={onClick} | ||
className="btn btn-primary flex items-center gap-2" | ||
> | ||
<Check className="w-4 h-4" /> | ||
Yes | ||
</button> | ||
</div> | ||
</motion.div> | ||
) : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{areYouSure ? ( | |
<motion.div | |
initial={{ opacity: 0, scale: 0.95 }} | |
animate={{ opacity: 1, scale: 1 }} | |
exit={{ opacity: 0, scale: 0.95 }} | |
className="absolute bottom-full mb-2 right-0 bg-white rounded-lg shadow-lg p-4 min-w-[200px] dark:bg-dark-card dark:border dark:border-dark-border" | |
> | |
<div className="flex items-center gap-2 text-amber-600 mb-3 dark:text-amber-500"> | |
<AlertTriangle className="w-5 h-5" /> | |
<span className="font-medium dark:text-dark-text">Are you sure?</span> | |
</div> | |
<div className="flex justify-end gap-2"> | |
<button | |
type="button" | |
onClick={() => setAreYouSure(false)} | |
className="btn btn-secondary flex items-center gap-2" | |
> | |
<X className="w-4 h-4" /> | |
No | |
</button> | |
<button | |
type="button" | |
onClick={onClick} | |
className="btn btn-primary flex items-center gap-2" | |
> | |
<Check className="w-4 h-4" /> | |
Yes | |
</button> | |
</div> | |
</motion.div> | |
) : null} | |
{areYouSure && ( | |
<motion.div | |
initial={{ opacity: 0, scale: 0.95 }} | |
animate={{ opacity: 1, scale: 1 }} | |
exit={{ opacity: 0, scale: 0.95 }} | |
className="absolute bottom-full mb-2 right-0 bg-white rounded-lg shadow-lg p-4 min-w-[200px] dark:bg-dark-card dark:border dark:border-dark-border" | |
> | |
<div className="flex items-center gap-2 text-amber-600 mb-3 dark:text-amber-500"> | |
<AlertTriangle className="w-5 h-5" /> | |
<span className="font-medium dark:text-dark-text">Are you sure?</span> | |
</div> | |
<div className="flex justify-end gap-2"> | |
<button | |
type="button" | |
onClick={() => setAreYouSure(false)} | |
className="btn btn-secondary flex items-center gap-2" | |
> | |
<X className="w-4 h-4" /> | |
No | |
</button> | |
<button | |
type="button" | |
onClick={onClick} | |
className="btn btn-primary flex items-center gap-2" | |
> | |
<Check className="w-4 h-4" /> | |
Yes | |
</button> | |
</div> | |
</motion.div> | |
) } |
DONT COMMIT SUGGESTION
<motion.div | ||
key={index} | ||
initial={{ opacity: 0, y: 20 }} | ||
animate={{ opacity: 1, y: 0 }} | ||
exit={{ opacity: 0, y: -20 }} | ||
className="mb-4" | ||
> | ||
<Collapsible | ||
trigger={ | ||
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors cursor-pointer dark:bg-dark-card dark:hover:bg-gray-800"> | ||
<span className="text-gray-900 font-medium dark:text-dark-text"> | ||
{match["Team Number"]} {matchName} {match[matchName]} | ||
</span> | ||
<ChevronDown className="w-5 h-5 text-gray-500 dark:text-dark-text-secondary" /> | ||
</div> | ||
} | ||
triggerClassName="w-full" | ||
transitionTime={200} | ||
> | ||
<div className="p-4 space-y-4 dark:bg-dark-card dark:border-t dark:border-dark-border"> | ||
<div className="flex justify-center"> | ||
<QRCodeGenerator text={JSON.stringify(match)} /> | ||
</div> | ||
<div className="flex justify-center gap-4"> | ||
<button | ||
type="button" | ||
onClick={() => removeMatch(match?.[matchName], index)} | ||
className="btn btn-secondary flex items-center gap-2" | ||
> | ||
<Trash2 className="w-4 h-4" /> | ||
Delete | ||
</button> | ||
<button | ||
type="button" | ||
onClick={() => sendMatch(match, index)} | ||
className="btn btn-primary flex items-center gap-2" | ||
> | ||
<Send className="w-4 h-4" /> | ||
Send | ||
</button> | ||
</div> | ||
</div> | ||
</Collapsible> | ||
</motion.div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider moving this to a seperate component
closes #23