-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: Added a customizable heading component
I have created a highly customizable and reusable header component in src/library, and the styling is done using tailwind css and added various input fields as props. Fix/issue-#67
- Loading branch information
Showing
2 changed files
with
47 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
import React from 'react'; | ||
|
||
type InputProps = { | ||
name?: string; | ||
text: string; | ||
fontSize?: string; | ||
fontWeight?: string; | ||
fontStyle?: string; | ||
textColor?: string; | ||
textAlign?: string; | ||
className?: string; | ||
}; | ||
|
||
const heading = ({ name }: InputProps) => { | ||
const Heading: React.FC<InputProps> = ({ | ||
text, | ||
fontSize = 'text-sm', // default value | ||
fontWeight = 'font-normal', // default value | ||
fontStyle = 'font-sans', // default value | ||
textColor = 'text-black', // default value | ||
textAlign = 'text-center', // default value | ||
className = '', // additional custom classes | ||
}) => { | ||
return ( | ||
<div> | ||
<h1 className="text-white text-3xl font-bold font-serif">{name}</h1> | ||
<h1 | ||
className={`${fontSize} ${fontWeight} ${fontStyle} ${textColor} ${textAlign} ${className}`} | ||
> | ||
{text} | ||
</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default heading; | ||
export default Heading; |
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