Skip to content

Commit

Permalink
Rename BadgeTab and correct behaviour between selected and unselected…
Browse files Browse the repository at this point in the history
… tab
  • Loading branch information
louilinn committed Feb 22, 2023
1 parent 927d050 commit 93c15c0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 25 deletions.
18 changes: 5 additions & 13 deletions src/components/ActivityStreamWithTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { generatePath, useHistory } from 'react-router-dom';
import { ACTIVITIES_PATH } from '~/routes';

import ActivityStream from '~/components/ActivityStream';
import BadgeCircle from '~/components/BadgeCircle';
import BadgeTab from '~/components/BadgeTab';
import TabNavigation from '~/components/TabNavigation';
import TabNavigationAction from '~/components/TabNavigationAction';
import core from '~/services/core';
Expand Down Expand Up @@ -117,12 +117,8 @@ const ActivityStreamWithTabs = ({ basePath = ACTIVITIES_PATH }) => {
<TabNavigation value={selectedCategory} onChange={handleFilterSelection}>
<TabNavigationAction
icon={
<BadgeCircle
badgeContent={
selectedCategory != QUERY_FILTER_MAP.transfers
? newActivities[QUERY_FILTER_MAP.transfers]
: null
}
<BadgeTab
badgeContent={newActivities[QUERY_FILTER_MAP.transfers]}
icon={IconTransactions}
isActive
/>
Expand All @@ -132,12 +128,8 @@ const ActivityStreamWithTabs = ({ basePath = ACTIVITIES_PATH }) => {
/>
<TabNavigationAction
icon={
<BadgeCircle
badgeContent={
selectedCategory != QUERY_FILTER_MAP.connections
? newActivities[QUERY_FILTER_MAP.connections]
: null
}
<BadgeTab
badgeContent={newActivities[QUERY_FILTER_MAP.connections]}
icon={IconConnections}
isActive
/>
Expand Down
6 changes: 3 additions & 3 deletions src/components/BadgeCircle.js → src/components/BadgeTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const useStyles = makeStyles((theme) => ({
},
}));

const BadgeCircle = ({
const BadgeTab = ({
badgeContent,
icon,
color = 'primary',
Expand Down Expand Up @@ -45,12 +45,12 @@ const BadgeCircle = ({
);
};

BadgeCircle.propTypes = {
BadgeTab.propTypes = {
badgeContent: PropTypes.number,
color: PropTypes.string,
icon: PropTypes.any,
isActive: PropTypes.bool,
overlap: PropTypes.string,
};

export default BadgeCircle;
export default BadgeTab;
8 changes: 4 additions & 4 deletions src/components/Finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { generatePath, useHistory } from 'react-router-dom';
import { SEARCH_PATH } from '~/routes';

import TourWebOfTrustSVG from '%/images/web-of-trust.svg';
import BadgeCircle from '~/components/BadgeCircle';
import BadgeTab from '~/components/BadgeTab';
import Button from '~/components/Button';
import Input from '~/components/Input';
import ProfileMini from '~/components/ProfileMini';
Expand Down Expand Up @@ -355,7 +355,7 @@ const FinderFilter = ({ filterResults, selectedFilter, onChange }) => {
>
<TabNavigationAction
icon={
<BadgeCircle
<BadgeTab
badgeContent={filterResults[FILTER_DIRECT].length}
icon={IconTrustedDirectly}
isActive={selectedFilter === FILTER_DIRECT}
Expand All @@ -366,7 +366,7 @@ const FinderFilter = ({ filterResults, selectedFilter, onChange }) => {
/>
<TabNavigationAction
icon={
<BadgeCircle
<BadgeTab
badgeContent={filterResults[FILTER_INDIRECT].length}
icon={IconFollow}
isActive={selectedFilter === FILTER_INDIRECT}
Expand All @@ -377,7 +377,7 @@ const FinderFilter = ({ filterResults, selectedFilter, onChange }) => {
/>
<TabNavigationAction
icon={
<BadgeCircle
<BadgeTab
badgeContent={filterResults[FILTER_EXTERNAL].length}
icon={IconWorld}
isActive={selectedFilter === FILTER_EXTERNAL}
Expand Down
3 changes: 0 additions & 3 deletions src/components/TabNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ const useStyles = makeStyles((theme) => ({
backgroundColor: theme.custom.colors.fountainBlue,
height: '1px',
},
'& .MuiTab-textColorInherit': {
opacity: '1',
},
},
}));

Expand Down
4 changes: 2 additions & 2 deletions src/views/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Redirect, generatePath, useParams } from 'react-router-dom';
import { DASHBOARD_PATH, PROFILE_PATH } from '~/routes';

import Avatar from '~/components/Avatar';
import BadgeCircle from '~/components/BadgeCircle';
import BadgeTab from '~/components/BadgeTab';
import Button from '~/components/Button';
import ButtonBack from '~/components/ButtonBack';
import ButtonSend from '~/components/ButtonSend';
Expand Down Expand Up @@ -230,7 +230,7 @@ const ProfileContent = ({ address, deploymentStatus, trustStatus }) => {
/>
<TabNavigationAction
icon={
<BadgeCircle
<BadgeTab
badgeContent={mutualyTrusted}
icon={IconTrustMutual}
isActive={selectedPanel === PANEL_TRUST}
Expand Down

0 comments on commit 93c15c0

Please sign in to comment.