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

[Toolpad Editor] Add themes docs link to theme panel #2583

Merged
merged 5 commits into from
Aug 30, 2023
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TabContext, TabList, TabPanel } from '@mui/lab';
import { Tab, Box, styled, Typography } from '@mui/material';
import { Tab, Box, styled, Typography, Link } from '@mui/material';
import * as React from 'react';
import PageOptionsPanel from './PageOptionsPanel';
import ComponentEditor from './ComponentEditor';
Expand Down Expand Up @@ -45,6 +45,7 @@ const propTypeControls: PropTypeControls = {

const classes = {
panel: 'Toolpad_Panel',
themesDocsLink: 'Toolpad_ThemesDocsLink',
};

const ComponentPanelRoot = styled('div')(({ theme }) => ({
Expand All @@ -56,6 +57,9 @@ const ComponentPanelRoot = styled('div')(({ theme }) => ({
padding: theme.spacing(2),
overflow: 'auto',
},
[`& .${classes.themesDocsLink}`]: {
marginBottom: theme.spacing(1),
},
}));

export interface ComponentPanelProps {
Expand Down Expand Up @@ -97,6 +101,13 @@ export default function ComponentPanel({ className }: ComponentPanelProps) {
)}
</TabPanel>
<TabPanel value="theme" className={classes.panel}>
<Typography className={classes.themesDocsLink} variant="body2">
Customize the app with a MUI theme. Read more about this in the{' '}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's uses Material UI:

Suggested change
Customize the app with a MUI theme. Read more about this in the{' '}
Customize the app with a Material UI theme. Read more about this in the{' '}

Fixed in ddffda5

<Link href="https://mui.com/toolpad/concepts/theming" target="_blank" rel="noopener">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a 301, slowing down the page load speed.

Suggested change
<Link href="https://mui.com/toolpad/concepts/theming" target="_blank" rel="noopener">
<Link href="https://mui.com/toolpad/concepts/theming/" target="_blank" rel="noopener">

Fixed in ddffda5

docs
</Link>
.
</Typography>
<ThemeEditor />
</TabPanel>
</TabContext>
Expand Down