implementation de umami
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Inter, Merriweather } from "next/font/google";
|
||||
import Script from "next/script";
|
||||
import { AuthProvider } from "@/providers/AuthProvider";
|
||||
import { LanguageProvider } from "@/providers/LanguageProvider";
|
||||
import "./globals.css";
|
||||
@@ -27,6 +28,14 @@ export default function RootLayout({
|
||||
}) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<Script
|
||||
defer
|
||||
src="http://kaelstudio-umami-42037c-158-220-111-183.traefik.me/script.js"
|
||||
data-website-id="bce265f0-c9d4-4542-813f-f3bd9bf151bc"
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
</head>
|
||||
<body className={`${inter.variable} ${merriweather.variable} font-sans h-screen overflow-x-hidden overflow-y-auto antialiased bg-theme-bg text-theme-text transition-colors duration-300`}>
|
||||
<AuthProvider>
|
||||
<LanguageProvider>
|
||||
|
||||
@@ -158,6 +158,7 @@ const AuthPage: React.FC<AuthPageProps> = ({ onBack, onSuccess, initialMode = 's
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
data-umami-event={mode === 'signin' ? "Login" : mode === 'signup' ? "Signup" : "Send Reset"}
|
||||
disabled={loading}
|
||||
className="w-full bg-slate-900 text-white py-4 rounded-xl font-bold flex items-center justify-center gap-2 hover:bg-blue-600 transition-all shadow-xl disabled:opacity-50 mt-4"
|
||||
>
|
||||
|
||||
@@ -47,10 +47,10 @@ const Dashboard: React.FC<DashboardProps> = ({ user, projects, onSelect, onCreat
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<LanguageSwitcher />
|
||||
<button onClick={onProfile} className="bg-theme-bg text-theme-text px-4 md:px-5 py-2 md:py-2.5 rounded-xl text-xs md:text-sm font-bold hover:opacity-80 transition-all flex items-center gap-2 border border-theme-border">
|
||||
<button onClick={onProfile} data-umami-event="Go To Profile" className="bg-theme-bg text-theme-text px-4 md:px-5 py-2 md:py-2.5 rounded-xl text-xs md:text-sm font-bold hover:opacity-80 transition-all flex items-center gap-2 border border-theme-border">
|
||||
<User size={18} /> {t('dashboard.my_profile')}
|
||||
</button>
|
||||
<button onClick={onLogout} title={t('sidebar.logout')} className="p-3 text-theme-muted hover:text-red-500 rounded-full hover:bg-red-500/10 transition-colors"><LogOut size={20} /></button>
|
||||
<button onClick={onLogout} data-umami-event="Logout" title={t('sidebar.logout')} className="p-3 text-theme-muted hover:text-red-500 rounded-full hover:bg-red-500/10 transition-colors"><LogOut size={20} /></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,6 +86,7 @@ const Dashboard: React.FC<DashboardProps> = ({ user, projects, onSelect, onCreat
|
||||
<h3 className="text-2xl font-black text-theme-text">{t('dashboard.my_novels')}</h3>
|
||||
<button
|
||||
onClick={onCreate}
|
||||
data-umami-event="Create Project"
|
||||
className="flex items-center gap-2 bg-blue-600 text-white px-6 py-3 rounded-2xl font-bold hover:bg-blue-700 transition-all shadow-xl shadow-blue-200"
|
||||
>
|
||||
<Plus size={20} /> {t('dashboard.write_new')}
|
||||
@@ -97,6 +98,7 @@ const Dashboard: React.FC<DashboardProps> = ({ user, projects, onSelect, onCreat
|
||||
<div
|
||||
key={p.id}
|
||||
onClick={() => onSelect(p.id)}
|
||||
data-umami-event="Open Project"
|
||||
className="bg-theme-panel p-6 md:p-8 rounded-[2.5rem] border border-theme-border shadow-sm hover:shadow-2xl hover:scale-[1.02] transition-all cursor-pointer group flex flex-col justify-between h-64"
|
||||
>
|
||||
<div>
|
||||
@@ -153,7 +155,7 @@ const Dashboard: React.FC<DashboardProps> = ({ user, projects, onSelect, onCreat
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button onClick={onPricing} className="w-full mt-10 bg-white/10 hover:bg-white/20 py-4 rounded-2xl text-sm font-bold transition-all">
|
||||
<button onClick={onPricing} data-umami-event="Pricing Click" className="w-full mt-10 bg-white/10 hover:bg-white/20 py-4 rounded-2xl text-sm font-bold transition-all">
|
||||
{t('dashboard.upgrade_plan')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -47,6 +47,7 @@ export const LanguageSwitcher: React.FC = () => {
|
||||
{languages.map((lang) => (
|
||||
<button
|
||||
key={lang.code}
|
||||
data-umami-event="Change Language"
|
||||
onClick={() => {
|
||||
setLanguage(lang.code);
|
||||
setIsOpen(false);
|
||||
|
||||
@@ -582,6 +582,7 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(({
|
||||
|
||||
<button
|
||||
onClick={() => handleAiAction('correct')}
|
||||
data-umami-event="AI Correct"
|
||||
disabled={!hasSelection}
|
||||
className={`flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${!hasSelection ? 'text-slate-300 cursor-not-allowed' : 'text-slate-700 hover:bg-indigo-50 hover:text-indigo-700'}`}
|
||||
>
|
||||
@@ -590,6 +591,7 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(({
|
||||
|
||||
<button
|
||||
onClick={() => handleAiAction('rewrite')}
|
||||
data-umami-event="AI Rewrite"
|
||||
disabled={!hasSelection}
|
||||
className={`flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${!hasSelection ? 'text-slate-300 cursor-not-allowed' : 'text-slate-700 hover:bg-indigo-50 hover:text-indigo-700'}`}
|
||||
>
|
||||
@@ -598,6 +600,7 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(({
|
||||
|
||||
<button
|
||||
onClick={() => handleAiAction('expand')}
|
||||
data-umami-event="AI Expand"
|
||||
disabled={!hasSelection}
|
||||
className={`flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${!hasSelection ? 'text-slate-300 cursor-not-allowed' : 'text-slate-700 hover:bg-indigo-50 hover:text-indigo-700'}`}
|
||||
>
|
||||
@@ -606,6 +609,7 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(({
|
||||
|
||||
<button
|
||||
onClick={() => handleAiAction('continue')}
|
||||
data-umami-event="AI Continue"
|
||||
className="flex items-center gap-2 px-3 py-2 text-sm text-slate-700 hover:bg-indigo-50 hover:text-indigo-700 text-left transition-colors"
|
||||
>
|
||||
<Wand2 size={14} /> Continuer l'écriture
|
||||
@@ -619,6 +623,7 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(({
|
||||
|
||||
<button
|
||||
onClick={handleCopy}
|
||||
data-umami-event="Editor Copy"
|
||||
disabled={!hasSelection}
|
||||
className={`flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${!hasSelection ? 'text-slate-300 cursor-not-allowed' : 'text-slate-700 hover:bg-slate-50'}`}
|
||||
>
|
||||
@@ -627,6 +632,7 @@ const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorProps>(({
|
||||
|
||||
<button
|
||||
onClick={handleSelectAll}
|
||||
data-umami-event="Editor Select All"
|
||||
className="flex items-center gap-2 px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 text-left transition-colors"
|
||||
>
|
||||
<MousePointerClick size={14} /> Tout sélectionner
|
||||
|
||||
Reference in New Issue
Block a user