
이번 협업 프로젝트에서 npm을 사용하기로 했는데 습관적으로
yarn을 사용하게 되면서 저번에 튜터님이 알려주신 내용을 그대로 적용해서 파일의 캐시 정리 완료
각종 props를 통해 커스텀 후 사용
import React from "react";
interface ButtonProps {
buttonName: string;
bgColor?: string;
textColor?: string;
paddingY?: string;
marginY?: string;
buttonWidth?: string;
onClick: () => void;
}
const Button = ({ buttonName, bgColor, textColor, paddingY, marginY, buttonWidth, onClick }: ButtonProps) => {
return (
<button
className={`${bgColor ? bgColor : "bg-green"} rounded ${
textColor ? textColor : "text-white"
} font-semibold mx-1 ${marginY ? marginY : "my-2"} ${
paddingY ? paddingY : "py-1"
} px-4 hover:bg-white hover:text-green ${buttonWidth ? buttonWidth : null}`}
onClick={onClick}
>
{buttonName}
</button>
);
};
export default Button;
"use client";
import React, { useState } from "react";
interface InputProps {
type: string;
inputValue: string | number;
setInputValue: React.Dispatch<React.SetStateAction<string | number>>;
placeholder: string;
}
const Input: React.FC<InputProps> = ({ type, inputValue, setInputValue, placeholder }) => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setInputValue(event.target.value);
};
return (
<input
className="bg-transparent border-b-2 text-center p-0.5"
type={type}
value={inputValue}
onChange={handleChange}
placeholder={placeholder}
></input>
);
};
export default Input;
헤더 부분은 추후 로그인 기능과 연결을 위해
ui만 그림
5분 기록보드 특강을 들으면서 느낀 점이 있다면,
평소 수많은 고민을 해보고 수많은 콘솔을 찍어보는데 이런 과정들이 그냥 지나쳐 가는게 아쉽다 나중에 분명 잊어버리면 똑같은 고민을 하거나
내가 작성한 Notion, blog 들을 뒤져가며 다시 할텐데 정리 해두는 것도 나쁘지 않겠다.
그만큼 블로그에 정리도 잘 해두어야 겠다.
내일도 화이팅