Skip to content

Commit

Permalink
[#12] refactor header part to header pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Dec 14, 2023
1 parent df15a2b commit 72a2737
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 38 deletions.
9 changes: 9 additions & 0 deletions themes/goodbids-nonprofit/inc/patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ function () {
'init',
function () {
$patterns = [
[
'name' => 'header-nonprofit',
'file' => 'patterns/header-nonprofit.php',
'title' => __( 'GoodBids Header', 'goodbids-nonprofit' ),
'categories' => [ 'header', 'goodbids-np' ],
'keywords' => [ 'header', 'non-profit', 'template' ],
'blockTypes' => [ 'core/template-part/header' ],
'source' => 'theme',
],
[
'name' => 'template-home-nonprofit',
'file' => 'patterns/template-home-nonprofit.php',
Expand Down
39 changes: 1 addition & 38 deletions themes/goodbids-nonprofit/parts/header.html
Original file line number Diff line number Diff line change
@@ -1,38 +1 @@
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"20px","bottom":"20px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide has-background"
style="padding-top:20px;padding-bottom:20px">
<!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
<div class="wp-block-group alignwide">
<!-- wp:group {"style":{"spacing":{"blockGap":"0.2rem"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} -->
<div class="wp-block-group">

<!-- wp:site-logo {"width":160,"shouldSyncIcon":true,"style":{"spacing":{"margin":{"top":"0","bottom":"0","left":"0","right":"0.5rem"}}}} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
<div class="wp-block-group">
<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"25px"}},"fontSize":"x-small"} -->
<p class="has-x-small-font-size">for</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
<div class="wp-block-group">
<!-- wp:site-title {"level":0,"fontSize":"x-small"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:navigation {"ref":13,"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"fontSize":"x-small"} /-->
<!-- wp:loginout {"className":"wp-button-custom","style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"textColor":"base-2","fontSize":"x-small"} /-->
</div>
<!-- /wp:group -->

</div>

<!-- /wp:group -->
</div>
<!-- /wp:group -->
<!-- wp:pattern {"slug":"goodbids-np/header-nonprofit"} /-->
37 changes: 37 additions & 0 deletions themes/goodbids-nonprofit/patterns/header-nonprofit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"20px","bottom":"20px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide has-background"
style="padding-top:20px;padding-bottom:20px">
<!-- wp:group {"align":"wide","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
<div class="wp-block-group alignwide">
<!-- wp:group {"style":{"spacing":{"blockGap":"0.2rem"},"layout":{"selfStretch":"fit","flexSize":null}},"layout":{"type":"flex"}} -->
<div class="wp-block-group">

<!-- wp:site-logo {"width":160,"shouldSyncIcon":true,"style":{"spacing":{"margin":{"top":"0","bottom":"0","left":"0","right":"0.5rem"}}}} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
<div class="wp-block-group">
<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"25px"}},"fontSize":"x-small"} -->
<p class="has-x-small-font-size"><?php esc_html_e( 'for', 'goodbids-nonprofit' ); ?></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
<div class="wp-block-group">
<!-- wp:site-title {"level":0,"fontSize":"x-small"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:navigation {"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"},"style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"fontSize":"x-small"} /-->
<!-- wp:loginout {"className":"wp-button-custom","style":{"spacing":{"margin":{"top":"0"},"blockGap":"var:preset|spacing|20"},"layout":{"selfStretch":"fit","flexSize":null}},"textColor":"base-2","fontSize":"x-small"} /-->
</div>
<!-- /wp:group -->
</div>

<!-- /wp:group -->
</div>
<!-- /wp:group -->

0 comments on commit 72a2737

Please sign in to comment.