Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.9対応 インライン文字サイズの再編集にする #965

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/extensions/common/inline-font-size/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
} from '@wordpress/rich-text';

import { RichTextToolbarButton, URLPopover } from '@wordpress/block-editor';
import { FontSizePicker, Button, Icon } from '@wordpress/components';
import { ReactComponent as IconSVG } from './icon.svg';

import { FontSizePicker, Button } from '@wordpress/components';

import { ReactComponent as Icon } from './icon.svg';
import compareVersions from 'compare-versions';

const name = 'vk-blocks/inline-font-size';

Expand Down Expand Up @@ -80,12 +80,11 @@ const FontSizeEdit = (props) => {
}}
shortcutType={shortcutType}
shortcutCharacter={shortcutChar}
key={isActive ? 'text-color' : 'text-color-not-active'}
className="format-library-text-color-button"
name={isActive ? 'text-color' : undefined}
isActive={isActive}
icon={
<>
<Icon icon={Icon} style={iconStyle} />
<Icon icon={IconSVG} style={iconStyle} />
</>
}
/>
Expand All @@ -101,7 +100,13 @@ const FontSizeEdit = (props) => {
fontSizes={fontSizes}
value={selectedFontSize}
fallbackFontSize={fallbackFontSize}
withSlider={true}
withSlider={
window.wpVersion !== undefined &&
window.wpVersion !== null &&
compareVersions(window.wpVersion, '5.9') < 0
? true
: false
}
onChange={(newFontSize) => {
if (newFontSize) {
onChange(
Expand Down