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 April 25, 2024 17:38
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 May 22, 2024 19:08
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 April 28, 2024 14:03
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;