| @@ -8,27 +8,24 @@ | ||
| 8 | 8 | import { ThemeFilter } from './ThemeFilter'; |
| 9 | 9 | import { ThemeSelect } from './ThemeSelect'; |
| 10 | 10 | |
| 11 | 11 | export const ThemesPanel = ({ |
| 12 | - bringAttentionToThemes, | |
| 13 | 12 | attributes, |
| 14 | 13 | setAttributes, |
| 15 | -}: AttributesPropsAndSetter & { bringAttentionToThemes?: boolean }) => { | |
| 14 | +}: AttributesPropsAndSetter) => { | |
| 16 | 15 | const { updateThemeHistory } = useThemeStore(); |
| 17 | 16 | const [search, setSearch] = useState<string>(''); |
| 18 | 17 | const ready = useSettingsStoreReady(); |
| 19 | 18 | return ( |
| 20 | - <PanelBody | |
| 21 | - title={__('Theme', 'code-block-pro')} | |
| 22 | - initialOpen={bringAttentionToThemes ?? false}> | |
| 19 | + <PanelBody title={__('Themes', 'code-block-pro')} initialOpen={false}> | |
| 23 | 20 | {ready && <ThemeFilter search={search} setSearch={setSearch} />} |
| 24 | 21 | {ready && ( |
| 25 | 22 | <ThemeSelect |
| 26 | 23 | {...attributes} |
| 27 | 24 | search={search} |
| 28 | - onClick={(theme: Theme) => { | |
| 29 | - setAttributes({ theme }); | |
| 30 | - updateThemeHistory({ theme }); | |
| 25 | + onClick={(slug: Theme) => { | |
| 26 | + setAttributes({ theme: slug }); | |
| 27 | + updateThemeHistory({ ...attributes, theme: slug }); | |
| 31 | 28 | }} |
| 32 | 29 | /> |
| 33 | 30 | )} |
| 34 | 31 | </PanelBody> |