Skip to content

Commit

Permalink
add: plan data
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbhayel committed Dec 13, 2024
1 parent 8187036 commit dace3a3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import { CreditCardIcon, UserArrowIcon } from '@ea11y/icons';
import { __ } from '@wordpress/i18n';

const MyAccountMenu = () => {
const { openSidebar } = useSettings();
const { openSidebar, planData } = useSettings();
const accountMenuState = usePopupState({
variant: 'popover',
popupId: 'myAccountMenu',
});
console.log(planData);
return (
<>
<List>
Expand Down Expand Up @@ -68,7 +69,7 @@ const MyAccountMenu = () => {
Jack Baueuer
</Typography>
<Typography variant="caption" color="common.white">
[email protected]
{planData?.user?.email}
</Typography>
</Box>
</MenuItem>
Expand Down
4 changes: 4 additions & 0 deletions modules/settings/assets/js/hooks/use-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const SettingsProvider = ({ children }) => {
},
});

const [planData, setPlanData] = useState(null);

// Track settings changes to enable/disable Save Changes button
const [hasChanges, setHasChanges] = useState(false);
const [hideMinimumOptionAlert, setHideMinimumOptionAlert] = useState(false);
Expand Down Expand Up @@ -99,6 +101,8 @@ export const SettingsProvider = ({ children }) => {
setIconDesign,
hasChanges,
setHasChanges,
planData,
setPlanData,
}}
>
{children}
Expand Down
9 changes: 9 additions & 0 deletions modules/settings/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ public function register_settings(): void {
],
]
],
'plan_data' => [
'type' => 'object',
'show_in_rest' => [
'schema' => [
'type' => 'object',
'additionalProperties' => true
],
]
],
'close_post_connect_modal' => [
'type' => 'boolean',
],
Expand Down

0 comments on commit dace3a3

Please sign in to comment.