-
Notifications
You must be signed in to change notification settings - Fork 875
Podcast: page chrome + empty tabs in dashboard route (3/4) #48559
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8005a9e
Podcast: scaffold AdminPage chrome + empty tabs in dashboard route
arcangelini baa9e5e
Podcast: drop redundant late_initialization loader
arcangelini 7cc07dc
Podcast: swap Welcome tab for Stats; default to Settings
arcangelini c59f252
Podcast: remove redundant 'do not translate' comment
arcangelini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Replace the wp-build placeholder with page chrome (title, tagline) plus tab navigation (Welcome, Settings, Episodes, Distribution). Each tab panel is still empty — PR 4 in the untangle train fills them in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,59 @@ | ||
| /** | ||
| * Podcast dashboard stage: page chrome + tab navigation. | ||
| * | ||
| * Placeholder scaffolding only — each tab panel renders a stub. PR 4 in the | ||
| * untangle train wires the full AdminPage + jetpack-components integration | ||
| * along with the real tab contents. | ||
| */ | ||
|
|
||
| import { useState, useCallback } from '@wordpress/element'; | ||
| import { __ } from '@wordpress/i18n'; | ||
| import { Tabs } from '@wordpress/ui'; | ||
|
|
||
| const TAB_VALUES = [ 'settings', 'episodes', 'distribution', 'stats' ] as const; | ||
| type TabName = ( typeof TAB_VALUES )[ number ]; | ||
|
|
||
| const isValidTab = ( value: string | null ): value is TabName => | ||
| !! value && ( TAB_VALUES as readonly string[] ).includes( value ); | ||
|
|
||
| const Stage = () => { | ||
| // "Podcast" is a product name, do not translate. | ||
| return <h1>Podcast</h1>; | ||
| const [ activeTab, setActiveTab ] = useState< TabName >( 'settings' ); | ||
|
|
||
| const handleTabChange = useCallback( ( value: string | null ) => { | ||
| if ( isValidTab( value ) ) { | ||
| setActiveTab( value ); | ||
| } | ||
| }, [] ); | ||
|
|
||
| return ( | ||
| <div className="wrap"> | ||
| <h1>Podcast</h1> | ||
| <p> | ||
| { __( 'Publish a podcast and reach your fans, anywhere they listen.', 'jetpack-podcast' ) } | ||
| </p> | ||
|
|
||
| <Tabs.Root value={ activeTab } onValueChange={ handleTabChange }> | ||
| <Tabs.List> | ||
| <Tabs.Tab value="settings">{ __( 'Settings', 'jetpack-podcast' ) }</Tabs.Tab> | ||
| <Tabs.Tab value="episodes">{ __( 'Episodes', 'jetpack-podcast' ) }</Tabs.Tab> | ||
| <Tabs.Tab value="distribution">{ __( 'Distribution', 'jetpack-podcast' ) }</Tabs.Tab> | ||
| <Tabs.Tab value="stats">{ __( 'Stats', 'jetpack-podcast' ) }</Tabs.Tab> | ||
| </Tabs.List> | ||
| <Tabs.Panel value="settings"> | ||
| <p>{ __( 'Settings — placeholder.', 'jetpack-podcast' ) }</p> | ||
| </Tabs.Panel> | ||
| <Tabs.Panel value="episodes"> | ||
| <p>{ __( 'Episodes — placeholder.', 'jetpack-podcast' ) }</p> | ||
| </Tabs.Panel> | ||
| <Tabs.Panel value="distribution"> | ||
| <p>{ __( 'Distribution — placeholder.', 'jetpack-podcast' ) }</p> | ||
| </Tabs.Panel> | ||
| <Tabs.Panel value="stats"> | ||
| <p>{ __( 'Stats — placeholder.', 'jetpack-podcast' ) }</p> | ||
| </Tabs.Panel> | ||
| </Tabs.Root> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export { Stage as stage }; | ||
5 changes: 5 additions & 0 deletions
5
projects/plugins/jetpack/changelog/add-podcast-admin-tabs-scaffold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Significance: patch | ||
| Type: other | ||
| Comment: Podcast: drop redundant late_initialization load — the package is loaded via jetpack-mu-wpcom on Simple/Atomic, and the host gate makes the Jetpack plugin call a no-op. | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend doing a follow-up to use Jetpack's admin-page component to match the visual style with the rest of Jetpack stuff. :-)