mirror of
https://github.com/BoostIO/BoostNote-App.git
synced 2024-10-04 08:07:41 +03:00
Improve type defs for styled-components
This commit is contained in:
parent
f059e65037
commit
ee40a133d1
@ -45,13 +45,6 @@ const AttachmentList = ({ storage }: AttachmentListProps) => {
|
||||
event.preventDefault()
|
||||
|
||||
popup(event, [
|
||||
// {
|
||||
// type: MenuTypes.Normal,
|
||||
// label: 'Copy Image Reference',
|
||||
// onClick: () => {
|
||||
// // TODO Clipboard
|
||||
// }
|
||||
// },
|
||||
{
|
||||
type: MenuTypes.Normal,
|
||||
label: 'Download',
|
||||
|
@ -2,7 +2,7 @@ import { createGlobalStyle } from 'styled-components'
|
||||
import { backgroundColor, textColor } from '../lib/styled/styleFunctions'
|
||||
import { BaseTheme } from '../lib/styled/BaseTheme'
|
||||
|
||||
export default createGlobalStyle<BaseTheme>`
|
||||
export default createGlobalStyle<{ theme: BaseTheme }>`
|
||||
body {
|
||||
margin: 0;
|
||||
${backgroundColor}
|
||||
|
@ -60,7 +60,7 @@ export default () => {
|
||||
useGlobalKeyDownHandler(keydownHandler)
|
||||
|
||||
const backgroundClickHandler = useMemo(() => {
|
||||
return (event: MouseEvent) => {
|
||||
return (event: React.MouseEvent<HTMLDivElement>) => {
|
||||
event.preventDefault()
|
||||
closeHandler()
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useMemo, useCallback } from 'react'
|
||||
import { tutorialsTree, TutorialsNavigatorTreeItem } from '../../lib/tutorials'
|
||||
import SideNavigatorItem from '../SideNavigator/SideNavigatorItem'
|
||||
import SideNavigatorItem from '../molecules/SideNavigatorItem'
|
||||
import { useRouter, useCurrentTutorialPathname } from '../../lib/router'
|
||||
import { useGeneralStatus } from '../../lib/generalStatus'
|
||||
import { useContextMenu, MenuTypes } from '../../lib/contextMenu'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import styled from '../../lib/styled'
|
||||
|
||||
const StyledButtonIcon = styled.button<{ active: boolean }>`
|
||||
const StyledButtonIcon = styled.button`
|
||||
color: currentColor;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
|
7
typings/styled-components.d.ts
vendored
7
typings/styled-components.d.ts
vendored
@ -1,12 +1,9 @@
|
||||
declare module 'styled-components' {
|
||||
export type StyledComponent<T1, T2, T3, T4> = any
|
||||
export function createGlobalStyle<T>(
|
||||
export function createGlobalStyle<P>(
|
||||
strings: TemplateStringsArray,
|
||||
...keys: Array<
|
||||
| number
|
||||
| undefined
|
||||
| string
|
||||
| ((props: { theme: T }) => string | number | undefined)
|
||||
number | undefined | string | ((props: P) => string | number | undefined)
|
||||
>
|
||||
): any
|
||||
export type ThemedBaseStyledInterface<T> = {
|
||||
|
Loading…
Reference in New Issue
Block a user