Skip to content

Commit 3487a0e

Browse files
committed
Use styled for tab bar
1 parent 0f725b7 commit 3487a0e

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

src/components/Contacts/ContactDetails/ContactDetails.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, styled, Tab, Tabs, withStyles } from '@material-ui/core';
1+
import { Box, styled, Tab, Tabs } from '@material-ui/core';
22
import React from 'react';
33
import { useTranslation } from 'react-i18next';
44
import theme from '../../../theme';
@@ -10,11 +10,6 @@ interface Props {
1010
onClose: () => void;
1111
}
1212

13-
interface ContactTabsProps {
14-
value: number;
15-
onChange: (event: React.ChangeEvent, newIndex: number) => void;
16-
}
17-
1813
const ContactDetailsWrapper = styled(Box)(({}) => ({
1914
width: '100%',
2015
}));
@@ -26,11 +21,9 @@ const ContactTabsWrapper = styled(Box)(({}) => ({
2621
borderBottom: '1px solid #DCDCDC',
2722
}));
2823

29-
const ContactTabs = withStyles({
30-
root: {
31-
width: '100%',
32-
minHeight: 40,
33-
},
24+
const ContactTabs = styled(Tabs)(({}) => ({
25+
width: '100%',
26+
minHeight: 40,
3427
indicator: {
3528
display: 'flex',
3629
'& > span': {
@@ -39,9 +32,7 @@ const ContactTabs = withStyles({
3932
backgroundColor: '#FFCF07',
4033
},
4134
},
42-
})((props: ContactTabsProps) => (
43-
<Tabs {...props} TabIndicatorProps={{ children: <span /> }} />
44-
));
35+
}));
4536

4637
const ContactTab = styled(Tab)(({}) => ({
4738
textTransform: 'none',
@@ -72,7 +63,11 @@ export const ContactDetails: React.FC<Props> = ({
7263
contactId={contactId}
7364
/>
7465
<ContactTabsWrapper>
75-
<ContactTabs value={selectedTabIndex} onChange={handleChange}>
66+
<ContactTabs
67+
value={selectedTabIndex}
68+
onChange={handleChange}
69+
TabIndicatorProps={{ children: <span /> }}
70+
>
7671
<ContactTab label={t('Tasks')} />
7772
<ContactTab label={t('Donations')} />
7873
<ContactTab label={t('Referrals')} />

0 commit comments

Comments
 (0)