This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {create} from 'zustand' | |
| import { devtools } from 'zustand/middleware' | |
| interface Store { | |
| } | |
| const initialState = {} | |
| export const useStore = create<Store> () (devtools( (set, get) => ({ | |
| ...initialState, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const dateFormatter = fecha => { | |
| const nuevaFecha = new Date(fecha.split("T")[0].split("-")); | |
| const opciones = { | |
| weekday: "long", | |
| year: "numeric", | |
| month: "long", | |
| day: "2-digit", | |
| }; | |
| return nuevaFecha.toLocaleDateString("es-ES", opciones); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .line-limit { | |
| display: -webkit-box; | |
| -webkit-box-orient: vertical; | |
| -webkit-line-clamp: 2; | |
| overflow: hidden; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function formatCurrency(amount: number): string { | |
| return new Intl.NumberFormat('en-US', { | |
| style: 'currency', | |
| currency: 'USD', | |
| minimumFractionDigits: 2, | |
| maximumFractionDigits: 2 | |
| }).format(amount); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from "react"; | |
| export const useForm = (initialForm = {}) => { | |
| const [ formState, setFormState ] = useState( initialForm ); | |
| const hundleChange = ({ target: { name, value } }) => { | |
| setFormState({ | |
| ...formState, | |
| [ name ]: value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <picture> | |
| <source sizes="1920w, 1280w, 640w" | |
| srcset= | |
| "img/imagen.avif 1920w, | |
| img/imagen-1280.avif 1280w, | |
| img/imagen-640.avif 640w" | |
| type="image/avif"> | |
| <source | |
| sizes="1920w, 1280w, 640w" | |
| srcset="img/imagen.webp 1920w, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const regex = new RegExp("([!#-'*+/-9=?A-Z^-~-]+(\.[!#-'*+/-9=?A-Z^-~-]+)*|\"\(\[\]!#-[^-~ \t]|(\\[\t -~]))+\")@([!#-'*+/-9=?A-Z^-~-]+(\.[!#-'*+/-9=?A-Z^-~-]+)*|\[[\t -Z^-~]*])"); |