-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to change file names to kebab-case, delete unnecessary type …
…annotations and add properties types for components, Fix migration bugs
- Loading branch information
1 parent
c5309ba
commit be5f540
Showing
35 changed files
with
254 additions
and
259 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
export default function Title({ children, className = '' }: { children: string; className?: string }): JSX.Element { | ||
interface Properties { | ||
children: string; | ||
className?: string; | ||
} | ||
|
||
export default function Title({ children, className }: Properties) { | ||
return <h3 className={`pb-2 ps-2 text-base font-semibold ${className}`}>{children}</h3>; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function FormAlert({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<p role="alert" className="pt-2 text-xs text-red-600"> | ||
{children} | ||
</p> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { default as FormAlert } from './FormAlert'; | ||
export { default as Input } from './Input'; | ||
export { default as Textarea } from './Textarea'; | ||
export { default as Title } from './Title'; | ||
export { default as FormAlert } from './form-alert'; | ||
export { default as Input } from './input'; | ||
export { default as Textarea } from './text-area'; | ||
export { default as Title } from './title'; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { forwardRef, type Ref, type TextareaHTMLAttributes } from 'react'; | ||
|
||
interface TextareaProperties extends TextareaHTMLAttributes<HTMLTextAreaElement> { | ||
children?: JSX.Element | boolean | string; | ||
reference?: Ref<HTMLTextAreaElement> | null | undefined; | ||
} | ||
|
||
const formTextareaStyle = { backgroundImage: 'none' }; | ||
|
||
const Textarea = forwardRef<HTMLTextAreaElement, TextareaProperties>(function TextareaComponent( | ||
{ className, id, rows, placeholder, hidden, disabled, ...register }, | ||
reference, | ||
) { | ||
return ( | ||
<> | ||
<textarea | ||
className={`w-full rounded-lg px-4 py-2 font-medium ${className ?? 'bg-purple-dark text-white hover:bg-purple'}`} | ||
style={formTextareaStyle} | ||
id={id} | ||
rows={rows} | ||
ref={reference} | ||
placeholder={placeholder} | ||
hidden={hidden} | ||
disabled={disabled} | ||
{...register} | ||
/> | ||
</> | ||
); | ||
}); | ||
|
||
Textarea.displayName = 'Textarea'; | ||
|
||
export default Textarea; |
This file contains 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
13 changes: 8 additions & 5 deletions
13
src/components/forms/auth/LoginForm.tsx → src/components/forms/auth/login-form.tsx
This file contains 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
10 changes: 5 additions & 5 deletions
10
src/components/forms/post/AddPostForm.tsx → src/components/forms/post/add-post-form.tsx
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.