| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | import { BaseControl } from '@wordpress/components'; |
| 2 | 2 | import { sprintf, __ } from '@wordpress/i18n'; |
| 3 | 3 | import { Attributes } from '../../types'; |
| 4 | 4 | import { SimpleStringEnd } from './footers/SimpleStringEnd'; |
| 5 | +import { SimpleStringStart } from './footers/SimpleStringStart'; | |
| 5 | 6 | |
| 6 | 7 | type FooterSelectProps = { |
| 7 | 8 | attributes: Attributes; |
| 8 | 9 | onClick: (slug: string) => void; |
| @@ -13,8 +14,9 @@ | ||
| 13 | 14 | const { bgColor } = attributes; |
| 14 | 15 | const types = { |
| 15 | 16 | none: __('None', 'code-block-pro'), |
| 16 | 17 | simpleStringEnd: __('Simple string end', 'code-block-pro'), |
| 18 | + simpleStringStart: __('Simple string start', 'code-block-pro'), | |
| 17 | 19 | }; |
| 18 | 20 | |
| 19 | 21 | return ( |
| 20 | 22 | <div className="code-block-pro-editor"> |
| @@ -29,10 +31,14 @@ | ||
| 29 | 31 | ) |
| 30 | 32 | : type |
| 31 | 33 | } |
| 32 | 34 | help={ |
| 33 | - ['simpleStringEnd'].includes(slug) | |
| 34 | - ? __('Update text in Settings', 'code-block-pro') | |
| 35 | + ['simpleStringEnd', 'simpleStringStart'].includes(slug) | |
| 36 | + ? // Settings refers to the panel that can be expanded | |
| 37 | + __( | |
| 38 | + 'Update extras in the Settings panel', | |
| 39 | + 'code-block-pro', | |
| 40 | + ) | |
| 35 | 41 | : undefined |
| 36 | 42 | } |
| 37 | 43 | key={slug}> |
| 38 | 44 | <button |
| @@ -56,11 +62,15 @@ | ||
| 56 | 62 | </div> |
| 57 | 63 | ); |
| 58 | 64 | }; |
| 59 | 65 | |
| 60 | -export const FooterType = (attributes: Partial<Attributes>) => { | |
| 61 | - const { footerType } = attributes; | |
| 66 | +export const FooterType = (props: Partial<Attributes>) => { | |
| 67 | + const { footerType } = props; | |
| 62 | 68 | if (footerType === 'simpleStringEnd') { |
| 63 | - return <SimpleStringEnd {...attributes} />; | |
| 69 | + return <SimpleStringEnd {...props} />; | |
| 64 | 70 | } |
| 71 | + if (footerType === 'simpleStringStart') { | |
| 72 | + return <SimpleStringStart {...props} />; | |
| 73 | + } | |
| 74 | + | |
| 65 | 75 | return null; |
| 66 | 76 | }; |