Skip to content

Commit

Permalink
fix: update typings for sc components
Browse files Browse the repository at this point in the history
  • Loading branch information
tcK1 committed Jan 23, 2024
1 parent fb967a9 commit 3770306
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Active = css`
`}
`;

const StyledItem = styled.li`
const StyledItem = styled.li<{ isActive: boolean; children: React.ReactNode }>`
${({
isActive,
theme: {
Expand Down
13 changes: 10 additions & 3 deletions packages/yoga/src/NavigationMenu/web/Item/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import Box from '../../../Box';
import Tag from '../../../Tag';
import Text from '../../../Text';

export const StyledTextContainer = styled(Box)`
export const StyledTextContainer = styled(Box)<{
isSubItem?: boolean;
children: React.ReactNode;
}>`
${({
isSubItem,
theme: {
Expand Down Expand Up @@ -60,7 +63,7 @@ export const StyledText = styled(Text)`
`}
`;

const Active = css`
const Active = css<{ isResponsive?: boolean }>`
${({
isResponsive,
theme: {
Expand Down Expand Up @@ -103,7 +106,11 @@ const Active = css`
`}
`;

export const StyledItem = styled.li`
export const StyledItem = styled.li<{
isActive: boolean;
isResponsive?: boolean;
children: React.ReactNode;
}>`
${({
isActive,
theme: {
Expand Down
8 changes: 6 additions & 2 deletions packages/yoga/src/NavigationMenu/web/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { Text } from '@gympass/yoga';
import Box from '../../../Box';
import Icon from '../../../Icon';

const StyledMenu = styled(Box)`
const StyledMenu = styled(Box)<{
hasAction: boolean;
children: React.ReactNode;
onClick?: (() => void) | undefined;
}>`
${({
hasAction,
theme: {
Expand Down Expand Up @@ -84,7 +88,7 @@ const Menu = ({ avatar: Avatar, subtitle, title, onClick }: MenuProps) => {
{Avatar}

<StyledTextContainer>
{title && <StyledText>{title}</StyledText>}
{title && <StyledText>{title}</StyledText>}

{subtitle && <Text.Small color="deep">{subtitle}</Text.Small>}
</StyledTextContainer>
Expand Down
6 changes: 5 additions & 1 deletion packages/yoga/src/NavigationMenu/web/NavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { Item, Subitem } from './Item';
import { BottomItems, BottomItem } from './BottomItems';
import Box from '../../Box';

const StyledNavigationMenu = styled(Box)`
const StyledNavigationMenu = styled(Box)<{
isOpenOnMobile: boolean;
isResponsive: boolean;
children: React.ReactNode;
}>`
${({
isOpenOnMobile,
isResponsive,
Expand Down
2 changes: 1 addition & 1 deletion packages/yoga/src/NavigationMenu/web/Switcher/Switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Text, Skeleton } from '@gympass/yoga';
import Actions from './Actions';
import Box from '../../../Box';

const StyledSwitcher = styled(Box)`
const StyledSwitcher = styled(Box)<{ fill: string; children: React.ReactNode }>`
${({
fill,
theme: {
Expand Down

0 comments on commit 3770306

Please sign in to comment.