Skip to content

Instantly share code, notes, and snippets.

View devstojko's full-sized avatar
:atom:

Nemanja devstojko

:atom:
  • Belgrade, Serbia
View GitHub Profile
@devstojko
devstojko / remix-validated-form-shadcn.tsx
Last active September 29, 2023 18:19
remix-validated-form shadcn/ui
import type * as LabelPrimitive from "@radix-ui/react-label";
import { ValidatedForm, useField } from "remix-validated-form";
import React from "react";
import { Label } from "./label";
import { Slot } from "@radix-ui/react-slot";
import { cn } from "~/lib/utils";
const AppValidatedFormContext = React.createContext<{ id: string }>(
{} as { id: string }
);
@devstojko
devstojko / In collection usage
Last active July 29, 2022 11:46
ObserveField.tsx
{
name: "test",
type: 'text',
label: "Test",
admin: {
readOnly: true,
components: {
Field: ObserveField
}
}
@devstojko
devstojko / ColorPicker.tsx
Last active April 15, 2023 00:14
Payload Input - ColorPicker
import React, { useCallback } from "react";
import { useField, withCondition } from "payload/components/forms";
import { TextField } from "payload/dist/fields/config/types";
import ColorInput from "../PayloadInput";
import { text } from "payload/dist/fields/validations";
export type Props = Omit<TextField, "type"> & {
path?: string;
@devstojko
devstojko / machine.js
Last active April 2, 2021 16:15
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@devstojko
devstojko / machine.js
Last active April 2, 2021 16:04
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@devstojko
devstojko / machine.js
Last active April 18, 2020 15:58
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@devstojko
devstojko / machine.js
Last active March 22, 2020 22:55
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@devstojko
devstojko / machine.js
Last active March 22, 2020 19:02
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@devstojko
devstojko / machine.js
Last active March 22, 2020 15:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@devstojko
devstojko / machine.js
Last active March 22, 2020 22:55
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)