Skip to content

Commit

Permalink
Change name to wespearfish
Browse files Browse the repository at this point in the history
  • Loading branch information
arcangelini committed Aug 18, 2024
1 parent a7945d0 commit 38ac9a5
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "spearfishing-stuff",
"name": "wespearfish",
"version": "1.0.0",
"description": "Example block scaffolded with Create Block tool.",
"author": "arcangelinis",
Expand Down
4 changes: 2 additions & 2 deletions src/scale-section/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "spearfishing-stuff/scale-section",
"name": "wespearfish/scale-section",
"version": "0.1.0",
"title": "Scale Section",
"category": "widgets",
Expand All @@ -11,7 +11,7 @@
"supports": {
"html": false
},
"textdomain": "spearfishing-stuff",
"textdomain": "wespearfish",
"attributes": {
"content": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/scale-section/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.wp-block-spearfishing-stuff-scale-section {
.wp-block-wespearfish-scale-section {
display: grid;
place-content: center;
background-color: inherit;
Expand Down
4 changes: 2 additions & 2 deletions src/weather/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "spearfishing-stuff/weather",
"name": "wespearfish/weather",
"version": "0.1.0",
"title": "Fishing Weather",
"category": "widgets",
Expand All @@ -10,7 +10,7 @@
"supports": {
"html": false
},
"textdomain": "spearfishing-stuff",
"textdomain": "wespearfish",
"attributes": {
"time": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/weather/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Edit({ attributes, setAttributes }) {
return (
<>
<div {...blockProps}>
<ServerSideRender block="spearfishing-stuff/weather" attributes={{time: time}}/>
<ServerSideRender block="wespearfish/weather" attributes={{time: time}}/>
</div>
<InspectorControls>
<PanelBody title="Data" initialOpen={true}>
Expand Down
2 changes: 1 addition & 1 deletion src/weather/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.wp-block-spearfishing-stuff-weather {
.wp-block-wespearfish-weather {
margin: 20px auto;
max-width: 1440px;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion weather-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function get_current_weather_data() {
$cache_key = 'spearfishing_current_weather_data';
$cached_response = wp_cache_get( $cache_key );

if ( true ) {
if ( $cached_response ) {
$current_weather_data = fetch_current_weather_data();
wp_cache_set( $cache_key, $current_weather_data, '', 600 );

Expand Down
4 changes: 2 additions & 2 deletions weather-block-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function render_weather_block( $block_attributes, $content ) {
}

return <<<HTML
<div class='wp-block-spearfishing-stuff-weather'>
<div class='wp-block-wespearfish-weather'>
<div class='wp-spearfishing-weather-content forecast'>
$output
</div>
Expand All @@ -223,7 +223,7 @@ function render_weather_block( $block_attributes, $content ) {

if ( $block_attributes['time'] === 'current' ) {
return <<<HTML
<div tabindex='0' class='block-editor-block-list__block wp-block is-selected wp-block-spearfishing-stuff-weather' id='block-c1c77b42-4262-4198-b235-3c79e3b8ae38' role='document' aria-label='Block: Fishing Weather' data-block='c1c77b42-4262-4198-b235-3c79e3b8ae38' data-type='spearfishing-stuff/weather' data-title='Fishing Weather'>
<div tabindex='0' class='block-editor-block-list__block wp-block is-selected wp-block-wespearfish-weather' id='block-c1c77b42-4262-4198-b235-3c79e3b8ae38' role='document' aria-label='Block: Fishing Weather' data-block='c1c77b42-4262-4198-b235-3c79e3b8ae38' data-type='wespearfish/weather' data-title='Fishing Weather'>
<div class='wp-spearfishing-weather-content current'>
<div class='weather-data wind'>
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='45' height='45' aria-hidden='true' focusable='false' style="transform: rotate({$weather_data['wind_direction_to_degree']}deg);">
Expand Down

0 comments on commit 38ac9a5

Please sign in to comment.