@yorkjs/hive-ui 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -123,16 +123,25 @@ const RichTextEditor: React.FC<RichTextEditorProps> = (props) => {
|
|
|
123
123
|
<View className={styles['align-toolbar']}>
|
|
124
124
|
{ALIGN_OPTIONS.map((align) => {
|
|
125
125
|
const active = (block.align || 'left') === align
|
|
126
|
+
const disabled = !block.content?.trim()
|
|
126
127
|
return (
|
|
127
128
|
<View
|
|
128
129
|
key={align}
|
|
129
|
-
className={
|
|
130
|
-
|
|
130
|
+
className={formatClassNames(
|
|
131
|
+
styles['align-btn'],
|
|
132
|
+
disabled ? styles['is-disabled'] : ''
|
|
133
|
+
)}
|
|
134
|
+
onClick={() => {
|
|
135
|
+
if (disabled) return
|
|
136
|
+
handleAlignChange(index, align)
|
|
137
|
+
}}
|
|
131
138
|
>
|
|
132
139
|
<Icon
|
|
133
140
|
name={`align-${align}`}
|
|
134
141
|
size={16}
|
|
135
|
-
color={
|
|
142
|
+
color={disabled
|
|
143
|
+
? 'var(--textMuted)'
|
|
144
|
+
: active ? 'var(--textTitle)' : 'var(--textMuted)'}
|
|
136
145
|
/>
|
|
137
146
|
</View>
|
|
138
147
|
)
|