Skip to content

Commit

Permalink
adjusted notes/subheading on fundamentals
Browse files Browse the repository at this point in the history
  • Loading branch information
mokelgit committed May 30, 2024
1 parent c051e0e commit 7de099a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
35 changes: 11 additions & 24 deletions app/(layout)/fundamentals/[metric]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,33 +203,10 @@ export default async function Layout({
</a>
</p>
</div>
) : pageData.title === "Transaction Costs" ? (
<div className="flex flex-col sm:flex-row space-x-1">
<span className="inline-flex gap-x-1">
<div>
{pageData.description} Check out our new
<a
href="https://fees.growthepie.xyz/"
target="_blank"
className="underline mx-0.5"
>
fees page
</a>
for a more detailed view.
</div>
</span>
</div>
) : (
pageData.description
)}
{pageData.note && (
<div className="text-xs">
<span className="font-semibold text-forest-200 dark:text-forest-400">
Note:{" "}
</span>
{pageData.note}
</div>
)}

{pageData.tags && (
<div className="flex items-center mt-[5px]">
{pageData.tags.map((tag, i) => (
Expand All @@ -253,6 +230,16 @@ export default async function Layout({
className="rounded-3xl bg-forest-50 dark:bg-forest-900 px-[63px] py-[23px] flex flex-col"
question={`What does ${pageData.title} tell you?`}
answer={pageData.why}
note={
pageData.note && (
<div className="text-xs">
<span className="font-semibold text-forest-200 dark:text-forest-400">
Note:{" "}
</span>
{pageData.note}
</div>
)
}
startOpen
/>
</Container>
Expand Down
15 changes: 13 additions & 2 deletions components/layout/QuestionAnswer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { useElementSizeObserver } from "@/hooks/useElementSizeObserver";
export default function QuestionAnswer({
question,
answer,
note,
className = "",
startOpen = false,
}: {
question: string | React.ReactNode;
answer: string | React.ReactNode;
note?: string | React.ReactNode;
className?: string;
startOpen?: boolean;
}) {
Expand All @@ -26,10 +28,11 @@ export default function QuestionAnswer({
onClick={() => setOpen(!open)}
>
<div className="flex w-[13px] h-[13px] items-center justify-center">

<Icon
icon="feather:arrow-right-circle"
className={`w-[13px] h-[13px] transform rotate-0 transition-transform duration-300 ${open ? "rotate-90" : "rotate-0"}`}
className={`w-[13px] h-[13px] transform rotate-0 transition-transform duration-300 ${
open ? "rotate-90" : "rotate-0"
}`}
/>
</div>
<div className="font-semibold text-sm leading-snug">{question}</div>
Expand All @@ -44,6 +47,14 @@ export default function QuestionAnswer({
{answer}
</div>
</div>
<div
className={`transition-height duration-300 overflow-hidden text-base`}
style={{
height: open ? 25 : 0,
}}
>
{note && <div className="pt-[10px]">{note}</div>}
</div>
</div>
);
}

0 comments on commit 7de099a

Please sign in to comment.