Skip to content

Commit

Permalink
Estilo admin (#86)
Browse files Browse the repository at this point in the history
* corregir seed -> prisma:seed

* descripción de endpoints

* format on save

* cambio de inputs y boton

* update format
  • Loading branch information
dsantif authored Sep 19, 2024
1 parent 28e8c22 commit 60e5e77
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
"source.fixAll.eslint": "explicit",
"source.fixAll": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"standard.enable": false,
"prettier.prettierPath": "./node_modules/prettier",
"typescript.tsdk": "node_modules/typescript/lib",
"tailwindCSS.codeActions": false
"tailwindCSS.codeActions": false,
"editor.formatOnSave": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This is the current DB design
3. **Seed Database**: To seed your database with dummy data.

```bash
docker compose exec app npm run seed
docker compose exec app npm run prisma:seed
```

4. **Open Your App**: Your application should now be running at [http://localhost:3000](http://localhost:3000). You can start building your project by modifying the source code located in the `src` directory.
Expand Down
10 changes: 9 additions & 1 deletion src/components/admin/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@ export const APIS: {
[key: string]: ["GET" | "POST", TObject];
} = {
"/api/admin/sendEmail": ["POST", SendEmailRequestSchema],
"/api/admin/exportParticipants": ["GET", Type.Object({})],
"/api/admin/exportParticipants": [
"GET",
Type.Object(
{},
{
description: "Exporta a google sheets la lista de participantes",
},
),
],
};
23 changes: 21 additions & 2 deletions src/styles/rjsf.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@

.rjsf .btn {
margin-top: 12px;
padding: 8px;
border: solid 2px black;
padding: 4px;
border: solid 2px #facc15;
border-radius: 24px;
width: 100%;
background-color: #facc15;
color: #111827;
font-weight: bold;
}

.rjsf .btn:hover {
background-color: #eab308;
}

.rjsf input {
border-radius: 6px;
padding: 4px;
border: 1px solid lightgray;
box-shadow: 0.5px 1px rgba(200, 200, 200, 0.3);
}

.rjsf input:focus {
border: 1px solid purple;
}
15 changes: 9 additions & 6 deletions src/types/admin.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ export const SendEmailResponseSchema = Type.Object({
});

export type SendEmailRequest = Static<typeof SendEmailRequestSchema>;
export const SendEmailRequestSchema = Type.Object({
email: Type.String(),
subject: Type.String({ minLength: 1 }),
// Html of the email content
content: Type.String({ minLength: 1 }),
});
export const SendEmailRequestSchema = Type.Object(
{
email: Type.String(),
subject: Type.String({ minLength: 1 }),
// Html of the email content
content: Type.String({ minLength: 1 }),
},
{ description: "Envía un correo desde la cuenta de ofmi-no-reply" },
);

0 comments on commit 60e5e77

Please sign in to comment.