mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-09 23:44:08 +02:00
refact: standardize PropsWithChildren
This commit is contained in:
@@ -1,11 +1,7 @@
|
|||||||
import React from "react"
|
import React, { PropsWithChildren} from "react"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
interface ContainerProps {
|
const Container = ({ children, ...restProps }: PropsWithChildren<{}>): JSX.Element => (
|
||||||
children: React.ReactNode
|
|
||||||
}
|
|
||||||
|
|
||||||
const Container = ({ children, ...restProps }: ContainerProps): JSX.Element => (
|
|
||||||
<SC.ContainerWrapper {...restProps}>{children}</SC.ContainerWrapper>
|
<SC.ContainerWrapper {...restProps}>{children}</SC.ContainerWrapper>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from "react"
|
import React, { PropsWithChildren } from "react"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
|
|
||||||
export interface DocsSidebarSectionProps {
|
export interface DocsSidebarSectionProps {
|
||||||
@@ -8,7 +8,7 @@ export interface DocsSidebarSectionProps {
|
|||||||
const DocsSidebarSection = ({
|
const DocsSidebarSection = ({
|
||||||
title,
|
title,
|
||||||
children,
|
children,
|
||||||
}: React.PropsWithChildren<DocsSidebarSectionProps>) => {
|
}: PropsWithChildren<DocsSidebarSectionProps>) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SC.SidebarTitle>{title}</SC.SidebarTitle>
|
<SC.SidebarTitle>{title}</SC.SidebarTitle>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from "react"
|
import React, { PropsWithChildren } from "react"
|
||||||
import logo from "../../images/tph-logo.png"
|
import logo from "../../images/tph-logo.png"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
import ArrowRight from "../../icons/arrow-right.svg"
|
import ArrowRight from "../../icons/arrow-right.svg"
|
||||||
|
|
||||||
function MenuItem({ children, to }: { children: React.ReactNode; to: string }) {
|
function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) {
|
||||||
return (
|
return (
|
||||||
<SC.MenuItem to={to}>
|
<SC.MenuItem to={to}>
|
||||||
{children} <ArrowRight />
|
{children} <ArrowRight />
|
||||||
|
|||||||
Reference in New Issue
Block a user