Skip to content

Commit

Permalink
♻️ (common) migrating to specific common component import paths pt2 (a…
Browse files Browse the repository at this point in the history
…ctualbudget#1419)

Part 2 of the path migration. No functional changes.

Part 1: actualbudget#1418

---------

Co-authored-by: Jed Fox <[email protected]>
  • Loading branch information
MatissJanis and j-f1 authored Jul 30, 2023
1 parent 87bbe21 commit a4230c2
Show file tree
Hide file tree
Showing 40 changed files with 157 additions and 106 deletions.
3 changes: 2 additions & 1 deletion packages/desktop-client/src/components/AppBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import AnimatedLoading from '../icons/AnimatedLoading';
import { theme } from '../style';

import Background from './Background';
import { View, Block } from './common';
import Block from './common/Block';
import View from './common/View';

function AppBackground({ initializing, loadingText }) {
return (
Expand Down
18 changes: 8 additions & 10 deletions packages/desktop-client/src/components/FatalError.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import React, { Component, useState } from 'react';

import { theme } from '../style';

import {
View,
Stack,
Text,
Block,
Modal,
LinkButton,
Button,
ExternalLink,
} from './common';
import { ExternalLink } from './common';
import Block from './common/Block';
import Button from './common/Button';
import LinkButton from './common/LinkButton';
import Modal from './common/Modal';
import Paragraph from './common/Paragraph';
import Stack from './common/Stack';
import Text from './common/Text';
import View from './common/View';
import { Checkbox } from './forms';

class FatalError extends Component {
Expand Down
16 changes: 7 additions & 9 deletions packages/desktop-client/src/components/ManageRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ import useSelected, {
import ArrowRight from '../icons/v0/RightArrow2';
import { colors } from '../style';

import {
View,
Text,
Button,
Stack,
ExternalLink,
Input,
LinkButton,
} from './common';
import { ExternalLink } from './common';
import Button from './common/Button';
import Input from './common/Input';
import LinkButton from './common/LinkButton';
import Stack from './common/Stack';
import Text from './common/Text';
import View from './common/View';
import { SelectCell, Row, Field, Cell, CellButton, TableHeader } from './table';

let SchedulesQuery = liveQueryContext(q('schedules').select('*'));
Expand Down
15 changes: 6 additions & 9 deletions packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ import AnimatedLoading from '../icons/AnimatedLoading';
import Delete from '../icons/v0/Delete';
import { styles, colors } from '../style';

import {
View,
Text,
Button,
ButtonWithLoading,
Stack,
ExternalLink,
LinkButton,
} from './common';
import { ExternalLink } from './common';
import Button, { ButtonWithLoading } from './common/Button';
import LinkButton from './common/LinkButton';
import Stack from './common/Stack';
import Text from './common/Text';
import View from './common/View';

function compileMessage(
message: string,
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-client/src/components/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { type CSSProperties } from 'glamor';
import { useResponsive } from '../ResponsiveProvider';
import { colors, styles } from '../style';

import { Modal, View, Text } from './common';
import Modal from './common/Modal';
import Text from './common/Text';
import View from './common/View';

let PageTypeContext = createContext({ type: 'page', current: undefined });

Expand Down
5 changes: 4 additions & 1 deletion packages/desktop-client/src/components/UpdateNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { useActions } from '../hooks/useActions';
import Close from '../icons/v1/Close';
import { colors } from '../style';

import { View, Text, LinkButton, Button } from './common';
import Button from './common/Button';
import LinkButton from './common/LinkButton';
import Text from './common/Text';
import View from './common/View';

function closeNotification(setAppState) {
// Set a flag to never show an update notification again for this session
Expand Down
6 changes: 5 additions & 1 deletion packages/desktop-client/src/components/accounts/Reconcile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { currencyToInteger } from 'loot-core/src/shared/util';

import CheckCircle1 from '../../icons/v2/CheckCircle1';
import { styles, colors } from '../../style';
import { View, Text, Button, Input, InitialFocus } from '../common';
import Button from '../common/Button';
import InitialFocus from '../common/InitialFocus';
import Input from '../common/Input';
import Text from '../common/Text';
import View from '../common/View';
import format from '../spreadsheet/format';
import useSheetValue from '../spreadsheet/useSheetValue';
import { Tooltip } from '../tooltips';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ import Add from '../../icons/v1/Add';
import ArrowThinLeft from '../../icons/v1/ArrowThinLeft';
import ArrowThinRight from '../../icons/v1/ArrowThinRight';
import { colors, styles } from '../../style';
import { Button, Card, Label, Text, View } from '../common';
import Button from '../common/Button';
import Card from '../common/Card';
import Label from '../common/Label';
import Text from '../common/Text';
import View from '../common/View';
import CellValue from '../spreadsheet/CellValue';
import format from '../spreadsheet/format';
import NamespaceContext from '../spreadsheet/NamespaceContext';
Expand Down
5 changes: 4 additions & 1 deletion packages/desktop-client/src/components/budget/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import ExpandArrow from '../../icons/v0/ExpandArrow';
import CheveronDown from '../../icons/v1/CheveronDown';
import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';
import { styles, colors } from '../../style';
import { View, Text, Button, Menu } from '../common';
import Button from '../common/Button';
import Menu from '../common/Menu';
import Text from '../common/Text';
import View from '../common/View';
import NotesButton from '../NotesButton';
import {
useDraggable,
Expand Down
8 changes: 0 additions & 8 deletions packages/desktop-client/src/components/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ import { colors } from '../style';
import Button from './common/Button';

export { default as AnchorLink } from './common/AnchorLink';
export { default as Block } from './common/Block';
export { default as Button, ButtonWithLoading } from './common/Button';
export { default as Card } from './common/Card';
export { default as Select } from './common/Select';
export { default as InitialFocus } from './common/InitialFocus';
export { default as Input } from './common/Input';
export { default as Label } from './common/Label';
export { default as Menu } from './common/Menu';
export { default as Modal, ModalButtons } from './common/Modal';
export { default as Stack } from './common/Stack';
export { default as Text } from './common/Text';
export { default as View } from './common/View';
export { default as LinkButton } from './common/LinkButton';

let externalLinkColors = {
purple: colors.p4,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';

import { Modal, View } from '../common';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import View from '../common/View';

export default function GoCardlessLink() {
window.close();
Expand Down
5 changes: 4 additions & 1 deletion packages/desktop-client/src/components/manager/BudgetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import Key from '../../icons/v2/Key';
import RefreshArrow from '../../icons/v2/RefreshArrow';
import { styles, colors } from '../../style';
import tokens from '../../tokens';
import { View, Text, Button, Menu } from '../common';
import Button from '../common/Button';
import Menu from '../common/Menu';
import Text from '../common/Text';
import View from '../common/View';
import { Tooltip } from '../tooltips';

function getFileDescription(file) {
Expand Down
5 changes: 4 additions & 1 deletion packages/desktop-client/src/components/manager/DeleteFile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React, { useState } from 'react';

import { colors } from '../../style';
import { View, Text, Modal, ButtonWithLoading } from '../common';
import { ButtonWithLoading } from '../common/Button';
import Modal from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';

export default function DeleteMenu({ modalProps, actions, file }) {
let [loadingState, setLoadingState] = useState(null);
Expand Down
6 changes: 5 additions & 1 deletion packages/desktop-client/src/components/manager/Import.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React, { useState } from 'react';

import { styles, colors } from '../../style';
import { View, Block, Modal, Button, Text } from '../common';
import Block from '../common/Block';
import Button from '../common/Button';
import Modal from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';

function getErrorMessage(error) {
switch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { useDispatch } from 'react-redux';
import { importBudget } from 'loot-core/src/client/actions/budgets';

import { styles, colors } from '../../style';
import { View, Block, Modal, ButtonWithLoading } from '../common';
import Block from '../common/Block';
import { ButtonWithLoading } from '../common/Button';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import View from '../common/View';

function getErrorMessage(error) {
switch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { useDispatch } from 'react-redux';
import { importBudget } from 'loot-core/src/client/actions/budgets';

import { styles, colors } from '../../style';
import { View, Block, Modal, ButtonWithLoading } from '../common';
import Block from '../common/Block';
import { ButtonWithLoading } from '../common/Button';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import View from '../common/View';

function getErrorMessage(error) {
switch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import { useDispatch } from 'react-redux';
import { importBudget } from 'loot-core/src/client/actions/budgets';

import { styles, colors } from '../../style';
import { View, Block, Modal, ButtonWithLoading, ExternalLink } from '../common';
import { ExternalLink } from '../common';
import Block from '../common/Block';
import { ButtonWithLoading } from '../common/Button';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import View from '../common/View';

function getErrorMessage(error) {
switch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { rolloverBudget } from 'loot-core/src/client/queries';
import * as monthUtils from 'loot-core/src/shared/months';

import { colors, styles } from '../../style';
import { View, Text, Modal, Button } from '../common';
import Button from '../common/Button';
import Modal from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';
import CellValue from '../spreadsheet/CellValue';
import format from '../spreadsheet/format';
import NamespaceContext from '../spreadsheet/NamespaceContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import React, { useState } from 'react';

import { colors } from '../../style';
import CategoryAutocomplete from '../autocomplete/CategorySelect';
import { View, Text, Block, Modal, Button } from '../common';
import Block from '../common/Block';
import Button from '../common/Button';
import Modal from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';

export default function ConfirmCategoryDelete({
modalProps,
Expand Down
13 changes: 5 additions & 8 deletions packages/desktop-client/src/components/modals/CreateAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import { pushModal } from 'loot-core/src/client/actions/modals';

import { authorizeBank } from '../../gocardless';
import useGoCardlessStatus from '../../hooks/useGoCardlessStatus';
import {
View,
Text,
Modal,
Button,
ButtonWithLoading,
ExternalLink,
} from '../common';
import { ExternalLink } from '../common';
import Button, { ButtonWithLoading } from '../common/Button';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

export default function CreateAccount({ modalProps, syncServerStatus }) {
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@ import { send } from 'loot-core/src/platform/client/fetch';
import { getCreateKeyError } from 'loot-core/src/shared/errors';

import { colors } from '../../style';
import {
View,
Text,
Modal,
ButtonWithLoading,
ExternalLink,
ModalButtons,
Input,
InitialFocus,
} from '../common';
import { ExternalLink } from '../common';
import { ButtonWithLoading } from '../common/Button';
import InitialFocus from '../common/InitialFocus';
import Input from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

export default function CreateEncryptionKey({
modalProps,
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop-client/src/components/modals/EditField.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { colors } from '../../style';
import AccountAutocomplete from '../autocomplete/AccountAutocomplete';
import CategoryAutocomplete from '../autocomplete/CategorySelect';
import PayeeAutocomplete from '../autocomplete/PayeeAutocomplete';
import { View, Modal, Input } from '../common';
import Input from '../common/Input';
import Modal from '../common/Modal';
import View from '../common/View';
import { SectionLabel } from '../forms';
import DateSelect from '../select/DateSelect';

Expand Down
18 changes: 7 additions & 11 deletions packages/desktop-client/src/components/modals/FixEncryptionKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ import { send } from 'loot-core/src/platform/client/fetch';
import { getTestKeyError } from 'loot-core/src/shared/errors';

import { colors } from '../../style';
import {
View,
Text,
Modal,
Button,
ButtonWithLoading,
ModalButtons,
Input,
InitialFocus,
ExternalLink,
} from '../common';
import { ExternalLink } from '../common';
import Button, { ButtonWithLoading } from '../common/Button';
import InitialFocus from '../common/InitialFocus';
import Input from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

export default function FixEncryptionKey({
modalProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ import {

import { useActions } from '../../hooks/useActions';
import { colors, styles } from '../../style';
import {
View,
Text,
Stack,
Modal,
Select,
Input,
Button,
ButtonWithLoading,
} from '../common';
import Button, { ButtonWithLoading } from '../common/Button';
import Input from '../common/Input';
import Modal from '../common/Modal';
import Select from '../common/Select';
import Stack from '../common/Stack';
import Text from '../common/Text';
import View from '../common/View';
import { Checkbox, SectionLabel } from '../forms';
import { TableHeader, TableWithNavigator, Row, Field } from '../table';

Expand Down
6 changes: 5 additions & 1 deletion packages/desktop-client/src/components/modals/LoadBackup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import React, { Component, useState, useEffect } from 'react';
import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch';

import { colors } from '../../style';
import { View, Text, Block, Modal, Button } from '../common';
import Block from '../common/Block';
import Button from '../common/Button';
import Modal from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';
import { Row, Cell } from '../table';

class BackupTable extends Component {
Expand Down
Loading

0 comments on commit a4230c2

Please sign in to comment.