Skip to content

Commit 107a1ca

Browse files
authored
fix buttons through the ui (#119)
* Fix buttons using a component * Get verify email under control * Restyle messages * Add consistent rings to everything * Add even more buttons * Fix build * Prettify
1 parent c7a083d commit 107a1ca

30 files changed

+442
-401
lines changed

package-lock.json

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
"type": "module",
66
"dependencies": {
77
"@hookform/resolvers": "^3.4.0",
8+
"@radix-ui/react-slot": "^1.1.1",
89
"@tanstack/react-query": "^5.60.5",
910
"@types/d3": "^7.4.0",
1011
"@types/lodash": "^4.17.4",
1112
"@types/md5": "^2.2.0",
1213
"@types/react": "^18.3.2",
1314
"@types/react-dom": "^18.3.0",
15+
"class-variance-authority": "^0.7.1",
16+
"clsx": "^2.1.1",
1417
"d3": "^7.8.5",
1518
"firebase": "^10.12.0",
1619
"js-base64": "^3.7.5",
@@ -24,6 +27,7 @@
2427
"react-hook-form": "^7.51.4",
2528
"react-router-dom": "^6.23.1",
2629
"react-use": "^17.4.0",
30+
"tailwind-merge": "^3.0.1",
2731
"yup": "^1.0.2"
2832
},
2933
"scripts": {

src/components/common/TableOfContents.tsx

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
1+
import Button from "../ui/Button";
12
import { FC } from "react";
23

34
type Heading = {
45
text: string;
5-
level: number;
66
id: string;
77
};
88

99
const headingData: Heading[] = [
1010
{
11-
level: 2,
1211
text: "Roots",
1312
id: "info-on-roots",
1413
},
1514
{
16-
level: 2,
1715
text: "Trunk",
1816
id: "info-on-trunk",
1917
},
2018
{
21-
level: 2,
2219
text: "Branches",
2320
id: "info-on-branches",
2421
},
2522
{
26-
level: 2,
2723
text: "Leaves",
2824
id: "info-on-leaves",
2925
},
3026
{
31-
level: 2,
3227
text: "SAP Algorithm",
3328
id: "info-on-sap-algorithm",
3429
},
@@ -38,28 +33,13 @@ const TableOfContents: FC = () => {
3833
return (
3934
<div className="prose prose-stone">
4035
<ul>
41-
{headingData.map((heading) => {
42-
const id = heading.id;
43-
const indentation = {
44-
3: " pl-2",
45-
4: " pl-4",
46-
};
47-
const level = heading.level as keyof typeof indentation;
48-
const paddingClass = indentation[level] ?? "";
49-
return (
50-
<li key={id}>
51-
<a
52-
href={`#${id}`}
53-
className={
54-
"text-sky-600 underline-offset-2 hover:text-sky-800" +
55-
paddingClass
56-
}
57-
>
58-
{heading.text}
59-
</a>
60-
</li>
61-
);
62-
})}
36+
{headingData.map((heading) => (
37+
<li key={heading.id}>
38+
<Button variant="link" size="link" asChild>
39+
<a href={`#${heading.id}`}>{heading.text}</a>
40+
</Button>
41+
</li>
42+
))}
6343
</ul>
6444
</div>
6545
);

0 commit comments

Comments
 (0)