Skip to content

Instantly share code, notes, and snippets.

View jrbaudin's full-sized avatar
🏠
Working from home

Joel Baudin jrbaudin

🏠
Working from home
View GitHub Profile
@jrbaudin
jrbaudin / reform-embed.jsx
Created September 21, 2021 14:47
Reform.app embedded form in Next.js
import Script from 'next/script'
type Props = {
formUrl: string
}
export const ReformEmbed = ({ formUrl }: Props) => {
return (
<>
<div id="my-reform" className="z-50 relative" />
<Script>
@jrbaudin
jrbaudin / locale.ts
Last active April 28, 2021 08:31
nextjs bundled translations example
import { Locale, Path } from '../types'
const removeRegion = (locale: string): string => {
const [noRegion] = locale.split('-')
return noRegion
}
const validateLocale = (locale: string, defaultLocale: string): Locale => {
if (locale === Locale.sv || locale === Locale.en) {
return locale
} else {