From 3fce04a20dadb7ae7e23c0fbb32247898aaa4e87 Mon Sep 17 00:00:00 2001 From: Sawan Date: Mon, 21 Oct 2024 14:34:00 +0530 Subject: [PATCH 1/4] Added required field in model components --- src/App.tsx | 19 +- src/components/Checkbox.tsx | 49 +-- src/components/CheckboxDetails.tsx | 406 +++++++++++++------------ src/components/Footer.tsx | 70 ++--- src/components/GlassyUILandingPage.tsx | 3 +- src/components/ModalDetailsPage.tsx | 270 +++++++++++++++- 6 files changed, 544 insertions(+), 273 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6713edf..3e22772 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,7 +7,6 @@ import { useLocation, } from 'react-router-dom'; -import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; import ScrollProgressBar from './components/ScrollProgress'; // Import your ScrollProgressBar component import PricingDetailPage from './components/PricingDetailPage'; @@ -39,10 +38,10 @@ import ContactUsDetailsPage from './components/ContactUsDetailsPage'; import PaginationDetails from './components/PaginationDetails'; import TestimonialDetails from './components/TestimonialDetails'; import Footer from './components/Footer'; - import Statistic from './components/StatisticDetails'; - import GalleryDetailsPage from './components/GalleryDetailsPage'; - import Checkbox from './components/Checkbox'; - +import Statistic from './components/StatisticDetails'; +import GalleryDetailsPage from './components/GalleryDetailsPage'; +// import Checkbox from './components/Checkbox'; + const App: React.FC = () => { return ( @@ -79,12 +78,12 @@ const App: React.FC = () => { } /> } /> } /> - } /> - } /> + } /> + } /> + + + {/* } /> */} - - } /> - } /> diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx index 312f1b6..5fa1a6f 100644 --- a/src/components/Checkbox.tsx +++ b/src/components/Checkbox.tsx @@ -1,23 +1,34 @@ -import React, { useState } from 'react'; +// import React, { useState } from 'react'; -import CheckboxDetails from './CheckboxDetails'; +// import CheckboxDetails from './CheckboxDetails'; -const Checkbox: React.FC = () => { - const [isChecked, setIsChecked] = useState(false); +// const Checkbox: React.FC = () => { +// const [isChecked, setIsChecked] = useState(false); +// return ( +//
+// setIsChecked(checked)} +// label='I agree to the terms' +// size='medium' +// borderColor='#4A90E2' +// backgroundColor='#E5F1FB' +// checkColor='#007bff' +// /> +//
+// ); +// }; + +// export default Checkbox; + + +import React from 'react' + +const Checkbox = () => { return ( -
- setIsChecked(checked)} - label='I agree to the terms' - size='medium' - borderColor='#4A90E2' - backgroundColor='#E5F1FB' - checkColor='#007bff' - /> -
- ); -}; - -export default Checkbox; +
Checkbox
+ ) +} + +export default Checkbox \ No newline at end of file diff --git a/src/components/CheckboxDetails.tsx b/src/components/CheckboxDetails.tsx index 9716205..8dd0907 100644 --- a/src/components/CheckboxDetails.tsx +++ b/src/components/CheckboxDetails.tsx @@ -1,200 +1,210 @@ -import React, { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { ArrowLeft, Copy, Check } from 'lucide-react'; -import BackToTopButton from './BackToTop'; - -// Custom Checkbox component -const Checkbox = ({ - checked, - onChange, - label, -}: { - checked: boolean; - onChange: () => void; - label: string; -}) => ( - -); - -const CheckboxDetailsPage: React.FC = () => { - const navigate = useNavigate(); - const [copiedStates, setCopiedStates] = useState<{ [key: string]: boolean }>( - {}, - ); - const [isChecked, setIsChecked] = useState(false); - - const getGlassyClasses = (opacity = 20) => { - return `backdrop-filter backdrop-blur-lg bg-white bg-opacity-${opacity} - border border-white border-opacity-20 rounded-lg shadow-lg transition-all duration-300`; - }; - - const copyToClipboard = (text: string, key: string) => { - navigator.clipboard.writeText(text).then(() => { - setCopiedStates(prev => ({ ...prev, [key]: true })); - setTimeout( - () => setCopiedStates(prev => ({ ...prev, [key]: false })), - 2000, - ); - }); - }; - - const CopyButton: React.FC<{ text: string; codeKey: string }> = ({ - text, - codeKey, - }) => ( - - ); - - const basicUsageCode = `function ExampleCheckbox() { - const [isChecked, setIsChecked] = useState(false); - +// import React, { useState } from 'react'; +// import { useNavigate } from 'react-router-dom'; +// import { ArrowLeft, Copy, Check } from 'lucide-react'; +// import BackToTopButton from './BackToTop'; + +// // Custom Checkbox component +// const Checkbox = ({ +// checked, +// onChange, +// label, +// }: { +// checked: boolean; +// onChange: () => void; +// label: string; +// }) => ( +// +// ); + +// const CheckboxDetailsPage: React.FC = () => { +// const navigate = useNavigate(); +// const [copiedStates, setCopiedStates] = useState<{ [key: string]: boolean }>( +// {}, +// ); +// const [isChecked, setIsChecked] = useState(false); + +// const getGlassyClasses = (opacity = 20) => { +// return `backdrop-filter backdrop-blur-lg bg-white bg-opacity-${opacity} +// border border-white border-opacity-20 rounded-lg shadow-lg transition-all duration-300`; +// }; + +// const copyToClipboard = (text: string, key: string) => { +// navigator.clipboard.writeText(text).then(() => { +// setCopiedStates(prev => ({ ...prev, [key]: true })); +// setTimeout( +// () => setCopiedStates(prev => ({ ...prev, [key]: false })), +// 2000, +// ); +// }); +// }; + +// const CopyButton: React.FC<{ text: string; codeKey: string }> = ({ +// text, +// codeKey, +// }) => ( +// +// ); + +// const basicUsageCode = `function ExampleCheckbox() { +// const [isChecked, setIsChecked] = useState(false); + +// return ( +// setIsChecked(!isChecked)} +// label="Accept Terms" +// /> +// ); +// }`; + +// const customizableCheckboxCode = ` setIsChecked(!isChecked)} +// label="Custom Styled Checkbox" +// className={getGlassyClasses()} +// />`; + +// const propsTable = ( +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +//
PropTypeDefaultDescription
checkedbooleanfalse +// Determines if the checkbox is checked +//
onChangefunction- +// Callback when checkbox state changes +//
labelstring""Text label next to the checkbox
+// ); + +// return ( +//
+// +//
+// + +//

Checkbox

+//

+// A customizable, glassmorphism-styled checkbox component. +//

+ +// {/* Basic Usage */} +//
+//

Basic Usage

+//
+//
+//               {basicUsageCode}
+//             
+// +//
+//
+ +// {/* Props */} +//
+//

Props

+//
{propsTable}
+//
+ +// {/* Customizable Checkbox */} +//
+//

+// Customizable Checkbox +//

+//

+// A customizable checkbox that allows you to adjust its background, +// border, and text colors. +//

+//
+// setIsChecked(!isChecked)} +// label='Custom Styled Checkbox' +// /> +//
+//               {customizableCheckboxCode}
+//             
+// +//
+//
+ +// {/* Disabled Checkbox */} +//
+//

+// Disabled Checkbox +//

+//

+// A checkbox that is disabled and cannot be clicked. +//

+// { }} +// label='Disabled Checkbox' +// /> +//
+//
+//
+// ); +// }; + +// export default CheckboxDetailsPage; + +import React from 'react' + +const CheckboxDetails = () => { return ( - setIsChecked(!isChecked)} - label="Accept Terms" - /> - ); -}`; - - const customizableCheckboxCode = ` setIsChecked(!isChecked)} - label="Custom Styled Checkbox" - className={getGlassyClasses()} -/>`; - - const propsTable = ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropTypeDefaultDescription
checkedbooleanfalse - Determines if the checkbox is checked -
onChangefunction- - Callback when checkbox state changes -
labelstring""Text label next to the checkbox
- ); +
CheckboxDetails
+ ) +} - return ( -
- -
- - -

Checkbox

-

- A customizable, glassmorphism-styled checkbox component. -

- - {/* Basic Usage */} -
-

Basic Usage

-
-
-              {basicUsageCode}
-            
- -
-
- - {/* Props */} -
-

Props

-
{propsTable}
-
- - {/* Customizable Checkbox */} -
-

- Customizable Checkbox -

-

- A customizable checkbox that allows you to adjust its background, - border, and text colors. -

-
- setIsChecked(!isChecked)} - label='Custom Styled Checkbox' - /> -
-              {customizableCheckboxCode}
-            
- -
-
- - {/* Disabled Checkbox */} -
-

- Disabled Checkbox -

-

- A checkbox that is disabled and cannot be clicked. -

- {}} - label='Disabled Checkbox' - /> -
-
-
- ); -}; - -export default CheckboxDetailsPage; +export default CheckboxDetails diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index cf438eb..b4bd892 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -5,41 +5,42 @@ import GoogleTranslate from './GoogleTranslator'; const Footer: React.FC = () => { return ( -