Skip to content

Commit

Permalink
feat: implement reset button & numeric mode
Browse files Browse the repository at this point in the history
  • Loading branch information
JinleeJeong committed Apr 19, 2024
1 parent 1326a04 commit e5508bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/(input)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
"use client";

import { Viewport } from "next";
import Link from "next/link";
import React from "react";
import Logo from "@/components/common/logo/logo";
import { useStocksStore } from "@/state/stores/stocks-store";

export const viewport: Viewport = {
themeColor: "var(--color-white)",
};

const InputLayout = ({ children }: { children: React.ReactNode }) => {
const { removeAllStocks } = useStocksStore();
return (
<div className="flex size-full flex-col">
<div className="sticky top-0 z-10 flex h-11 w-full shrink-0 items-center justify-start bg-white px-5">
<div className="sticky top-0 z-10 flex h-11 w-full shrink-0 items-center justify-between bg-white px-5">
<Link href="/">
<Logo />
</Link>
<div onClick={removeAllStocks} className="cursor-pointer text-body3 text-grey-900">
Reset
</div>
</div>
<div className="h-[calc(100%-50px)] w-full">{children}</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
ref={ref}
className={"h-9 w-full text-lg outline-none"}
type={type}
inputMode={type === "number" ? "numeric" : undefined}
onFocus={handleFocus} // 수정된 handleFocus 함수로 변경
onBlur={handleBlur}
{...props}
Expand Down

0 comments on commit e5508bd

Please sign in to comment.