Skip to content

Commit d06e3c1

Browse files
committed
refactor: simplify pluginProps structure in ExtendedProfileFieldsSlot component
1 parent b9f35ee commit d06e3c1

File tree

1 file changed

+12
-8
lines changed
  • src/plugin-slots/ExtendedProfileFieldsSlot

1 file changed

+12
-8
lines changed

src/plugin-slots/ExtendedProfileFieldsSlot/index.jsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ const ExtendedProfileFieldsSlot = () => {
1212
const dispatch = useDispatch();
1313
const extendedProfileValues = useSelector((state) => state.profilePage.account.extendedProfile);
1414

15+
const pluginProps = {
16+
refreshUserProfile: (username) => dispatch(fetchProfile(username)),
17+
updateUserProfile: patchProfile,
18+
profileFieldValues: extendedProfileValues,
19+
formComponents: {
20+
SwitchContent,
21+
EmptyContent,
22+
EditableItemHeader,
23+
},
24+
};
25+
1526
return (
1627
<PluginSlot
1728
id="org.openedx.frontend.profile.extended_profile_fields.v1"
1829
idAliases={['extended_profile_fields_slot']}
19-
pluginProps={{
20-
fetchProfile: (username) => dispatch(fetchProfile(username)),
21-
patchProfile,
22-
extendedProfileValues,
23-
SwitchContent,
24-
EmptyContent,
25-
EditableItemHeader,
26-
}}
30+
pluginProps={pluginProps}
2731
/>
2832
);
2933
};

0 commit comments

Comments
 (0)