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

removed tss-react from cord-field - 3466480946 #1164

Open
wants to merge 238 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
968b45e
removed tss-react from LanguageListItemCard
andrewmurraydavid Sep 14, 2022
208a399
cleaned up first attempt remove tss-react
andrewmurraydavid Sep 14, 2022
7d9c3d6
updated BooleanProperty component
andrewmurraydavid Sep 15, 2022
4478415
updated Avatar component
andrewmurraydavid Sep 15, 2022
22ca260
updated Error component
andrewmurraydavid Sep 15, 2022
0aea4bb
updated a few more components
andrewmurraydavid Sep 15, 2022
071e9c5
addressed a few reviews
andrewmurraydavid Sep 15, 2022
9973356
a few edit and more components updated
andrewmurraydavid Sep 15, 2022
e8b2b43
tss-react removed from more 9 components
andrewmurraydavid Sep 15, 2022
4acc0d0
Replace List.containerSx with ContainerProps.sx. Add shortcut for ite…
CarsonF Sep 15, 2022
89ce0f3
tss-react removed from 6 more components
andrewmurraydavid Sep 16, 2022
7d33edd
removed tss-react from 2 more components
andrewmurraydavid Sep 23, 2022
8186364
fixed avatar component
andrewmurraydavid Sep 26, 2022
33a3a5a
removed tss-react from DialogForm
willdch Sep 26, 2022
73a0e65
removed tss-react from FileVersions.tsx
willdch Sep 26, 2022
8d2746f
removed tss-react from PropertyDiff.tsx
willdch Sep 27, 2022
f1d5ae0
removed tss-react from FileActionsMenu.tsx
willdch Sep 27, 2022
4c83d65
removed tss-react from FilePreview.tsx
willdch Sep 28, 2022
24ff9e8
Removed tss-react from PlainTextPreview.tsx
willdch Sep 28, 2022
5491399
removed tss-react from ErrorButton.tsx
willdch Sep 28, 2022
d0bf70e
removed tss-react form FieldOverviewCard.tsx
willdch Sep 29, 2022
50c5ad1
removed tss-react from EmailPreview.tsx
willdch Sep 29, 2022
ab3523c
removed tss-react from NativePreview.tsx
willdch Sep 29, 2022
b3e6bbb
removed tss-react from PreivewError.tsx
willdch Sep 29, 2022
bf1bf96
removed tss-react from PreviewLoading.tsx
willdch Sep 29, 2022
4416618
removed tss-react from WordPreview.tsx
willdch Sep 29, 2022
e17b0cf
removed tss-react from PreviewNotSupported.tsx
willdch Sep 29, 2022
55639c0
removed tss-react from SpreadsheetView.tsx
willdch Sep 29, 2022
cb7b016
updated syntax on sx property
willdch Sep 29, 2022
c1424b8
removed tss-react from FileVersionItem.tsx
willdch Sep 29, 2022
a988f01
removed tss-react from EnumField.tsx
willdch Sep 30, 2022
24d4382
removed tss-react from Dropzone.tsx
willdch Sep 30, 2022
90b24f0
removed tss-react from FundingAccountCard.tsx
willdch Sep 30, 2022
b3b53a9
removed tss-react from InternshipEngagementListItemCard.tsx
willdch Sep 30, 2022
a90232d
removed tss-react from LocationCard.tsx
willdch Sep 30, 2022
58f9e08
removed tss-react from MemberListSummary.tsx
willdch Sep 30, 2022
2fd936b
removed tss-react from MethodologiesCard.tsx
willdch Sep 30, 2022
5935000
removed tss-react from PartnershipCard.tsx
willdch Sep 30, 2022
b622748
removed tss-react from PartnershipPrimaryIcon.tsx
willdch Sep 30, 2022
b331e40
removed tss-react from OrganizationListItemCard.tsx
willdch Sep 30, 2022
7926ada
removed tss-react from PartnershipSummary.tsx
willdch Oct 1, 2022
77f5b42
removed tss-react from DropOverlay.tsx
willdch Oct 3, 2022
2251746
changed variable name to be more clear in SpreadSheetView.tsx and upd…
willdch Oct 4, 2022
3c02571
removed tss-react from PeriodicReportCard.tsx and updated HugeIcon.ts…
willdch Oct 4, 2022
41ae105
removed tss-react from PeriodicReportsList.tsx
willdch Oct 4, 2022
03aa1a3
removed tss-react from PostListItemCard.tsx
willdch Oct 4, 2022
82f14e7
removed tss-react from PostListItemMenu.tsx
willdch Oct 4, 2022
0aaa9d6
removed tss-react from ProductCard.tsx
willdch Oct 4, 2022
74a4936
removed tss-react from ProjectBreadcrumb.tsx and updated Breadcrumb.t…
willdch Oct 4, 2022
9359126
removed tss-react from ProjectChangeRequestListItem.tsx
willdch Oct 4, 2022
c141217
removed tss-react from ProjectListItemCard.tsx and updated CardActio…
willdch Oct 5, 2022
76805e3
removed tss-react from ProjectMemberCard.tsx
willdch Oct 5, 2022
b7ac349
removed tss-react from SortOption.tsx
willdch Oct 5, 2022
0591683
removed tss-react from UploadItems.tsx
willdch Oct 5, 2022
0b97396
removed tss-react from UploadItem.tsx
willdch Oct 5, 2022
87f4e9e
removed tss-react from LandscapeCard.tsx
willdch Oct 5, 2022
f218ac3
removed tss-react from PortraitCard.tsx
willdch Oct 5, 2022
d7400a4
removed tss-react from AuthContent.tsx
willdch Oct 5, 2022
c5b7579
removed tss-react from ChangePassword.tsx
willdch Oct 5, 2022
35d8111
removed tss-react from ForgotPasswordForm.tsx
willdch Oct 5, 2022
ed9c3bf
removed tss-react from ForgotPasswordSuccess.tsx
willdch Oct 5, 2022
3693a87
updated AuthContent.tsx to pass the 'sx' prop to children and removed…
willdch Oct 6, 2022
848cbd3
removed tss-react from LoginForm.tsx
willdch Oct 6, 2022
24c4411
removed tss-react from ResetPasswordForm.tsx
willdch Oct 6, 2022
056df66
removed tss-react from ResetPasswordSuccess.tsx
willdch Oct 6, 2022
05facbb
removed tss-react from EngagementDetailLoading.tsx
willdch Oct 6, 2022
d3a0b17
removed tss-react from CeremonyPlanned.tsx
willdch Oct 6, 2022
186d18c
added sx prop extention to pass to children CeremonyCard.tsx and remo…
willdch Oct 7, 2022
97ba4d2
removed tss-react from LanguageEngagementHeader.tsx EngagementWorkflo…
willdch Oct 7, 2022
44497a2
removed tss-react from InternshipEngagementDetail.tsx
willdch Oct 7, 2022
4d248f7
removed tss-react from MentorCard.tsx
willdch Oct 7, 2022
d48dd1a
removed tss-react from ProgressAndPlanning.tsx
willdch Oct 7, 2022
f1e8052
removed tss-react from LanguageDetail.tsx
willdch Oct 7, 2022
9f4065e
updated LocationCard.tsx and ProjectListItemCard.tsx to extend sx pr…
willdch Oct 7, 2022
21a1b00
removed tss-react from LanguageEngagementDetail.tsx
willdch Oct 7, 2022
c6dfda9
removed tss react from FirstScripture.tsx
willdch Oct 11, 2022
0238ec6
removed tss-react from ProjectOverview.tsx
willdch Oct 12, 2022
adb77a4
removed tss-react from ProjectList.tsx
willdch Oct 12, 2022
6dec400
removed tss-react from ProjectFilesList.tsx
willdch Oct 12, 2022
91c3c93
removed tss-react from UserActionsMenu.tsx
willdch Oct 12, 2022
201e7e4
removed tss-react from ProfileMenu.tsx
willdch Oct 12, 2022
0107520
fixed syntax mistake in sx prop for UserActionsMenu.tsx
willdch Oct 12, 2022
4938ae9
removed tss-react from HeaderSearch.tsx
willdch Oct 12, 2022
0cb0b45
removed tss-react from NodeDragPreview.tsx
willdch Oct 12, 2022
0cf0863
removed tss-react from ProjectChangeRequestList.tsx
willdch Oct 12, 2022
bca3e3f
updated ContentContainer.tsx to pass prop to child and removed tss-r…
willdch Oct 13, 2022
dc52b65
resolved conflicts after rebase with develop
willdch Oct 13, 2022
e70865c
removed tss-react from ProductForm.tsx
willdch Oct 13, 2022
5e1fd3f
removed tss react from DefaultAccordion.tsx MethodologySection.tsx Sc…
willdch Oct 13, 2022
ec1a000
removed const for style and put it in element
willdch Oct 13, 2022
4a20dd7
removed tss-react from FileRow.tsx
willdch Oct 14, 2022
925f80b
reamoved tss-react from DirectoryBreadcrumb.tsx
willdch Oct 14, 2022
7814d61
updated to include sx prop to conditional link element
willdch Oct 14, 2022
a82ba4e
removed tss-react from CompletionSection.tsx
willdch Oct 14, 2022
d7931c0
removed tss-react from ProductList.tsx
willdch Oct 14, 2022
758dad4
removed tss-react from EditProduct.tsx
willdch Oct 14, 2022
8a196eb
removed tss-react from StepProgress.tsx
willdch Oct 14, 2022
2272af2
removed tss-react from ProgressIcon.tsx
willdch Oct 14, 2022
b0ba28c
reamoved tss-react from ProductInfo.tsx
willdch Oct 14, 2022
1b10d32
removed tss-react from ProductDetailHeader.tsx
willdch Oct 14, 2022
8d0210f
removed tss-react from ProductDetail.tsx
willdch Oct 14, 2022
c3c9483
removed tss-react from PartnershipList.tsx
willdch Oct 14, 2022
1a2268e
removed tss-react from PartnerList.tsx
willdch Oct 14, 2022
fc6592e
removed tss-react from PartnerDetail.tsx
willdch Oct 14, 2022
f065bcb
removed tss-react from AddressCard.tsx updated to pass sx prop to chi…
willdch Oct 14, 2022
b2262c5
updated PartnerTypesCard.tsx to pass sx prop to children
willdch Oct 14, 2022
b163f93
removed tss-react from LocationDetail.tsx
willdch Oct 17, 2022
50aad7f
removed tss-react from LanguageForm.tsx
willdch Oct 17, 2022
9c054ec
removed tss-react from ProgressButton.tsx
willdch Oct 17, 2022
2c1525f
removed tss-react from DataButton.tsx
willdch Oct 17, 2022
679b5de
updated ChangesetIcon.tsx to pass sx prop to children
willdch Oct 17, 2022
bf1991a
removed tss-react from LanguageList.tsx
willdch Oct 17, 2022
b2b63de
removed tss-react from LargeDate.tsx
willdch Oct 18, 2022
f2c36c2
updated Grid conponent with container property to solve an error thro…
willdch Oct 18, 2022
457775d
finalized DataButton and Redacted
andrewmurraydavid Oct 18, 2022
84e01d5
updated NumberField component
andrewmurraydavid Oct 18, 2022
47bb45b
updated VerseField component
andrewmurraydavid Oct 18, 2022
527989f
updated DropzoneOverlay component
andrewmurraydavid Oct 18, 2022
4513292
updated SnackbarProvider component
andrewmurraydavid Oct 18, 2022
734df24
updated DefinedFileCard.tsx removed tss-react
willdch Oct 18, 2022
e6e2ff6
finalized DefinedFileCard & DropzoneOverlay
andrewmurraydavid Oct 18, 2022
f16c73c
removed maxStack prop from SnackbarProvider
andrewmurraydavid Oct 19, 2022
5a3c95e
updated Sensitivity component
andrewmurraydavid Oct 19, 2022
6a5bbc5
updated SensitivityIcon component
andrewmurraydavid Oct 19, 2022
a877fac
updated TogglePinButton component
andrewmurraydavid Oct 19, 2022
d2d28fc
updated ChangesetBadge component and some dependants
andrewmurraydavid Oct 19, 2022
57dca96
updated LandscapeCard.tsx to pass sx prop to children
willdch Oct 19, 2022
b97b10c
updated ChangesetBadge.tsx
willdch Oct 19, 2022
723177f
fixed SensitivityIcon parent sx overridding color
andrewmurraydavid Oct 20, 2022
fc5381a
updated to pass sx prop to children
willdch Oct 20, 2022
c5f6f9c
updated PartnershipCard.tsx to extend sx to children
willdch Oct 20, 2022
3737f0e
updated to provide sx prop to children
willdch Oct 20, 2022
9c61695
updated Product card to pass classNames to children
willdch Oct 20, 2022
948d41e
updated ChangesetBadge.tsx
willdch Oct 20, 2022
fcd4516
updated to use the component prop on box so we didn't have to add une…
willdch Oct 24, 2022
59801ef
updated component to extend sx from container
willdch Oct 25, 2022
27880a1
updated sx prop to include defualts and extend sx
willdch Oct 25, 2022
b2d1ea2
Revert "updated component to extend sx from container"
willdch Oct 25, 2022
bcc1b76
updated List.tsx to include defulats and exted sx
willdch Oct 25, 2022
b53568e
removed un-spread sx prop and let it be accessed from rest object int…
willdch Oct 25, 2022
d8e7dc1
Revert "reverted to old version per instruction from carson"
willdch Oct 25, 2022
6a5a78e
updated ChangesetBanner.tsx to exted StyleProps and updated the sx pr…
willdch Oct 25, 2022
632188b
created const for reused styling and updated sx prop styles to shorha…
willdch Oct 25, 2022
0308e73
updated Error.tsx style to include the page flag and shorthand styles
willdch Oct 25, 2022
b85166b
updated Avatar.tsx to remove theme from sx prop and instead used shor…
willdch Oct 25, 2022
22dec81
updated DefinedFileCard and removed theme use where it was not needed…
willdch Oct 25, 2022
c2318ab
updated ErrorButton styling to shorthand
willdch Oct 26, 2022
b04192d
removed explicit use of theme in sx prop and updated to shorthand str…
willdch Oct 26, 2022
4ff9323
updated sx prop to only use theme where needed
willdch Oct 26, 2022
0a84aaa
removed theme callback and updated sx prop styles
willdch Oct 26, 2022
beb515d
removed theme callback and update sx style syntax
willdch Oct 26, 2022
24ac388
removed theme callback and updated sx style syntax
willdch Oct 26, 2022
8642d1c
removed theme callback in sx prop and update style properties
willdch Oct 26, 2022
1fae1b5
removed theme callback and updated styles
willdch Oct 26, 2022
97f07e7
removed theme callbacks and updated sx styles syntax
willdch Oct 26, 2022
957168c
removed theme callbacks in sx props and updated styles
willdch Oct 27, 2022
1a43c9e
removed theme callbacks and updates syle syntax
willdch Oct 27, 2022
efb0679
removed theme callback and updated sx prop to be extended by rest
willdch Oct 27, 2022
527e54a
removed theme callback and updated styles
willdch Oct 27, 2022
1457d33
removed theme callbacks and updated styling syntax
willdch Oct 27, 2022
210182d
removed theme callback and updated sx style syntax
willdch Oct 27, 2022
8ac1cee
updated styles
willdch Oct 27, 2022
d5c4350
removed theme callback and updated styling syntax
willdch Oct 27, 2022
846df67
removed theme callbacks and updated style syntax
willdch Oct 27, 2022
c71cd02
removed theme callbacks and updated style syntax
willdch Oct 27, 2022
4f1dbb2
removed theme callbacks and updates style syntax
willdch Oct 27, 2022
078e33d
removed theme callback and updates Style syntax
willdch Oct 27, 2022
11e0f6c
removed theme callback and updates style syntax
willdch Oct 27, 2022
4d089bf
removed theme callbacks and updated style syntax
willdch Oct 27, 2022
caded12
removed theme callback and updates style syntax
willdch Oct 27, 2022
51a13ed
removed theme callback and updates styles
willdch Oct 27, 2022
dcaba39
removed theme callbacks and updates style syntax
willdch Oct 27, 2022
7b13c81
removed unnecessary theme callbacks and update style syntax
willdch Oct 27, 2022
e770be6
removed theme callbacks and created const for reused style
willdch Oct 27, 2022
c4c724a
removed theme callbacks and updated style syntax
willdch Oct 27, 2022
4489b1c
updated file after rebase merge conflicts in ProgressReportDetial.tsx
willdch Oct 28, 2022
211d110
removed theme callbacks and updated style syntax
willdch Oct 28, 2022
eed81bc
update to mui string shorthand and removed unnecesary theme callback
willdch Oct 28, 2022
02ba6c3
updated to use MUI string shorhand string syntax and removed unneces…
willdch Oct 28, 2022
f188a7e
src/components/Sort/SortOption.tsx
willdch Oct 28, 2022
f0ca1db
updated sx prop to use shorthand string syntax and removed unnecesary…
willdch Oct 28, 2022
d5d6320
removed unnecesary theme callbacks and update styles
willdch Oct 28, 2022
6758c94
moved theme callback to handle the whole prop instead of just the ind…
willdch Oct 31, 2022
3429eda
removed unnecesary theme callback
willdch Oct 31, 2022
78b4031
removed unnecesary theme callback and updated syntax
willdch Oct 31, 2022
cd02954
removed unnecesary theme callbacks and updated style syntax
willdch Oct 31, 2022
26931d3
removed unnecesary theme callback and updated styles
willdch Oct 31, 2022
0f6193d
removed unnecesary theme callbacks and updated style syntax
willdch Oct 31, 2022
0985976
removed unnecesary theme callbacks
willdch Oct 31, 2022
533791f
removed unnecesary theme callbacks and updated style syntax
willdch Oct 31, 2022
5411f57
removed unecesary theme callbacks and updates style syntax
willdch Oct 31, 2022
6157d7f
removed unnecesary theme callbacks and updated style syntax
willdch Oct 31, 2022
01533e9
removed unnecesary theme callbacks
willdch Oct 31, 2022
786e277
removed unnecesary theme callbacks
willdch Oct 31, 2022
becec9d
removed unnecesary theme callbacks
willdch Oct 31, 2022
cf3430e
removed unecesary theme callbacks
willdch Oct 31, 2022
69d7f1b
removed unnecessary theme callback
willdch Oct 31, 2022
dd7833a
removed unecessary theme callbacks
willdch Oct 31, 2022
80b35a9
removed unecessary theme callbacks
willdch Oct 31, 2022
415d597
removed unnecessary theme callbacks
willdch Oct 31, 2022
07aba57
removed unnecessary theme callbacks
willdch Oct 31, 2022
9f60651
removed unnecessary theme callbacks
willdch Oct 31, 2022
35058d7
removed unnecessary theme callbacks
willdch Oct 31, 2022
a58d774
removed unnecessary theme collbacks and updated style syntax
willdch Oct 31, 2022
e9d0181
removed unnecessary theme callbacks
willdch Oct 31, 2022
a560f2a
removed unnecessary theme callback
willdch Oct 31, 2022
e9688b4
removed unnecessary theme callbacks anupdated style syntax
willdch Oct 31, 2022
32717b8
removed unnecessary theme callback
willdch Oct 31, 2022
a99bb58
removed unnecessary theme callback
willdch Oct 31, 2022
2db624e
removed unnecessary theme callback
willdch Oct 31, 2022
1be0c43
removed unnecessary theme callback
willdch Oct 31, 2022
d7f593c
removed unnecessary theme callback
willdch Oct 31, 2022
d4ed069
removed unnecessary theme callback
willdch Oct 31, 2022
8af04ac
removed unnecessary theme callbacks
willdch Oct 31, 2022
bd3a523
removed unnecessary theme callback
willdch Oct 31, 2022
6c02aff
removed unnecessary theme callbacks
willdch Oct 31, 2022
5bd3ed4
removed unnecessary theme callback
willdch Oct 31, 2022
3ef0d30
removed unnecessary theme callback
willdch Oct 31, 2022
fddee5d
removed unnecessary theme callbacks and nupdated style syntax
willdch Oct 31, 2022
2ebafa3
removed unnecessary theme callbacks and nupdated style syntax
willdch Oct 31, 2022
6bef021
removed unnecessary theme callbacks and nupdated style syntax
willdch Oct 31, 2022
ccd4b0a
removed unnecessary theme callbacks and updated style synta for consi…
willdch Oct 31, 2022
08d1e08
removed unnecessary theme callbacks and updated style synta for consi…
willdch Oct 31, 2022
30507c6
removed unnecessary theme callbacks and updated style synta for consi…
willdch Oct 31, 2022
71498f4
removed unnecessary theme callbacks and updated style synta for consi…
willdch Oct 31, 2022
17c8e3a
removed unnecessary theme callbacks and updated style synta for consi…
willdch Oct 31, 2022
0f1341b
removed unnecessary theme callbacks and updated style synta for consi…
willdch Oct 31, 2022
697b8aa
removed unnecessary theme callbacks and updates style syntax
willdch Nov 1, 2022
ddd9643
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
0f92391
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
7ca304b
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
c656241
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
0453f80
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
dd302be
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
b52d4c5
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
20bdd61
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
17e2311
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
dda7ff7
removed unnecessary theme callbacks and updated style syntax
willdch Nov 1, 2022
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
38 changes: 20 additions & 18 deletions src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,37 @@ import {
AvatarProps as MuiAvatarProps,
Skeleton,
} from '@mui/material';
import { makeStyles } from 'tss-react/mui';
import { extendSx } from '~/common';

export interface AvatarProps extends MuiAvatarProps {
loading?: boolean;
}

const useStyles = makeStyles()(() => ({
loading: {
backgroundColor: 'transparent',
},
skeleton: {
width: '100%',
height: '100%',
},
}));

export const Avatar = ({ loading, ...props }: AvatarProps) => {
const { alt, src, srcSet, sizes, children, ...rest } = props;
const { classes } = useStyles();
const { alt, src, srcSet, sizes, children, sx, ...rest } = props;
return (
<MuiAvatar
{...(loading ? rest : props)}
classes={{
...props.classes,
colorDefault: loading ? classes.loading : props.classes?.colorDefault,
}}
sx={[
{
backgroundColor: 'transparent',
},
!loading && {
color: 'info.main',
bgcolor: 'grey.200',
},
...extendSx(sx),
]}
classes={props.classes}
>
{loading ? (
<Skeleton variant="rectangular" className={classes.skeleton} />
<Skeleton
variant="rectangular"
sx={{
width: '100%',
height: '100%',
}}
/>
) : (
children
)}
Expand Down
29 changes: 15 additions & 14 deletions src/components/BooleanProperty/BooleanProperty.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Chip, ChipProps, Skeleton } from '@mui/material';
import { ReactElement } from 'react';
import { makeStyles } from 'tss-react/mui';
import { Except, SetRequired } from 'type-fest';
import { SecuredProp } from '~/common';
import { extendSx, SecuredProp } from '~/common';
import { Redacted } from '../Redacted';

export interface BooleanPropertyProps extends SetRequired<ChipProps, 'label'> {
Expand All @@ -11,24 +10,26 @@ export interface BooleanPropertyProps extends SetRequired<ChipProps, 'label'> {
wrap?: (node: ReactElement) => ReactElement;
}

const useStyles = makeStyles()(({ palette, shape }) => ({
root: {
background: palette.info.main,
color: palette.info.contrastText,
borderRadius: shape.borderRadius,
height: 26,
},
}));

export const BooleanProperty = ({
redacted,
data,
wrap,
...rest
}: BooleanPropertyProps) => {
const { classes } = useStyles();

const chip = <Chip {...rest} className={classes.root} />;
const chip = (
<Chip
{...rest}
sx={[
{
background: 'info.main',
color: 'info.contrastText',
borderRadius: 1,
height: 26,
},
...extendSx(rest.sx),
]}
/>
);

const out = !data ? (
<Skeleton>{chip}</Skeleton>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { To } from 'history';
import { isString } from 'lodash';
import { forwardRef, ReactNode } from 'react';
import { useMatch } from 'react-router-dom';
import { StyleProps } from '~/common';
import { Link, LinkProps } from '../Routing';

export interface BreadcrumbProps {
export interface BreadcrumbProps extends StyleProps {
to?: To;
LinkProps?: Partial<LinkProps>;
children?: ReactNode;
Expand Down
154 changes: 78 additions & 76 deletions src/components/Changeset/ChangesetBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,19 @@
import { Badge, Grid, TooltipProps, Typography } from '@mui/material';
import { Badge, Grid, Theme, TooltipProps, Typography } from '@mui/material';
Copy link
Member

Choose a reason for hiding this comment

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

The styling changes in this file are overly complicated and doing incorrect things. I'll expand/help later.

import { startCase } from 'lodash';
import { cloneElement, isValidElement, ReactElement, ReactNode } from 'react';
import { makeStyles } from 'tss-react/mui';
import { mapFromList, UseStyles } from '~/common';
import { mapFromList, StyleProps } from '~/common';
import { BadgeWithTooltip } from '../BadgeWithTooltip';
import { PaperTooltip } from '../PaperTooltip';
import { DiffMode } from './ChangesetDiffContext';
import { ChangesetIcon } from './ChangesetIcon';
import { modeToPalette } from './theme';

const useStyles = makeStyles<
ChangesetBadgeOwnProps,
'added' | 'changed' | 'removed' | 'outline'
>()(({ palette }, _params, classes) => ({
root: {
display: 'flex',
},
badge: {
padding: 0,
cursor: 'help',
...mapFromList(['added', 'changed', 'removed'] as const, (mode) => {
const paletteKey = modeToPalette[mode];
const css = {
color: palette[paletteKey].contrastText,
background: palette[paletteKey].main,
};
return [`&.${classes[mode]}`, css];
}),
},
icon: {
fontSize: 12,
},
children: {
[`&.${classes.added}.${classes.outline}`]: {
border: `2px solid ${palette[modeToPalette.added].main}`,
},
[`&.${classes.changed}.${classes.outline}`]: {
border: `2px solid ${palette[modeToPalette.changed].main}`,
},
[`&.${classes.removed}`]: {
[`&.${classes.outline}`]: {
border: `2px solid ${palette[modeToPalette.removed].main}`,
},
boxShadow: 'none',
backgroundColor: 'inherit',
'& > *': {
filter: 'grayscale(1)',
},
},
},
added: {},
changed: {},
removed: {},
outline: {},
}));
const classes = {
added: 'changeset-badge-added',
changed: 'changeset-badge-changed',
removed: 'changeset-badge-removed',
outline: 'changeset-badge-outline',
};

interface ChangesetBadgeOwnProps {
children: ReactNode;
Expand All @@ -63,16 +23,26 @@ interface ChangesetBadgeOwnProps {
TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
}

const generatedModeStyles = (theme: Theme) => ({
...mapFromList(['added', 'changed', 'removed'] as const, (mode) => {
const paletteKey = modeToPalette[mode];
const css = {
color: theme.palette[paletteKey].contrastText,
background: theme.palette[paletteKey].main,
padding: 0,
cursor: 'help',
};
return [`& .${classes[mode]} ~ .MuiBadge-badge`, css];
}),
});

export interface ChangesetBadgeProps
extends ChangesetBadgeOwnProps,
UseStyles<typeof useStyles> {}
StyleProps {}

export const ChangesetBadge = (props: ChangesetBadgeProps) => {
const { mode, disableOutline, children, moreInfo, TooltipProps } = props;
const outline = !disableOutline;
const { classes, cx } = useStyles(props, {
props: { classes: props.classes },
});

if (!mode) {
return <>{children}</>;
Expand All @@ -98,35 +68,67 @@ export const ChangesetBadge = (props: ChangesetBadgeProps) => {
{content}
</PaperTooltip>
)}
badgeContent={
<ChangesetIcon mode={mode} color="inherit" className={classes.icon} />
}
badgeContent={<ChangesetIcon mode={mode} sx={{ fontSize: 12 }} />}
classes={{
root: classes.root,
badge: cx({
[classes.badge]: true,
[classes.added]: mode === 'added',
[classes.changed]: mode === 'changed',
[classes.removed]: mode === 'removed',
[classes.outline]: outline,
}),
[classes.added]: mode === 'added',
[classes.changed]: mode === 'changed',
[classes.removed]: mode === 'removed',
[classes.outline]: outline,
}}
sx={[
{
'&.MuiBadge-root': {
display: 'flex',
},
'& .MuiPaper-root': {
width: 1,
},
},
generatedModeStyles,
]}
>
{isValidElement(children)
? cloneElement(children, {
...children.props,
className: cx(
{
[classes.children]: true,
[classes.added]: mode === 'added',
[classes.changed]: mode === 'changed',
[classes.removed]: mode === 'removed',
[classes.outline]: outline,
},
children.props?.className
),
})
? customeCloneElement(children, mode, outline)
: children}
</Badge>
);
};

const customeCloneElement = (
children: ReactElement,
mode: string,
outline: boolean
) => {
const cloned = cloneElement(children, {
...children.props,
className:
`${children.props?.className ? children.props?.className : ''} ` +
`${mode === 'added' ? classes.added : ''} ` +
`${mode === 'changed' ? classes.changed : ''} ` +
`${mode === 'removed' ? classes.removed : ''} ` +
`${outline ? classes.outline : ''}`,

sx: [
(theme: Theme) => ({
[`&.${classes.added}.${classes.outline}`]: {
border: `2px solid ${theme.palette[modeToPalette.added].main}`,
},
[`&.${classes.changed}.${classes.outline}`]: {
border: `2px solid ${theme.palette[modeToPalette.changed].main}`,
},
[`&.${classes.removed}`]: {
[`&.${classes.outline}`]: {
border: `2px solid ${theme.palette[modeToPalette.removed].main}`,
},
boxShadow: 'none',
backgroundColor: 'inherit',
'& > *': {
filter: 'grayscale(1)',
},
},
}),
],
});

return cloned;
};
15 changes: 3 additions & 12 deletions src/components/Changeset/ChangesetBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,24 @@ import {
Edit as EditIcon,
} from '@mui/icons-material';
import { Alert, AlertTitle, Tooltip } from '@mui/material';
import { makeStyles } from 'tss-react/mui';
import { extendSx, StyleProps } from '~/common';
import { IconButton } from '../IconButton';

const useStyles = makeStyles()(({ spacing, breakpoints }) => ({
root: {
maxWidth: breakpoints.values.md,
margin: spacing(0, 2),
},
}));

interface Props {
interface Props extends StyleProps {
changesetId: string | null;
onEdit?: () => void;
onClose?: () => void;
}

export const ChangesetBanner = (props: Props) => {
const { classes } = useStyles();

if (!props.changesetId) {
return null;
}
return (
<Alert
severity="info"
icon={<ChangeIcon fontSize="inherit" />}
className={classes.root}
sx={[{ maxWidth: 'md', mx: 2 }, ...extendSx(props.sx)]}
action={
<>
{props.onEdit && (
Expand Down
Loading