diff --git a/app/components/Avatar/Avatar.js b/app/components/Avatar/Avatar.js index 38cfe682..c8b25daf 100644 --- a/app/components/Avatar/Avatar.js +++ b/app/components/Avatar/Avatar.js @@ -11,6 +11,7 @@ type Props = {| size: number, icon?: React.Node, user?: User, + alt?: string, onClick?: () => void, className?: string, |}; diff --git a/app/components/InputSelect.js b/app/components/InputSelect.js index b59367c4..250d55de 100644 --- a/app/components/InputSelect.js +++ b/app/components/InputSelect.js @@ -128,12 +128,7 @@ const InputSelect = (props: Props) => { wrappedLabel ))} - {(props) => ( { )} - + {(props) => { const topAnchor = props.style.top === "0"; const rightAnchor = props.placement === "bottom-end"; diff --git a/app/components/Sidebar/components/CollectionLink.js b/app/components/Sidebar/components/CollectionLink.js index 6b67473d..da25d77a 100644 --- a/app/components/Sidebar/components/CollectionLink.js +++ b/app/components/Sidebar/components/CollectionLink.js @@ -177,8 +177,6 @@ function CollectionLink({ icon={ } - iconColor={collection.color} - expanded={expanded} showActions={menuOpen || expanded} isActiveDrop={isOver && canDrop} label={ diff --git a/app/components/Sidebar/components/DropToImport.js b/app/components/Sidebar/components/DropToImport.js index cb503dc8..1921ccb3 100644 --- a/app/components/Sidebar/components/DropToImport.js +++ b/app/components/Sidebar/components/DropToImport.js @@ -14,7 +14,6 @@ type Props = {| collectionId: string, documentId?: string, disabled: boolean, - staticContext: Object, |}; function DropToImport({ disabled, children, collectionId, documentId }: Props) { @@ -56,7 +55,7 @@ function DropToImport({ disabled, children, collectionId, documentId }: Props) { }) => ( @@ -71,8 +70,8 @@ function DropToImport({ disabled, children, collectionId, documentId }: Props) { const DropzoneContainer = styled.div` border-radius: 4px; - ${({ isDragActive, theme }) => - isDragActive && + ${({ $isDragActive, theme }) => + $isDragActive && css` background: ${theme.slateDark}; a { diff --git a/app/components/Sidebar/components/SidebarLink.js b/app/components/Sidebar/components/SidebarLink.js index b0efc5b4..d95bbfec 100644 --- a/app/components/Sidebar/components/SidebarLink.js +++ b/app/components/Sidebar/components/SidebarLink.js @@ -1,12 +1,10 @@ // @flow import { transparentize } from "polished"; import * as React from "react"; -import { withRouter, type RouterHistory, type Match } from "react-router-dom"; -import styled, { withTheme } from "styled-components"; +import styled, { useTheme } from "styled-components"; import breakpoint from "styled-components-breakpoint"; import EventBoundary from "components/EventBoundary"; import NavLink from "./NavLink"; -import { type Theme } from "types"; type Props = {| to?: string | Object, @@ -20,12 +18,8 @@ type Props = {| label?: React.Node, menu?: React.Node, showActions?: boolean, - iconColor?: string, active?: boolean, isActiveDrop?: boolean, - history: RouterHistory, - match: Match, - theme: Theme, exact?: boolean, depth?: number, scrollIntoViewIfNeeded?: boolean, @@ -47,18 +41,16 @@ function SidebarLink( isActiveDrop, menu, showActions, - theme, exact, href, depth, - history, - match, className, scrollIntoViewIfNeeded, ...rest }: Props, ref ) { + const theme = useTheme(); const style = React.useMemo( () => ({ paddingLeft: `${(depth || 0) * 16 + 12}px`, @@ -191,4 +183,4 @@ const Label = styled.div` } `; -export default withRouter(withTheme(React.forwardRef(SidebarLink))); +export default React.forwardRef(SidebarLink); diff --git a/app/components/Sidebar/components/Toggle.js b/app/components/Sidebar/components/Toggle.js index 4a563de6..45cf3690 100644 --- a/app/components/Sidebar/components/Toggle.js +++ b/app/components/Sidebar/components/Toggle.js @@ -1,5 +1,6 @@ // @flow import * as React from "react"; +import { useTranslation } from "react-i18next"; import styled from "styled-components"; import breakpoint from "styled-components-breakpoint"; import Arrow from "components/Arrow"; @@ -12,9 +13,16 @@ type Props = { const Toggle = React.forwardRef( ({ direction = "left", onClick, style }: Props, ref) => { + const { t } = useTranslation(); + return ( - + diff --git a/app/scenes/Settings/components/ImageUpload.js b/app/scenes/Settings/components/ImageUpload.js index c4d39971..9ebe51a4 100644 --- a/app/scenes/Settings/components/ImageUpload.js +++ b/app/scenes/Settings/components/ImageUpload.js @@ -133,8 +133,8 @@ class ImageUpload extends React.Component { style={EMPTY_OBJECT} disablePreview > - {({ getRootProps, getInputProps, isDragActive }) => ( -
+ {({ getRootProps, getInputProps }) => ( +
{this.props.children}
diff --git a/app/scenes/UserProfile.js b/app/scenes/UserProfile.js index b78c7eee..7f38974f 100644 --- a/app/scenes/UserProfile.js +++ b/app/scenes/UserProfile.js @@ -4,7 +4,7 @@ import { observer } from "mobx-react"; import { EditIcon } from "outline-icons"; import * as React from "react"; import { useTranslation } from "react-i18next"; -import { withRouter, type RouterHistory } from "react-router-dom"; +import { useHistory } from "react-router-dom"; import styled from "styled-components"; import { settings } from "shared/utils/routeHelpers"; import User from "models/User"; @@ -21,7 +21,6 @@ import useStores from "hooks/useStores"; type Props = {| user: User, - history: RouterHistory, onRequestClose: () => void, |}; @@ -29,6 +28,7 @@ function UserProfile(props: Props) { const { t } = useTranslation(); const { documents } = useStores(); const currentUser = useCurrentUser(); + const history = useHistory(); const { user, ...rest } = props; if (!user) return null; @@ -38,7 +38,7 @@ function UserProfile(props: Props) { - +  {user.name} } @@ -61,7 +61,7 @@ function UserProfile(props: Props) { {isCurrentUser && (