Skip to content

Commit

Permalink
Add PropsWithChildren for now
Browse files Browse the repository at this point in the history
  • Loading branch information
alinnert committed Aug 30, 2022
1 parent f64112e commit 23674a3
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webdevhome.github.io-vite",
"version": "2.0.11",
"version": "2.0.11.1",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand Down
4 changes: 2 additions & 2 deletions src/components/App/AppContent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames'
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'

export const AppContent: FC = ({ children }) => {
export const AppContent: FC<PropsWithChildren> = ({ children }) => {
return (
<div
className={classNames(
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer/AppFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'
import classNames from 'classnames'

export const AppFooter: FC = ({ children }) => {
export const AppFooter: FC<PropsWithChildren> = ({ children }) => {
return (
<div
className={classNames(
Expand Down
9 changes: 6 additions & 3 deletions src/components/Footer/FooterGroupLink.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import classNames from 'classnames'
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'

interface Props {
href: string
}

export const FooterGroupLink: FC<Props> = ({ href, children }) => {
export const FooterGroupLink: FC<PropsWithChildren<Props>> = ({
href,
children,
}) => {
return (
<a
className={classNames(
Expand All @@ -15,7 +18,7 @@ export const FooterGroupLink: FC<Props> = ({ href, children }) => {
'hover:text-brand-600 hover:dark:text-brand-50',
'hover:bg-gray-300 dark:hover:bg-gray-500',
'rounded',
'focus:outline outline-1 outline-gray-500 dark:outline-gray-300'
'focus:outline outline-1 outline-gray-500 dark:outline-gray-300',
)}
href={href}
>
Expand Down
7 changes: 5 additions & 2 deletions src/components/Footer/FooterGroupText.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import classNames from 'classnames'
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'

interface Props {
className?: string
}

export const FooterGroupText: FC<Props> = ({ className = '', children }) => {
export const FooterGroupText: FC<PropsWithChildren<Props>> = ({
className = '',
children,
}) => {
return (
<div className={classNames('px-2 py-2 sm:mx-1', 'text-sm', className)}>
{children}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Links/LinkAction.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import classNames from 'classnames'
import { FC, MouseEvent } from 'react'
import { FC, MouseEvent, PropsWithChildren } from 'react'

interface Props {
className?: string
hasHover?: boolean
onClick?: (event: MouseEvent<HTMLDivElement>) => void
}

export const LinkAction: FC<Props> = ({
export const LinkAction: FC<PropsWithChildren<Props>> = ({
children,
className,
hasHover = false,
Expand Down
7 changes: 5 additions & 2 deletions src/components/Links/LinkGroupButton.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import classNames from 'classnames'
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'

interface Props {
onClick?: () => void
}

export const LinkGroupButton: FC<Props> = ({ children, onClick }) => {
export const LinkGroupButton: FC<PropsWithChildren<Props>> = ({
children,
onClick,
}) => {
return (
<button
className={classNames(
Expand Down
7 changes: 5 additions & 2 deletions src/components/Search/SearchHint.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { FC, Fragment } from 'react'
import { FC, Fragment, PropsWithChildren } from 'react'
import { Kbd } from '../basics/Kbd'

interface Props {
inputs?: string[]
}

export const SearchHint: FC<Props> = ({ children, inputs }) => {
export const SearchHint: FC<PropsWithChildren<Props>> = ({
children,
inputs,
}) => {
return (
<div className="mt-4">
{inputs !== undefined && inputs.length > 0 ? (
Expand Down
4 changes: 2 additions & 2 deletions src/components/Search/SearchHints.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'

export const SearchHints: FC = ({ children }) => {
export const SearchHints: FC<PropsWithChildren> = ({ children }) => {
return <div className="mx-8 text-lg">{children}</div>
}
4 changes: 2 additions & 2 deletions src/components/basics/Kbd.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames'
import { FC } from 'react'
import { FC, PropsWithChildren } from 'react'

export const Kbd: FC = ({ children }) => {
export const Kbd: FC<PropsWithChildren> = ({ children }) => {
return (
<kbd
className={classNames(
Expand Down
2 changes: 0 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { StrictMode } from 'react'
// @ts-expect-error wait for React 18 types to be fixed
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210/files#r846261799
import { createRoot } from 'react-dom/client'
import { Provider } from 'react-redux'
import { WebdevHome } from './components/App/App'
Expand Down

0 comments on commit 23674a3

Please sign in to comment.