Skip to content

Commit 9ebe0a3

Browse files
authored
feat(about): replace text references to workout.lol with WorkoutLol component for consistency and improved styling (#32)
1 parent cb5f841 commit 9ebe0a3

File tree

5 files changed

+53
-7
lines changed

5 files changed

+53
-7
lines changed

content/about/en.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import Link from "next/link";
44

55
## Why Workout.cool?
66

7-
Workout.cool was born out of the desire to offer a reliable, modern, and actively maintained workout platform, after the original project **workout.lol** was abandoned.
7+
Workout.cool was born out of the desire to offer a reliable, modern, and actively maintained workout platform, after the original project <WorkoutLol variant="muted" /> was abandoned.
88

99
## The Story
1010

1111
Workout.cool is the result of a community-driven adventure.
1212

13-
I was the **first open source contributor** to the `workout.lol` project.
13+
I was the **first open source contributor** to the <WorkoutLol variant="muted" /> project.
1414

1515
This means I saw the project *come to life*, *grow*, then get **sold** and ultimately **abandoned** by its new owner.
1616

content/about/fr.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import Link from "next/link";
44

55
## Pourquoi Workout.cool ?
66

7-
Workout.cool est né de la volonté de proposer une plateforme d'entraînement fiable, moderne et maintenue, après l'abandon du projet **workout.lol**.
7+
Workout.cool est né de la volonté de proposer une plateforme d'entraînement fiable, moderne et maintenue, après l'abandon du projet <WorkoutLol variant="muted" />.
88

99
## L'histoire
1010

1111
Workout.cool est le fruit d'une aventure communautaire.
1212

13-
J'ai été le **premier contributeur open source** du projet `workout.lol`.
13+
J'ai été le **premier contributeur open source** du projet <WorkoutLol variant="muted" />.
1414

1515
De ce fait, j'ai vu ce projet *naître*, *grandir*, puis être **vendu** et finalement **abandonné** par son nouveau propriétaire.
1616

src/components/ui/workout-lol.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { cva, type VariantProps } from "class-variance-authority";
2+
3+
import { cn } from "@/shared/lib/utils";
4+
5+
const workoutLolVariants = cva(
6+
"inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-sm font-mono font-semibold transition-colors duration-200",
7+
{
8+
variants: {
9+
variant: {
10+
default: [
11+
"bg-red-50 text-red-600 ring-1 ring-inset ring-red-200",
12+
"dark:bg-red-950/30 dark:text-red-400 dark:ring-red-900/30",
13+
"hover:bg-red-100 dark:hover:bg-red-950/50",
14+
],
15+
muted: [
16+
"bg-slate-100 text-slate-600 ring-1 ring-inset ring-slate-200",
17+
"dark:bg-slate-900/50 dark:text-slate-400 dark:ring-slate-800",
18+
"hover:bg-slate-200 dark:hover:bg-slate-900/70",
19+
],
20+
},
21+
},
22+
defaultVariants: {
23+
variant: "default",
24+
},
25+
},
26+
);
27+
28+
interface WorkoutLolProps extends VariantProps<typeof workoutLolVariants> {
29+
className?: string;
30+
children?: React.ReactNode;
31+
}
32+
33+
export const WorkoutLol = ({ className, variant, children }: WorkoutLolProps) => {
34+
return <span className={cn(workoutLolVariants({ variant }), className)}>{children || "workout.lol"}</span>;
35+
};
36+
37+
export const WorkoutLolMuted = ({ className, children }: Omit<WorkoutLolProps, "variant">) => (
38+
<WorkoutLol className={className} variant="muted">
39+
{children}
40+
</WorkoutLol>
41+
);

src/shared/lib/mdx/load-mdx.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { readFile } from "fs/promises";
33

44
import { compileMDX } from "next-mdx-remote/rsc";
55

6+
import { WorkoutLol } from "@/components/ui/workout-lol";
7+
68
export async function getLocalizedMdx(
79
pageSlug: string, // ex: "privacy-policy"
810
locale: string, // ex: "fr" or "en"
@@ -16,6 +18,9 @@ export async function getLocalizedMdx(
1618
options: {
1719
parseFrontmatter: true,
1820
},
21+
components: {
22+
WorkoutLol,
23+
},
1924
});
2025

2126
return content;

src/shared/lib/workout-session/use-workout-session.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ export const useWorkoutSessionService = () => {
7373
return workoutSessionLocal.add(session);
7474
};
7575

76-
const update = async (id: string, data: Partial<WorkoutSession>) => {
76+
const update = async (_id: string, _data: Partial<WorkoutSession>) => {
7777
// if (userId) {
78-
// // TODO: Créer une action updateWorkoutSessionAction
78+
// // TODO: create updateWorkoutSessionAction
7979
// const result = await updateWorkoutSessionAction({ id, data });
8080
// if (result.serverError) throw new Error(result.serverError);
8181
// }
8282
// return workoutSessionLocal.update(id, data);
8383
};
8484

85-
const complete = async (id: string) => {
85+
const complete = async (_id: string) => {
8686
// const data = {
8787
// status: "completed" as const,
8888
// endedAt: new Date().toISOString(),

0 commit comments

Comments
 (0)