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

[website] Fix code button with installation command #30622

Merged
merged 3 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/public/static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions docs/src/components/home/GetStartedButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ROUTES from 'docs/src/route';
import Link from 'docs/src/modules/components/Link';

export default function GetStartedButtons({
installation = 'npm install @mui/material',
installation = 'npm install @mui/material @emotion/react @emotion/styled',
to = ROUTES.documentation,
...props
}: { installation?: string; to?: string } & BoxProps) {
Expand Down Expand Up @@ -37,17 +37,26 @@ export default function GetStartedButtons({
size="large"
variant="contained"
endIcon={<KeyboardArrowRightRounded />}
sx={{ mr: { xs: 0, md: 2 }, mb: { xs: 2, md: 0 } }}
>
Get started
</Button>
<Box sx={{ width: 16, height: 16 }} />
<Button
size="large"
// @ts-expect-error
variant="code"
startIcon="$"
endIcon={copied ? <CheckRounded color="primary" /> : <ContentCopyRounded />}
onClick={handleCopy}
sx={{
maxWidth: '324px',
display: 'inline-block',
justifyContent: 'start',
overflowX: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
position: 'relative',
pr: 5,
}}
>
{installation}
</Button>
Expand Down
4 changes: 4 additions & 0 deletions docs/src/modules/brandingTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ export function getThemedComponents(theme: Theme) {
color: theme.palette.grey[400],
},
'& .MuiButton-endIcon': {
display: 'inline-block',
position: 'absolute',
right: 0,
marginRight: 10,
color:
theme.palette.mode === 'dark' ? theme.palette.grey[400] : theme.palette.grey[700],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ROUTES = {
components: '/getting-started/supported-components/',
customization: '/customization/how-to-customize/',
theming: '/customization/theming/',
documentation: '/getting-started/usage/',
documentation: '/getting-started/installation/',
communityHelp: '/getting-started/support/#community-help-free',
blog: 'https://medium.com/material-ui',
showcase: '/discover-more/showcase',
Expand Down