Skip to content

Instantly share code, notes, and snippets.

View OmkarK45's full-sized avatar
๐Ÿ’€
:trollface:

Omkar Kulkarni OmkarK45

๐Ÿ’€
:trollface:
View GitHub Profile
@OmkarK45
OmkarK45 / Button.tsx
Created November 8, 2021 13:32
Reusable TailwindCSS Button Component with loading and icon
import clsx from 'clsx'
import ButtonOrLink, { Props as ButtonOrLinkProps } from '../ButtonOrLink'
export interface Props extends ButtonOrLinkProps {
variant?: 'solid' | 'secondary' | 'white' | 'dark' | 'danger'
loading?: boolean
size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl'
className?: string
}
@OmkarK45
OmkarK45 / test.ts
Created November 22, 2021 19:41
Created from Remix Form!
export ok = 45
import { ActionType } from '../actionTypes'
import { Action } from '../actions'
interface RepositoriesState {
loading: boolean
error: string | null
data: string[]
}
const initialState = {
@OmkarK45
OmkarK45 / useConnection.ts
Created January 12, 2022 05:40
Convert Relay Pagination Response to normal list
import { useMemo } from 'react';
type Connection<T> = {
readonly edges : readonly ({
readonly node? : T | null ;
readonly cursor?:string
} | null)[];
};
export function useConnection<T>(connection?:Connection<T>){
@OmkarK45
OmkarK45 / [...nextauth].tsx
Last active April 3, 2022 10:16
Next Auth with custom backend that returns JWT
import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials";
type TA_Token = {
token: string;
user_id: number;
};
export default NextAuth({
providers: [