Skip to content

Commit

Permalink
chore: remove props only used in classic from schema (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcshzj authored Jul 23, 2024
1 parent 5ad65ab commit e000312
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/interfaces/complex/InfoCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export const SingleCardSchema = Type.Object({
export const InfoCardsSchema = Type.Object(
{
type: Type.Literal("infocards", { default: "infocards" }),
// TODO: Remove this property, only used in classic theme
sectionIdx: Type.Optional(Type.Number()),
variant: Type.Union([Type.Literal("side"), Type.Literal("top")], {
title: "Infocards variant",
description: "The variant of the infocards component to use",
Expand Down Expand Up @@ -66,4 +64,6 @@ export const InfoCardsSchema = Type.Object(
)

export type SingleCardProps = Static<typeof SingleCardSchema>
export type InfoCardsProps = Static<typeof InfoCardsSchema>
export type InfoCardsProps = Static<typeof InfoCardsSchema> & {
sectionIdx?: number // TODO: Remove this property, only used in classic theme
}
3 changes: 1 addition & 2 deletions packages/components/src/interfaces/complex/InfoCols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export const InfoBoxSchema = Type.Object({
export const InfoColsSchema = Type.Object(
{
type: Type.Literal("infocols", { default: "infocols" }),
// TODO: Remove this property, only used in classic theme
sectionIdx: Type.Optional(Type.Number()),
title: Type.String({
title: "Infocols title",
description: "The title of the Infocols component",
Expand Down Expand Up @@ -84,5 +82,6 @@ export const InfoColsSchema = Type.Object(
)

export type InfoColsProps = Static<typeof InfoColsSchema> & {
sectionIdx?: number // TODO: Remove this property, only used in classic theme
LinkComponent?: any // Next.js link

Check warning on line 86 in packages/components/src/interfaces/complex/InfoCols.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
}
10 changes: 2 additions & 8 deletions packages/components/src/interfaces/complex/Infobar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ import { Type } from "@sinclair/typebox"
export const InfobarSchema = Type.Object(
{
type: Type.Literal("infobar", { default: "infobar" }),
// TODO: Remove this property, only used in classic theme
sectionIdx: Type.Optional(Type.Number()),
title: Type.String({
title: "Infobar title",
description: "The title of the infobar",
}),
subtitle: Type.Optional(
Type.String({
title: "Infobar subtitle",
description: "The subtitle of the infobar",
}),
),
description: Type.Optional(
Type.String({
title: "Infobar content",
Expand Down Expand Up @@ -53,5 +45,7 @@ export const InfobarSchema = Type.Object(
)

export type InfobarProps = Static<typeof InfobarSchema> & {
sectionIdx?: number // TODO: Remove this property, only used in classic theme
subtitle?: string // Subtitle that is only used in the classic theme
LinkComponent?: any // Next.js link

Check warning on line 50 in packages/components/src/interfaces/complex/Infobar.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
}
13 changes: 4 additions & 9 deletions packages/components/src/interfaces/complex/Infopic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ import { Type } from "@sinclair/typebox"
export const InfopicSchema = Type.Object(
{
type: Type.Literal("infopic", { default: "infopic" }),
// TODO: Remove this property, only used in classic theme
sectionIndex: Type.Optional(Type.Number()),
title: Type.String({
title: "Infopic title",
description: "The title of the Infopic component",
}),
subtitle: Type.Optional(
Type.String({
title: "Infopic subtitle",
description: "The subtitle of the Infopic component",
}),
),
description: Type.Optional(
Type.String({
title: "Infopic description",
Expand Down Expand Up @@ -65,4 +57,7 @@ export const InfopicSchema = Type.Object(
},
)

export type InfopicProps = Static<typeof InfopicSchema>
export type InfopicProps = Static<typeof InfopicSchema> & {
sectionIndex?: number // TODO: Remove this property, only used in classic theme
subtitle?: string // Subtitle that is only used in the classic theme
}

0 comments on commit e000312

Please sign in to comment.