File tree Expand file tree Collapse file tree
src/library-authoring/add-content Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,14 +154,18 @@ const AddAdvancedContentView = ({
154154 isBlockTypeEnabled,
155155} : AddAdvancedContentViewProps ) => {
156156 const intl = useIntl ( ) ;
157+ // Sort block types alphabetically by default display name
158+ const sortedBlockTypes = Object . keys ( advancedBlocks ) . sort ( ( typeA , typeB ) => (
159+ advancedBlocks [ typeA ] . displayName . localeCompare ( advancedBlocks [ typeB ] . displayName )
160+ ) ) ;
157161 return (
158162 < >
159163 < div className = "d-flex" >
160164 < Button variant = "tertiary" iconBefore = { KeyboardBackspace } onClick = { closeAdvancedList } >
161165 { intl . formatMessage ( messages . backToAddContentListButton ) }
162166 </ Button >
163167 </ div >
164- { Object . keys ( advancedBlocks ) . map ( ( blockType ) => (
168+ { sortedBlockTypes . map ( ( blockType ) => (
165169 isBlockTypeEnabled ( blockType ) ? (
166170 < AddContentButton
167171 key = { `add-content-${ blockType } ` }
You can’t perform that action at this time.
0 commit comments