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

feat(ui): Update the SiteAppBar to mui. #487

Merged
merged 3 commits into from
Apr 23, 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 .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- name: Run the CI script in yarn to check code style and unit tests.
run: yarn ci
- name: Check that no files were changed
run: "[ -z $(git status --porcelain) ]"
run: "git status; [ -z $(git status --porcelain) ]"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ packageExtensions:
"@opentelemetry/semantic-conventions": "*"
"@mui/system@*":
dependencies:
styled-components: '*'
react-dom: '*'
react-is: '*'
"@mui/x-date-pickers@*":
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ functionality of the site is easier to discover.
- Cube List navbar
- Markdown
- Autocard
- Site App Bar
- Allow controlling dark mode without refreshing.
- Redesigns of both light and dark mode color schemes.

Expand Down
6 changes: 0 additions & 6 deletions client/babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ module.exports = (api) => {
'@babel/preset-react',
],
plugins: [
[
'babel-plugin-styled-components',
{
pure: true,
},
],
!isTest && [
'babel-plugin-direct-import',
{
Expand Down
8 changes: 7 additions & 1 deletion client/components/AutocardListGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ const AutocardListGroup = ({ cards, heading, sort, orderedSort, showOther, rowTa
<ListSubheader
className={`list-group-heading${canGroupModal ? ' clickable' : ''}`}
onClick={canGroupModal ? handleClick : undefined}
sx={{ backgroundColor: 'background.darker', paddingLeft: 0.5, paddingRight: 0, paddingY: 1 }}
sx={{
backgroundColor: 'background.darker',
paddingLeft: 0.5,
paddingRight: 0,
paddingY: 1,
borderRadius: '4px 4px 0px 0px',
}}
disableSticky={!useSticky}
>
<Typography variant="subtitle2">{heading}</Typography>
Expand Down
50 changes: 32 additions & 18 deletions client/components/CubeNavbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react';
import { Box, Link, Toolbar, Typography } from '@mui/material';
import { Box, Button, Link, Toolbar, Typography } from '@mui/material';
import PropTypes from 'prop-types';

import CubeContext from '@cubeartisan/client/components/contexts/CubeContext.js';
Expand All @@ -9,23 +9,27 @@ const CubeNavItem = ({ link, activeLink, children }) => {
const { cube } = useContext(CubeContext);
if (link === activeLink) {
return (
<Typography
variant="subtitle1"
sx={{ backgroundColor: 'background.paper', height: '100%', padding: 2, lineHeight: 1.5 }}
>
{children}
</Typography>
<Button variant="text" sx={{ borderRadius: 8 }}>
<Typography
variant="subtitle1"
sx={{ backgroundColor: 'background.paper', height: '100%', padding: 2, lineHeight: 1.5, borderRadius: 2 }}
>
{children}
</Typography>
</Button>
);
}
return (
<Link
variant="subtitle1"
href={`/cube/${encodeURIComponent(getCubeId(cube))}/${link}`}
color="primary"
sx={{ height: '100%', padding: 2, lineHeight: 1.5 }}
>
{children}
</Link>
<Button>
<Link
variant="subtitle1"
href={`/cube/${encodeURIComponent(getCubeId(cube))}/${link}`}
color="primary"
sx={{ height: '100%', padding: 2, lineHeight: 1.5 }}
>
{children}
</Link>
</Button>
);
};
CubeNavItem.propTypes = {
Expand All @@ -41,12 +45,22 @@ const CubeNavbar = ({ activeLink }) => {
const { cube } = useContext(CubeContext);
const subtitle = getCubeDescription(cube);
return (
<Toolbar sx={{ width: '100%', backgroundColor: 'background.darker', alignItems: 'end' }}>
<Box>
<Toolbar sx={{ width: '100%', backgroundColor: 'background.darker', alignItems: 'end', display: 'flex' }}>
<Box component="span" sx={{ marginRight: 'auto' }}>
<Typography variant="h5">{cube.name}</Typography>
{cube.type && <Typography variant="subtitle1"> ({subtitle})</Typography>}
</Box>
<Box sx={{ marginLeft: 'auto', flexFlow: 'row', flexWrap: 'wrap', height: '100%', display: 'flex' }}>
<Box
component="span"
sx={{
marginLeft: 'auto',
flexFlow: 'row',
flexWrap: 'wrap',
height: '100%',
display: 'flex',
alignItems: 'center',
}}
>
<CubeNavItem link="overview" activeLink={activeLink}>
Overview
</CubeNavItem>
Expand Down
Loading