Skip to content

Commit

Permalink
chore: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hdJerry committed Aug 11, 2023
1 parent 3cb49d4 commit 5ab5734
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import colors from '../../constants/colors';
import styled from 'styled-components';


export const DropdownContainer = styled.div`
display: flex;
position: relative;
Expand Down Expand Up @@ -65,8 +64,8 @@ export const DropDownMenu = styled.div`
width: 14rem;
transform-origin: top right;
border-radius: 0.375rem;
background-color: #FFF;
box-shadow: 0px 0px 10px 1px #CCC;
background-color: #fff;
box-shadow: 0px 0px 10px 1px #ccc;
top: 2rem;
`;

Expand Down Expand Up @@ -106,15 +105,14 @@ export const MenuItemContentColor = styled.span`
border-radius: 0.5rem;
flex-shrink: 0;
border: 1px solid ${colors.gray300};
`;

export const CloseWrapper = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.875rem;
line-height: 1.25rem;
line-height: 1.25rem;
padding: 0.25rem 0.75rem;
`;

Expand All @@ -132,4 +130,3 @@ export const CloseText = styled.strong`
font-size: 0.75rem;
line-height: 1rem;
`;

12 changes: 6 additions & 6 deletions cra-rxjs-styled-components/src/components/repo-filter/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ export const defaultLanguage = 'All';
export const defaultSortBy = 'Last updated';

export const FILTER_TYPE_OPTIONS = {
default: defaultFilterType,
forks: 'Forks',
archived: 'Archived',
default: defaultFilterType,
forks: 'Forks',
archived: 'Archived',
};
export const SORT_OPTIONS = {
default: defaultSortBy,
name: 'Name',
stars: 'Stars',
default: defaultSortBy,
name: 'Name',
stars: 'Stars',
};
33 changes: 17 additions & 16 deletions cra-rxjs-styled-components/src/components/tab-nav/TabNav.styles.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import styled from 'styled-components';

export const Container = styled.div`
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: var(--gray-200);
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: var(--gray-200);
`;

export const TabContainer = styled.div`
flex-direction: row;
margin-bottom: -2px;
flex-direction: row;
margin-bottom: -2px;
justify-content: space-between;
flex-grow: 1;
@media (min-width: 768px){
@media (min-width: 768px) {
flex-grow: 0;
}
`;
Expand All @@ -22,14 +22,15 @@ export const Tab = styled.button<{ isActive: boolean }>`
border: none;
background-color: transparent;
cursor: pointer;
gap: 4px;
padding: 6px;
margin-right: 4px;
flex-direction: row;
align-items: center;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: ${({ isActive }) => (isActive ? 'orange' : 'transparent')};
gap: 4px;
padding: 6px;
margin-right: 4px;
flex-direction: row;
align-items: center;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: ${({ isActive }) =>
isActive ? 'orange' : 'transparent'};
`;
export const CountView = styled.div`
background-color: var(--gray-200);
Expand All @@ -44,6 +45,6 @@ export const CountText = styled.span`
`;

export const TabText = styled.span<{ isActive: boolean }>`
font-weight: ${({ isActive }) => (isActive ? '600' : '500')};
margin-left: 3px;
font-weight: ${({ isActive }) => (isActive ? '600' : '500')};
margin-left: 3px;
`;
68 changes: 34 additions & 34 deletions cra-rxjs-styled-components/src/components/tab-nav/TabNav.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import { SVGProps } from 'react';
import {
Container,
TabContainer,
Tab,
TabText,
CountText,
CountView,
Container,
TabContainer,
Tab,
TabText,
CountText,
CountView,
} from './TabNav.styles';
import colors from '../../constants/colors';

interface TabNavigationProps {
tabs: {
title: string;
Icon: (props: SVGProps<any>) => JSX.Element;
count?: number;
}[];
activeTab: string;
onChange?: (title: string) => void;
tabs: {
title: string;
Icon: (props: SVGProps<any>) => JSX.Element;
count?: number;
}[];
activeTab: string;
onChange?: (title: string) => void;
}

const TabNavigation = ({ tabs, activeTab, onChange }: TabNavigationProps) => {

return (
<Container>
<TabContainer>
{tabs.map(({ title, Icon, count }, index) => (
<Tab
key={index}
isActive={activeTab === title}
onClick={() => onChange?.(title)}>
<Icon color={activeTab === title ? colors.gray700 : colors.gray500} />
<TabText isActive={activeTab === title}>{title}</TabText>
{typeof count === 'number' && count > 0 && (
<CountView>
<CountText>{count}</CountText>
</CountView>
)}
</Tab>
))}
</TabContainer>
</Container>
);
return (
<Container>
<TabContainer>
{tabs.map(({ title, Icon, count }, index) => (
<Tab
key={index}
isActive={activeTab === title}
onClick={() => onChange?.(title)}
>
<Icon color={activeTab === title ? colors.gray700 : colors.gray500} />
<TabText isActive={activeTab === title}>{title}</TabText>
{typeof count === 'number' && count > 0 && (
<CountView>
<CountText>{count}</CountText>
</CountView>
)}
</Tab>
))}
</TabContainer>
</Container>
);
};

export default TabNavigation;

0 comments on commit 5ab5734

Please sign in to comment.