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

🐞 fix: update styled-components typings #728

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: update typings for sc components
  • Loading branch information
tcK1 committed Jan 23, 2024
commit 377030639b5821afcd26c1ffd4d75bc69691fcb5
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ const Active = css`
`}
`;

const StyledItem = styled.li`
const StyledItem = styled.li<{ isActive: boolean; children: React.ReactNode }>`
${({
isActive,
theme: {
13 changes: 10 additions & 3 deletions packages/yoga/src/NavigationMenu/web/Item/styles.ts
Original file line number Diff line number Diff line change
@@ -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: {
@@ -60,7 +63,7 @@ export const StyledText = styled(Text)`
`}
`;

const Active = css`
const Active = css<{ isResponsive?: boolean }>`
${({
isResponsive,
theme: {
@@ -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: {
8 changes: 6 additions & 2 deletions packages/yoga/src/NavigationMenu/web/Menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -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: {
@@ -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>
6 changes: 5 additions & 1 deletion packages/yoga/src/NavigationMenu/web/NavigationMenu.tsx
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion packages/yoga/src/NavigationMenu/web/Switcher/Switcher.tsx
Original file line number Diff line number Diff line change
@@ -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: {