Skip to content

Commit

Permalink
Map: Apply coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Nov 30, 2023
1 parent fc751ab commit b0fff4b
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mu-plugins/blocks/google-map/postcss/style.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
& .wporg-map-marker__url a {
text-decoration: none;

&:after {
&::after {
content: "↗";
margin-left: 5px;
font-family: var(--wp--preset--font-family--inter);
Expand Down
2 changes: 0 additions & 2 deletions mu-plugins/blocks/google-map/src/components/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { formatLocation } from '../utilities/content';
* @param {Object} props
* @param {Array} props.markers
* @param {number} props.displayLimit
*
* @return {JSX.Element}
*/
export default function List( { markers, displayLimit } ) {
if ( markers.length === 0 ) {
Expand Down
2 changes: 0 additions & 2 deletions mu-plugins/blocks/google-map/src/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import { getValidMarkers } from '../utilities/google-maps-api';
* @param {string} props.searchIcon
* @param {Array} props.searchFields
* @param {number} props.listDisplayLimit
*
* @return {JSX.Element}
*/
export default function Main( {
blockStyle,
Expand Down
2 changes: 0 additions & 2 deletions mu-plugins/blocks/google-map/src/components/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import {
* @param {Array} props.markers
* @param {string} props.blockStyle
* @param {Object} props.icon
*
* @return {JSX.Element}
*/
export default function Map( { apiKey, markers: rawMarkers, icon, blockStyle } ) {
const [ loaded, setLoaded ] = useState( false );
Expand Down
6 changes: 0 additions & 6 deletions mu-plugins/blocks/google-map/src/components/marker-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { formatLocation } from '../utilities/content';
* Render the content for a map marker.
*
* @param {Object} props
*
* @return {JSX.Element}
*/
export default function MarkerContent( props ) {
const { type } = props;
Expand Down Expand Up @@ -38,8 +36,6 @@ export default function MarkerContent( props ) {
* @param {string} props.url
* @param {string} props.timestamp
* @param {string} props.location
*
* @return {JSX.Element}
*/
function WordCampMarker( { id, title, url, timestamp, location } ) {
return (
Expand Down Expand Up @@ -67,8 +63,6 @@ function WordCampMarker( { id, title, url, timestamp, location } ) {
* @param {string} props.meetup
* @param {string} props.timestamp
* @param {string} props.location
*
* @return {JSX.Element}
*/
function MeetupMarker( { id, title, url, meetup, timestamp, location } ) {
return (
Expand Down
2 changes: 0 additions & 2 deletions mu-plugins/blocks/google-map/src/components/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { __, _x } from '@wordpress/i18n';
* @param {string} props.searchQuery
* @param {Function} props.onQueryChange
* @param {string} props.iconURL
*
* @return {JSX.Element}
*/
export default function Search( { searchQuery, onQueryChange, iconURL } ) {
return (
Expand Down
2 changes: 1 addition & 1 deletion mu-plugins/blocks/google-map/src/utilities/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { __, sprintf } from '@wordpress/i18n';
*
* @param {string} location
*
* @return {string}
* @return {string} The formatted location.
*/
export function formatLocation( location ) {
if ( 'online' === location ) {
Expand Down
2 changes: 1 addition & 1 deletion mu-plugins/blocks/google-map/src/utilities/date-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @param {number} timestamp
*
* @return {string}
* @return {string} The formatted date and time.
*/
export function getEventDateTime( timestamp ) {
const eventDate = new Date( timestamp * 1000 );
Expand Down
2 changes: 1 addition & 1 deletion mu-plugins/blocks/google-map/src/utilities/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createRoot, flushSync } from '@wordpress/element';
*
* @param {JSX.Element} element
*
* @return {string}
* @return {string} The HTML for the given element.
*/
export default function getElementHTML( element ) {
const div = document.createElement( 'div' );
Expand Down
6 changes: 3 additions & 3 deletions mu-plugins/blocks/google-map/src/utilities/google-maps-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import getElementHTML from '../utilities/dom';
*
* @param {Array} markers
*
* @return {Array}
* @return {Array} Valid markers.
*/
export function getValidMarkers( markers ) {
markers = markers.map( ( marker ) => {
Expand All @@ -40,7 +40,7 @@ export function getValidMarkers( markers ) {
*
* @param {Array} rawMarkers
*
* @return {Array}
* @return {Array} The original markers, with events in the same location combined into a single marker.
*/
export function combineDuplicateLocations( rawMarkers ) {
const combinedMarkers = {};
Expand Down Expand Up @@ -144,7 +144,7 @@ function openInfoWindow( infoWindow, map, markerObject, rawMarker ) {
* @param {Object} rawIcon
* @param {string} blockStyle
*
* @return {MarkerClusterer}
* @return {MarkerClusterer} The clusterer object.
*/
export function clusterMarkers( map, maps, markers, rawIcon, blockStyle ) {
const clusterIcon = {
Expand Down
3 changes: 2 additions & 1 deletion mu-plugins/blocks/google-map/src/utilities/map-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ const sotw2023 = [
* This shouldn't be needed if https://github.com/WordPress/gutenberg/issues/56278 is resolved.
*
* @param { string } className
* @return { string }
*
* @return { string } The slug of the block style.
*/
export function getBlockStyle( className ) {
let blockStyle = 'wp20';
Expand Down

0 comments on commit b0fff4b

Please sign in to comment.