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

refactor: [DHIS2-17839] replace material ui Paper for Card #3747

Merged
merged 1 commit into from
Aug 8, 2024
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import { withStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import { Card } from '@dhis2/ui';
import i18n from '@dhis2/d2-i18n';
import { OfflineEventsList } from '../../../../EventsList/OfflineEventsList/OfflineEventsList.component';
import { listId } from './RecentlyAddedEventsList.const';
Expand Down Expand Up @@ -30,7 +30,7 @@ const NewEventsListPlain = (props: Props) => {
return null;
}
return (
<Paper className={classes.container}>
<Card className={classes.container}>
<div
className={classes.header}
>
Expand All @@ -43,7 +43,7 @@ const NewEventsListPlain = (props: Props) => {
emptyListText={i18n.t('No events added')}
{...passOnProps}
/>
</Paper>
</Card>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import i18n from '@dhis2/d2-i18n';
import Paper from '@material-ui/core/Paper';
import { Card } from '@dhis2/ui';
import withStyles from '@material-ui/core/styles/withStyles';
import { NewRelationship } from '../../../Pages/NewRelationship/NewRelationship.container';
import { DiscardDialog } from '../../../Dialogs/DiscardDialog.component';
Expand Down Expand Up @@ -110,15 +110,15 @@ class NewEventNewRelationshipWrapper extends React.Component<Props, State> {
{i18n.t('Go back to event without saving relationship')}
</LinkButton>
</div>
<Paper className={classes.newRelationshipPaper}>
<Card className={classes.newRelationshipPaper}>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<NewRelationship
header={i18n.t('New event relationship')}
onGetUnsavedAttributeValues={this.onGetUnsavedAttributeValues}
onCancel={onCancel}
{...passOnProps}
/>
</Paper>
</Card>
<DiscardDialog
header={i18n.t('Discard unsaved changes?')}
text={i18n.t('Leaving this page will discard the selections you made for a new relationship')}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @flow
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import { IconChevronDown16, IconChevronUp16, Button } from '@dhis2/ui';
import { Card, IconChevronDown16, IconChevronUp16, Button } from '@dhis2/ui';

import { Manager, Popper, Reference } from 'react-popper';
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
import Grow from '@material-ui/core/Grow';
import Paper from '@material-ui/core/Paper';
import MenuList from '@material-ui/core/MenuList';
import MenuItem from '@material-ui/core/MenuItem';
import i18n from '@dhis2/d2-i18n';
Expand Down Expand Up @@ -185,11 +184,11 @@ class FilterRestMenuPlain extends React.Component<Props, State> {
style={{ transformOrigin: '0 0 0' }}
timeout={{ exit: 0, enter: 200 }}
>
<Paper className={classes.menuPaper}>
<Card className={classes.menuPaper}>
<MenuList role="menu">
{this.renderMenuItems()}
</MenuList>
</Paper>
</Card>
</Grow>
</ClickAwayListener>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import React, { useCallback, memo, type ComponentType } from 'react';
import { IconButton } from 'capture-ui';
import { withStyles } from '@material-ui/core/styles';
import { Divider, IconMore24 } from '@dhis2/ui';
import { Paper, MenuList, MenuItem } from '@material-ui/core';
import { Divider, IconMore24, Card } from '@dhis2/ui';
import { MenuList, MenuItem } from '@material-ui/core';

import { MenuPopper } from '../../Popper/Popper.component';
import type { Props } from './listViewMenu.types';
Expand Down Expand Up @@ -86,11 +86,11 @@ const ListViewMenuPlain = ({ customMenuContents = [], classes }: Props) => {
.flat(1), [customMenuContents, classes]);

const renderPopperContent = useCallback((togglePopper: Function) => (
<Paper>
<Card>
<MenuList role="menu">
{renderMenuItems(togglePopper)}
</MenuList>
</Paper>
</Card>
), [renderMenuItems]);

if (!customMenuContents.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import * as React from 'react';
import { Manager, Popper, Reference } from 'react-popper';
import ClickAwayListener from '@material-ui/core/ClickAwayListener';
import { spacers, IconMore24, colors } from '@dhis2/ui';
import { Card, spacers, IconMore24, colors } from '@dhis2/ui';
import Grow from '@material-ui/core/Grow';
import Paper from '@material-ui/core/Paper';
import MenuList from '@material-ui/core/MenuList';
import MenuItem from '@material-ui/core/MenuItem';
import withStyles from '@material-ui/core/styles/withStyles';
Expand Down Expand Up @@ -144,9 +143,9 @@ class Index extends React.Component<Props, State> {
style={{ transformOrigin: '0 0 0' }}
timeout={{ exit: 0, enter: 200 }}
>
<Paper>
<Card>
{this.renderMenuItems()}
</Paper>
</Card>
</Grow>
</ClickAwayListener>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import i18n from '@dhis2/d2-i18n';
import Paper from '@material-ui/core/Paper';
import { Card } from '@dhis2/ui';
import withStyles from '@material-ui/core/styles/withStyles';
import { NewRelationship } from '../../NewRelationship/NewRelationship.container';
import { DiscardDialog } from '../../../Dialogs/DiscardDialog.component';
Expand Down Expand Up @@ -98,14 +98,14 @@ class ViewEventNewRelationshipWrapperPlain extends React.Component<Props, State>
{i18n.t('Go back to event without saving relationship')}
</LinkButton>
</div>
<Paper className={classes.newRelationshipPaper}>
<Card className={classes.newRelationshipPaper}>
{/* $FlowFixMe[cannot-spread-inexact] automated comment */}
<NewRelationship
header={i18n.t('New event relationship')}
onCancel={onCancel}
{...passOnProps}
/>
</Paper>
</Card>
<DiscardDialog
header={i18n.t('Discard unsaved changes?')}
text={i18n.t('Leaving this page will discard any selections you made for a new relationship')}
Expand Down
Loading