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

feat: animate faqs answer opening #577

Merged
merged 1 commit into from
Nov 24, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/trello.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Link PR to Trello
steps:
# Link PR to Trello
- name: Link to Trello
uses: rematocorp/[email protected]
with:
Expand Down
10 changes: 8 additions & 2 deletions layout/FAQs/components/Question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ export default function Question({
<h2 className="font-terminal-uppercase mb-4 text-2xl md:text-4xl">
{title}
</h2>
{showQuestion && <p>{description}</p>}
<div
className={`transition-max-height overflow-hidden duration-300 ${
showQuestion ? "max-h-48 opacity-100" : "max-h-0 opacity-0"
}`}
>
{description && <p>{description}</p>}
</div>
<div className="flex items-center justify-end">
<Link
href={href}
Expand All @@ -30,7 +36,7 @@ export default function Question({
{link}
</Link>
<button
className="font-terminal-uppercase w-16 rounded-full bg-quinary px-2 text-xl text-white"
className="font-terminal-uppercase w-16 transform rounded-full bg-quinary px-2 text-xl text-white transition-transform duration-300 hover:scale-110"
onClick={() =>
setShowQuestion((prevShowQuestion) => !prevShowQuestion)
}
Expand Down
Loading