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

Tailwind (should merge after cleanup) #18

Closed
wants to merge 14 commits into from
Closed

Tailwind (should merge after cleanup) #18

wants to merge 14 commits into from

Conversation

YoniKiriaty
Copy link
Collaborator

@YoniKiriaty YoniKiriaty commented Dec 12, 2024

closes #23

application/src/components/SureButton.tsx Show resolved Hide resolved
Comment on lines +55 to +80
<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>
Copy link
Collaborator Author

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.

Comment on lines +18 to +48
{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}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{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

Comment on lines +73 to +116
<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>
Copy link
Collaborator Author

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

@YoniKiriaty YoniKiriaty added New Feature New feature or request Frontend Something that changes a significant part of the frontened Improvement Improving something about the code or the user experience labels Dec 18, 2024
Base automatically changed from cleanup-lol to master December 19, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Something that changes a significant part of the frontened Improvement Improving something about the code or the user experience New Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tailwind
2 participants