Skip to content

Commit

Permalink
Event Block: Update deprecated APIs (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende authored Nov 6, 2023
1 parent 0a5e856 commit f4f1352
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
4 changes: 3 additions & 1 deletion blocks/event/src/date-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const DateSelect = ( {
} ) => (
<Dropdown
className={ className }
position="bottom left"
popoverProps={ {
placement: 'bottom-start',
} }
renderToggle={ ( { onToggle, isOpen } ) => (
<Button
className="button"
Expand Down
7 changes: 2 additions & 5 deletions blocks/event/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
Button,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { __experimentalGetSettings, dateI18n } from '@wordpress/date';
import { getSettings, dateI18n } from '@wordpress/date';

/**
* Internal dependencies
Expand All @@ -43,7 +43,7 @@ const Edit = ( {
setBackgroundColor,
isSelected,
} ) => {
const settings = __experimentalGetSettings();
const settings = getSettings();

const classNames = [ textColor.class, backgroundColor.class ];
const style = {
Expand Down Expand Up @@ -152,7 +152,6 @@ const Edit = ( {
tagName="h3"
className="event__title"
value={ attributes.eventTitle }
keepPlaceholderOnFocus
onChange={ ( eventTitle ) =>
setAttributes( { eventTitle } )
}
Expand Down Expand Up @@ -190,8 +189,6 @@ const Edit = ( {
</span>
<RichText
value={ attributes.eventLocation }
multiline="false"
keepPlaceholderOnFocus
onChange={ ( eventLocation ) =>
setAttributes( { eventLocation } )
}
Expand Down
4 changes: 2 additions & 2 deletions blocks/event/src/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
RichText,
getColorClassName,
} from '@wordpress/block-editor';
import { __experimentalGetSettings, dateI18n } from '@wordpress/date';
import { getSettings, dateI18n } from '@wordpress/date';
import { __ } from '@wordpress/i18n';

/**
Expand All @@ -20,7 +20,7 @@ import { __ } from '@wordpress/i18n';
import DateSelect from './date-select';

const Save = ( { attributes } ) => {
const settings = __experimentalGetSettings();
const settings = getSettings();

const classNames = [
getColorClassName( 'color', attributes.textColor ),
Expand Down
14 changes: 10 additions & 4 deletions bundler/resources/a8c-event/readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Event Block ===
Contributors: automattic, ajlende, jasmussen
Stable tag: 1.0.2
Tested up to: 6.0
Requires at least: 5.4
Stable tag: 1.0.3
Tested up to: 6.4
Requires at least: 6.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: block, event, card
Expand All @@ -15,7 +15,9 @@ Let everyone know about the events going on. Whether you're hosting or attending

## Source and Support

You can follow development, file an issue, suggest features, and view the source at the Github repo: <a href="https://github.com/Automattic/block-experiments">https://github.com/Automattic/block-experiments</a>
This block is no longer under active development. Bug reports will be fixed, but no new features will be added.

Full source is available at the Github repo: <a href="https://github.com/Automattic/block-experiments">https://github.com/Automattic/block-experiments</a>

== Screenshots ==

Expand All @@ -24,6 +26,10 @@ You can follow development, file an issue, suggest features, and view the source

== Changelog ==

= 1.0.3 - 23nd October 2023 =
* Update to use stabilized APIs.
* Fix console warnings in the editor.

= 1.0.2 - 22nd July 2021 =
* Improve compatibility with block directory
* Fix center aligned styling
Expand Down

0 comments on commit f4f1352

Please sign in to comment.