Skip to content
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

Add an about section in the editor #667

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 />
mikachan marked this conversation as resolved.
Show resolved Hide resolved

<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>
mikachan marked this conversation as resolved.
Show resolved Hide resolved

<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;
mikachan marked this conversation as resolved.
Show resolved Hide resolved
margin-top: 3rem;
}

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