Skip to content

Commit

Permalink
Add an about section in the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto committed Jun 3, 2024
1 parent a621674 commit 8342681
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
86 changes: 86 additions & 0 deletions src/editor-sidebar/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import {
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalVStack as VStack,
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalText as Text,
PanelBody,
ExternalLink,
} from '@wordpress/components';

/**
* Internal dependencies
*/
import ScreenHeader from './screen-header';

function AboutPlugin() {
return (
<PanelBody>
<ScreenHeader
title={ __( 'About the plugin', 'create-block-theme' ) }
/>
<VStack>
<Text>
{ __(
'Create Block Theme is a tool to help you make Block Themes using the WordPress Editor. It does this by adding tools to the Editor to help you create and manage your theme.',
'create-block-theme'
) }
</Text>

<Text>
{ __(
"Themes created with Create Block Theme don't require Create Block Theme to be installed on the site where the theme is used.",
'create-block-theme'
) }
</Text>

<hr />

<Text weight="bold">
{ __( 'Help', 'create-block-theme' ) }
</Text>

<Text>
<>
{ __( 'Have a question?', 'create-block-theme' ) }
<br />
<ExternalLink href="https://wordpress.org/support/plugin/create-block-theme/">
{ __( 'Ask in the forums.', 'create-block-theme' ) }
</ExternalLink>
</>
</Text>

<Text>
<>
{ __( 'Found a bug?', 'create-block-theme' ) }
<br />
<ExternalLink href="https://github.com/WordPress/create-block-theme/issues">
{ __(
'Report it on GitHub.',
'create-block-theme'
) }
</ExternalLink>
</>
</Text>

<Text>
<>
{ __( 'Want to contribute?', 'create-block-theme' ) }
<br />
<ExternalLink href="https://github.com/WordPress/create-block-theme">
{ __(
'Check out the project on GitHub.',
'create-block-theme'
) }
</ExternalLink>
</>
</Text>
</VStack>
</PanelBody>
);
}

export default AboutPlugin;
26 changes: 26 additions & 0 deletions src/plugin-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
chevronRight,
addCard,
blockMeta,
help,
} from '@wordpress/icons';

/**
Expand All @@ -50,6 +51,7 @@ import ScreenHeader from './editor-sidebar/screen-header';
import { downloadExportedTheme } from './resolvers';
import downloadFile from './utils/download-file';
import './plugin-styles.scss';
import AboutPlugin from './editor-sidebar/about';

const CreateBlockThemePlugin = () => {
const [ isEditorOpen, setIsEditorOpen ] = useState( false );
Expand Down Expand Up @@ -183,6 +185,26 @@ const CreateBlockThemePlugin = () => {
<Icon icon={ chevronRight } />
</HStack>
</NavigatorButton>

<hr></hr>

<NavigatorButton
path="/about"
icon={ help }
className={
'create-block-theme__plugin-sidebar__about-button'
}
>
<Spacer />
<HStack>
<FlexItem>
{ __(
'Help',
'create-block-theme'
) }
</FlexItem>
</HStack>
</NavigatorButton>
</VStack>
</PanelBody>
</NavigatorScreen>
Expand Down Expand Up @@ -271,6 +293,10 @@ const CreateBlockThemePlugin = () => {
<NavigatorScreen path="/save">
<SaveThemePanel />
</NavigatorScreen>

<NavigatorScreen path="/about">
<AboutPlugin />
</NavigatorScreen>
</NavigatorProvider>
</PluginSidebar>

Expand Down
11 changes: 11 additions & 0 deletions src/plugin-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,15 @@ $modal-footer-height: 70px;
object-fit: cover;
}
}

&__plugin-sidebar {
&__about-button {
color: #949494;
margin-top: 3rem;
}

&__about-button svg {
fill: #949494;
}
}
}

0 comments on commit 8342681

Please sign in to comment.