From 528d822dc92117a36d114b5c1e33710bad14e132 Mon Sep 17 00:00:00 2001 From: sksmagr23 Date: Fri, 7 Jun 2024 11:06:08 +0530 Subject: [PATCH] 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 --- frontend/src/library/heading.tsx | 26 ++++++++++++++++++++++---- frontend/src/pages/PlayOptions.tsx | 12 +++++------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/frontend/src/library/heading.tsx b/frontend/src/library/heading.tsx index 510cf54..b595a21 100644 --- a/frontend/src/library/heading.tsx +++ b/frontend/src/library/heading.tsx @@ -1,13 +1,31 @@ +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 = ({ + 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 (
-

{name}

+

+ {text} +

); }; -export default heading; +export default Heading diff --git a/frontend/src/pages/PlayOptions.tsx b/frontend/src/pages/PlayOptions.tsx index df10c29..928382c 100644 --- a/frontend/src/pages/PlayOptions.tsx +++ b/frontend/src/pages/PlayOptions.tsx @@ -27,20 +27,18 @@ const PlayOptions = () => { alt="UNO Logo" className="h-12 w-auto mr-2" /> -

- Ready for Action? -

+
-
+
- +
-
+
- +