Skip to content

Commit 2140d4e

Browse files
committed
Add new interfaces and dependencies for Civic API
Added several interfaces related to petition signatures and Civic API details in `index.d.ts`. Updated `.env.example` with a default AI model, and `package.json` with new dependencies: `@mdxeditor/editor` and `react-error-boundary`. Enhanced global CSS with dark mode styles for the editor. Took 1 hour 1 minute
1 parent 9723f90 commit 2140d4e

File tree

5 files changed

+1466
-74
lines changed

5 files changed

+1466
-74
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,7 @@ SEARXNG_SAFESEARCH=0 # Safe search setting: 0 (off), 1 (moderate), 2 (strict)
147147
DFDA_CLIENT_ID=
148148
DFDA_CLIENT_SECRET=
149149

150-
GOOGLE_CIVIC_API_KEY=your_api_key_here
150+
GOOGLE_CIVIC_API_KEY=your_api_key_here
151+
152+
# Default AI model to use for generation
153+
DEFAULT_AI_MODEL=gpt-4o-mini

app/globals.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,35 @@
5959
@apply bg-background text-foreground;
6060
}
6161
}
62+
63+
@import '@mdxeditor/editor/style.css';
64+
65+
/* Add dark mode styles for the editor */
66+
.dark .mdxeditor {
67+
--mdxeditor-bg: hsl(var(--background));
68+
--mdxeditor-text: hsl(var(--foreground));
69+
--mdxeditor-border: hsl(var(--border));
70+
--mdxeditor-toolbar-bg: hsl(var(--card));
71+
--mdxeditor-toolbar-border: hsl(var(--border));
72+
--mdxeditor-button-bg: transparent;
73+
--mdxeditor-button-border: hsl(var(--border));
74+
--mdxeditor-button-hover-bg: hsl(var(--accent));
75+
--mdxeditor-button-hover-text: hsl(var(--accent-foreground));
76+
--mdxeditor-button-active-bg: hsl(var(--accent));
77+
--mdxeditor-button-active-text: hsl(var(--accent-foreground));
78+
--mdxeditor-button-active-border: hsl(var(--border));
79+
}
80+
81+
.dark .mdxeditor-toolbar {
82+
background-color: hsl(var(--card));
83+
border-color: hsl(var(--border));
84+
}
85+
86+
.dark .mdxeditor-button {
87+
color: hsl(var(--foreground));
88+
}
89+
90+
.dark .mdxeditor-button:hover {
91+
background-color: hsl(var(--accent));
92+
color: hsl(var(--accent-foreground));
93+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@langchain/textsplitters": "^0.0.3",
6060
"@mdx-js/loader": "^3.0.1",
6161
"@mdx-js/react": "^3.0.1",
62+
"@mdxeditor/editor": "^3.19.0",
6263
"@next-auth/prisma-adapter": "^1.0.7",
6364
"@next/bundle-analyzer": "^14.2.15",
6465
"@next/mdx": "^14.1.4",
@@ -184,6 +185,7 @@
184185
"react-colorful": "^5.6.1",
185186
"react-day-picker": "^8.10.0",
186187
"react-dom": "18.2.0",
188+
"react-error-boundary": "^4.1.2",
187189
"react-hook-form": "^7.50.1",
188190
"react-hot-toast": "^2.4.1",
189191
"react-icons": "^5.0.1",

0 commit comments

Comments
 (0)