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
diff --git a/app/components/entry-form.tsx b/app/components/entry-form.tsx | |
index 50e5aeb..84c64fc 100644 | |
--- a/app/components/entry-form.tsx | |
+++ b/app/components/entry-form.tsx | |
@@ -1,6 +1,6 @@ | |
-import { useFetcher } from "@remix-run/react"; | |
+import { Form, useSubmit } from "@remix-run/react"; | |
import { format } from "date-fns"; | |
-import { useEffect, useRef } from "react"; | |
+import { useRef } from "react"; |
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
//If you always wanted it to look like this | |
<Providers providers={[ | |
<FooContext.Provider value="foo" />, | |
<BarContext.Provider value="bar" />, | |
<BazContext.Provider value="baz" />, | |
]}> | |
<App /> | |
</Providers>, |
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
"use client" | |
import { forwardRef, useState } from "react" | |
import { EyeIcon, EyeOffIcon } from "lucide-react" | |
import { Button } from "@/components/ui/button" | |
import { Input, InputProps } from "@/components/ui/input" | |
import { cn } from "@/lib/utils" | |
const PasswordInput = forwardRef<HTMLInputElement, InputProps>( | |
({ className, ...props }, ref) => { |
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
type IProps = { | |
children: React.ReactNode; | |
asChild?: boolean; | |
} & (IModalProp | IRedirectProp); | |
interface IModalProp { | |
mode: "modal"; | |
} | |
interface IRedirectProp { |
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
public IActionResult Index(int pageNumber = 1, int pageSize = 10) | |
{ | |
IEnumerable<Category> categoryList = _db.Categories.ToList(); | |
if (pageNumber < 1) pageNumber = 1; | |
int totalItems = categoryList.Count(); | |
var pager = new Pager(totalItems, pageNumber, pageSize); | |
int recSkip = (pageNumber - 1) * pageSize; | |
var data = categoryList.Skip(recSkip).Take(pager.PageSize).ToList(); | |
this.ViewBag.Pager = pager; |
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 { AxiosError, AxiosResponse } from 'axios' | |
/** | |
* A type representing a function that takes an optional object of type T and returns a promise resolving to an axios Response with a generic type V. | |
*/ | |
type BaseRequest<T, V> = (params?: T) => Promise<AxiosResponse<V>> | |
/** | |
* A type representing the shape of a successful API response, which includes a 'code' property set to 'success', and a 'data' property containing the payload. | |
*/ |
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 { Input } from "@/components/input-fields"; | |
import { zodResolver } from "@hookform/resolvers/zod"; | |
import Link from "next/link"; | |
import { SubmitHandler, useForm } from "react-hook-form"; | |
import { z } from "zod"; | |
const RegisterSchema = z | |
.object({ | |
email: z | |
.string() |
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 { GoalLegend } from "./components/switch"; | |
function App() { | |
return ( | |
<div className="App"> | |
<GoalLegend goal={0} /> | |
</div> | |
); | |
} |
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 { useEffect, useMemo, useState,RefObject } from "react"; | |
export function useOnScreen(ref:RefObject<HTMLElement>):boolean { | |
const [isOnScreen, setIsOnScreen] = useState<boolean>(false); | |
const observer = useMemo( | |
() => new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting)), | |
// eslint-disable-next-line react-hooks/exhaustive-deps | |
[ref] | |
); |
NewerOlder