Skip to content

Instantly share code, notes, and snippets.

View danielmateu's full-sized avatar
🎯
Focusing

Daniel Mateu Pardo danielmateu

🎯
Focusing
View GitHub Profile
@Klerith
Klerith / templateSlice.js
Last active November 8, 2024 21:52
Cascaron para crear Redux Slices rápidamente
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@Klerith
Klerith / vite-testing-config.md
Last active November 7, 2024 17:24
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@Klerith
Klerith / EventModal.js
Last active July 30, 2024 01:24
Contenido HTML del Modal
<h1> Nuevo evento </h1>
<hr />
<form className="container">
<div className="form-group mb-2">
<label>Fecha y hora inicio</label>
<input className="form-control" placeholder="Fecha inicio" />
</div>
<div className="form-group mb-2">
@Klerith
Klerith / modal.css
Created June 8, 2020 17:40
React Modal Styles
/* Modal */
.ReactModalPortal > div{
opacity: 0;
}
.ReactModalPortal .ReactModal__Overlay {
align-items: center;
display: flex;
justify-content: center;
transition: opacity .2s ease-in-out;