From 10f68a2ccb954fd1e612787a45a09a6898ac72d1 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 26 Aug 2024 01:13:44 +0200 Subject: [PATCH] [docs] Fix licensingModel -> licenseModel --- docs/pages/pricing.tsx | 6 ++--- ...delContext.tsx => LicenseModelContext.tsx} | 10 ++++---- ...ModelSwitch.tsx => LicenseModelSwitch.tsx} | 12 +++++----- docs/src/components/pricing/PricingList.tsx | 8 +++---- docs/src/components/pricing/PricingTable.tsx | 24 +++++++++---------- 5 files changed, 30 insertions(+), 30 deletions(-) rename docs/src/components/pricing/{LicensingModelContext.tsx => LicenseModelContext.tsx} (56%) rename docs/src/components/pricing/{LicensingModelSwitch.tsx => LicenseModelSwitch.tsx} (91%) diff --git a/docs/pages/pricing.tsx b/docs/pages/pricing.tsx index 3bae988fef5b80..9ffc17f0704147 100644 --- a/docs/pages/pricing.tsx +++ b/docs/pages/pricing.tsx @@ -13,7 +13,7 @@ import HeroEnd from 'docs/src/components/home/HeroEnd'; import AppFooter from 'docs/src/layouts/AppFooter'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; -import { LicensingModelProvider } from 'docs/src/components/pricing/LicensingModelContext'; +import { LicenseModelProvider } from 'docs/src/components/pricing/LicenseModelContext'; export default function Pricing() { return ( @@ -28,7 +28,7 @@ export default function Pricing() {
- + {/* Mobile, Tablet */} @@ -37,7 +37,7 @@ export default function Pricing() { - + diff --git a/docs/src/components/pricing/LicensingModelContext.tsx b/docs/src/components/pricing/LicenseModelContext.tsx similarity index 56% rename from docs/src/components/pricing/LicensingModelContext.tsx rename to docs/src/components/pricing/LicenseModelContext.tsx index 8fcc8d0c0612a2..56b51134897954 100644 --- a/docs/src/components/pricing/LicensingModelContext.tsx +++ b/docs/src/components/pricing/LicenseModelContext.tsx @@ -6,15 +6,15 @@ if (process.env.NODE_ENV !== 'production') { LicenseModel.displayName = 'LicenseModel'; } -export function LicensingModelProvider(props: any) { - const [licensingModel, setLicensingModel] = React.useState('annual'); +export function LicenseModelProvider(props: any) { + const [licenseModel, setLicenseModel] = React.useState('annual'); const value = React.useMemo( - () => ({ licensingModel, setLicensingModel }), - [licensingModel, setLicensingModel], + () => ({ licenseModel, setLicenseModel }), + [licenseModel, setLicenseModel], ); return {props.children}; } -export function useLicensingModel() { +export function useLicenseModel() { return React.useContext(LicenseModel); } diff --git a/docs/src/components/pricing/LicensingModelSwitch.tsx b/docs/src/components/pricing/LicenseModelSwitch.tsx similarity index 91% rename from docs/src/components/pricing/LicensingModelSwitch.tsx rename to docs/src/components/pricing/LicenseModelSwitch.tsx index 8e10672d7017d7..9ca62291573d83 100644 --- a/docs/src/components/pricing/LicensingModelSwitch.tsx +++ b/docs/src/components/pricing/LicenseModelSwitch.tsx @@ -4,7 +4,7 @@ import Box from '@mui/material/Box'; import Tooltip from '@mui/material/Tooltip'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; -import { useLicensingModel } from 'docs/src/components/pricing/LicensingModelContext'; +import { useLicenseModel } from 'docs/src/components/pricing/LicenseModelContext'; const StyledTabs = styled(Tabs)(({ theme }) => ({ margin: '14px auto 4px', @@ -94,19 +94,19 @@ const tooltipProps = { }, }; -export default function LicensingModelSwitch() { - const { licensingModel, setLicensingModel } = useLicensingModel(); +export default function LicenseModelSwitch() { + const { licenseModel, setLicenseModel } = useLicenseModel(); const handleChange = (event: React.SyntheticEvent, newValue: number) => { - setLicensingModel(newValue); + setLicenseModel(newValue); }; return ( (function Plan({ plan, benefits, unavailable, sx, ...props }, ref) { const globalTheme = useTheme(); const mode = globalTheme.palette.mode; - const { licensingModel } = useLicensingModel(); + const { licenseModel } = useLicenseModel(); return ( - + - + ) { function PricingTableDevelopment(props: any) { const { renderRow } = props; - const { licensingModel } = useLicensingModel(); + const { licenseModel } = useLicenseModel(); - return licensingModel === 'annual' + return licenseModel === 'annual' ? renderRow('mui-x-development') : renderRow('mui-x-development-perpetual'); } function PricingTableBuyPro() { - const { licensingModel } = useLicensingModel(); + const { licenseModel } = useLicenseModel(); return (