diff --git a/packages/desktop-client/src/components/common.tsx b/packages/desktop-client/src/components/common.tsx index 9df6cd347254e588289870c439e3d654f633fb67..183994882872c3fc8bf7ffce532ee93f7dead7b0 100644 --- a/packages/desktop-client/src/components/common.tsx +++ b/packages/desktop-client/src/components/common.tsx @@ -356,40 +356,6 @@ export function Search({ ); } -type KeyboardButtonProps = ComponentProps<typeof Button> & { - highlighted?: boolean; -}; -export function KeyboardButton({ - highlighted, - children, - ...props -}: KeyboardButtonProps) { - return ( - <Button - {...props} - bare - style={[ - { - backgroundColor: 'white', - shadowColor: colors.n3, - shadowOffset: { width: 0, height: 1 }, - shadowRadius: 1, - shadowOpacity: 1, - elevation: 4, - borderWidth: 0, - paddingLeft: 17, - paddingRight: 17, - }, - highlighted && { backgroundColor: colors.p6 }, - props.style, - ]} - textStyle={[highlighted && { color: 'white' }]} - > - {children} - </Button> - ); -} - type SelectProps = HTMLPropsWithStyle<HTMLSelectElement>; export const Select = forwardRef<HTMLSelectElement, SelectProps>( @@ -696,16 +662,6 @@ export function P({ style, isLast, children, ...props }: PProps) { ); } -type StrongProps = HTMLPropsWithStyle<HTMLSpanElement>; - -export function Strong({ style, children, ...props }: StrongProps) { - return ( - <span {...props} {...css(style, { fontWeight: 500 })}> - {children} - </span> - ); -} - type InlineFieldProps = { label: ReactNode; labelWidth?: number; @@ -859,7 +815,5 @@ export function Label({ title, style }: LabelProps) { ); } -export const NullComponent = () => null; - export * from './tooltips'; export { useTooltip } from './tooltips'; diff --git a/packages/desktop-client/src/components/manager/subscribe/common.tsx b/packages/desktop-client/src/components/manager/subscribe/common.tsx index 9e0082fb7ae99124e36e618783f804d48f7cf010..73b2c58b037057df67b8b8549fd1f2481c723f85 100644 --- a/packages/desktop-client/src/components/manager/subscribe/common.tsx +++ b/packages/desktop-client/src/components/manager/subscribe/common.tsx @@ -3,16 +3,13 @@ import React, { forwardRef, useEffect, useState, - type ReactNode, } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; -import { type CSSProperties } from 'glamor'; - import { send } from 'loot-core/src/platform/client/fetch'; import { colors, styles } from '../../../style'; -import { Text, Button, Input as BaseInput } from '../../common'; +import { Input as BaseInput } from '../../common'; import { useSetServerURL } from '../../ServerContext'; // There are two URLs that dance with each other: `/login` and @@ -78,14 +75,6 @@ export function useBootstrapped() { return { checked }; } -export function getEmail(location) { - let m = location.search.match(/email=([^&]*)/); - if (!m) { - return ''; - } - return decodeURIComponent(m[1]); -} - type TitleProps = { text: string; }; @@ -122,93 +111,3 @@ export const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => { /> ); }); - -type BareButtonProps = ComponentProps<typeof Button>; -export const BareButton = forwardRef<HTMLButtonElement, BareButtonProps>( - (props, ref) => { - return ( - <Button - ref={ref} - bare - {...props} - style={[ - { - color: colors.p4, - fontSize: 15, - textDecoration: 'none', - padding: '5px 7px', - borderRadius: 4, - ':hover': { - backgroundColor: colors.n9, - }, - ':active': { - backgroundColor: colors.n9, - }, - }, - props.style, - ]} - /> - ); - }, -); - -type ExternalLinkProps = ComponentProps<typeof BareButton>; -export const ExternalLink = forwardRef<HTMLButtonElement, ExternalLinkProps>( - (props, ref) => { - let { href, ...linkProps } = props; - return ( - <BareButton - // @ts-expect-error prop does not exist on Button - to="/" - {...linkProps} - onClick={e => { - e.preventDefault(); - window.Actual.openURLInBrowser(href); - }} - /> - ); - }, -); - -type BackLinkProps = ComponentProps<typeof BareButton> & { - history; -}; -export const BackLink = forwardRef<HTMLButtonElement, BackLinkProps>( - (props, ref) => { - return ( - <BareButton - ref={ref} - // @ts-expect-error prop does not exist on Button - to="/" - onClick={e => { - e.preventDefault(); - props.history.goBack(); - }} - > - Back - </BareButton> - ); - }, -); - -type ParagraphProps = { - style?: CSSProperties; - children: ReactNode; -}; -export function Paragraph({ style, children }: ParagraphProps) { - return ( - <Text - style={[ - { - fontSize: 15, - color: colors.n2, - lineHeight: 1.5, - marginTop: 20, - }, - style, - ]} - > - {children} - </Text> - ); -} diff --git a/packages/desktop-client/src/components/reports/util.js b/packages/desktop-client/src/components/reports/util.js index 9866fca32b48ade9ea4234aa47eaeb7f58797d13..9cd905366d6ae65338b30ee04067ec971649ba46 100644 --- a/packages/desktop-client/src/components/reports/util.js +++ b/packages/desktop-client/src/components/reports/util.js @@ -8,10 +8,6 @@ export function fromDateReprToDay(date) { return date; } -export function toDateRepr(str) { - return parseInt(str.replace(/-/g, ''), 10); -} - export async function runAll(queries, cb) { let data = await Promise.all( queries.map(q => { diff --git a/packages/desktop-client/src/components/schedules/StatusBadge.js b/packages/desktop-client/src/components/schedules/StatusBadge.js index ca8fbea1255ce1ed56d75762a62e32dd370eb549..99ebf9f7ec9bb80b3455187c780eaf1e093f5f91 100644 --- a/packages/desktop-client/src/components/schedules/StatusBadge.js +++ b/packages/desktop-client/src/components/schedules/StatusBadge.js @@ -66,12 +66,6 @@ export function getStatusProps(status) { return { color, backgroundColor, Icon }; } -export function StatusIcon({ status }) { - let { color, Icon } = getStatusProps(status); - - return <Icon style={{ width: 13, height: 13, color }} />; -} - export function StatusBadge({ status, style }) { let { color, backgroundColor, Icon } = getStatusProps(status); return ( diff --git a/packages/desktop-client/src/hooks/index.js b/packages/desktop-client/src/hooks/index.js index 85bd3a7dce5d5d6d43af407af0ef345408a23747..8304c4bbf4e4e17cdfbe65283b5c8b0c6c1e08d8 100644 --- a/packages/desktop-client/src/hooks/index.js +++ b/packages/desktop-client/src/hooks/index.js @@ -1,21 +1,7 @@ -import { useEffect, useRef } from 'react'; +import { useEffect } from 'react'; import { setThemeColor } from '../util/withThemeColor'; -export function useScrollFlasher() { - let scrollRef = useRef(null); - - useEffect(() => { - setTimeout(() => { - if (scrollRef.current) { - scrollRef.current.flashScrollIndicators(); - } - }, 1000); - }, []); - - return scrollRef; -} - export function useSetThemeColor(color) { useEffect(() => { setThemeColor(color); diff --git a/packages/desktop-client/src/style.tsx b/packages/desktop-client/src/style.tsx index 84fa957e759efe1fb1848548bad4dc57a242245f..13dbcc255f413ac40c775d233341176125bff252 100644 --- a/packages/desktop-client/src/style.tsx +++ b/packages/desktop-client/src/style.tsx @@ -2,8 +2,6 @@ import * as Platform from 'loot-core/src/client/platform'; import tokens from './tokens'; -export const debug = { borderWidth: 1, borderColor: 'red' }; - export const colors = { y1: '#733309', y2: '#87540d', diff --git a/upcoming-release-notes/1145.md b/upcoming-release-notes/1145.md new file mode 100644 index 0000000000000000000000000000000000000000..252ad367a06dac4916909e90479fc769b73b2874 --- /dev/null +++ b/upcoming-release-notes/1145.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [Shazib] +--- + +Remove unused functions from source