Skip to content

Commit a87912e

Browse files
authored
Merge pull request #202 from nada-deriv/nada/folder-restructure
Nada/fix: restructure the folders for consistency
2 parents 45e99b3 + 807e10e commit a87912e

File tree

13 files changed

+26
-8
lines changed

13 files changed

+26
-8
lines changed

src/components/AppHeader/AccountSwitcher/index.tsx src/components/AppHeader/AccountSwitcher/AccountSwitcher.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type TAccountSwitcherProps = {
88
account: TActiveAccount;
99
};
1010

11-
export const AccountSwitcher = ({ account }: TAccountSwitcherProps) => {
11+
const AccountSwitcher = ({ account }: TAccountSwitcherProps) => {
1212
const activeAccount = {
1313
balance: FormatUtils.formatMoney(account?.balance ?? 0),
1414
currency: account?.currency || 'USD',
@@ -20,3 +20,5 @@ export const AccountSwitcher = ({ account }: TAccountSwitcherProps) => {
2020
};
2121
return account && <UIAccountSwitcher activeAccount={activeAccount} buttonClassName='mr-4' isDisabled />;
2222
};
23+
24+
export default AccountSwitcher;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as AccountSwitcher } from './AccountSwitcher';

src/components/AppHeader/SkeletonLoader/index.tsx src/components/AppHeader/AccountsInfoLoader/AccountsInfoLoader.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const LoggedInPreloader = ({ isMobile }: Pick<TAccountsInfoLoaderProps, 'isMobil
2727
</>
2828
);
2929

30-
export const AccountsInfoLoader = ({ isMobile, speed }: TAccountsInfoLoaderProps) => (
30+
const AccountsInfoLoader = ({ isMobile, speed }: TAccountsInfoLoaderProps) => (
3131
<ContentLoader
3232
backgroundColor={'#f2f3f4'}
3333
data-testid='dt_accounts_info_loader'
@@ -39,3 +39,5 @@ export const AccountsInfoLoader = ({ isMobile, speed }: TAccountsInfoLoaderProps
3939
<LoggedInPreloader isMobile={isMobile} />
4040
</ContentLoader>
4141
);
42+
43+
export default AccountsInfoLoader;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as AccountsInfoLoader } from './AccountsInfoLoader';

src/components/AppHeader/AppHeader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { useAuthData } from '@deriv-com/api-hooks';
66
import { useTranslations } from '@deriv-com/translations';
77
import { Button, Header, Text, useDevice, Wrapper } from '@deriv-com/ui';
88
import { TooltipMenuIcon } from '../TooltipMenuIcon';
9+
import { AccountsInfoLoader } from './AccountsInfoLoader';
910
import { AccountSwitcher } from './AccountSwitcher';
1011
import { AppLogo } from './AppLogo';
1112
import { MenuItems } from './MenuItems';
1213
import { MobileMenu } from './MobileMenu';
1314
import { Notifications } from './Notifications';
1415
import { PlatformSwitcher } from './PlatformSwitcher';
15-
import { AccountsInfoLoader } from './SkeletonLoader';
1616
import './AppHeader.scss';
1717

1818
// TODO: handle local storage values not updating after changing local storage values

src/components/AppHeader/AppLogo/index.tsx src/components/AppHeader/AppLogo/AppLogo.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DerivLogo, useDevice } from '@deriv-com/ui';
22
import { URLConstants } from '@deriv-com/utils';
33
import './AppLogo.scss';
44

5-
export const AppLogo = () => {
5+
const AppLogo = () => {
66
const { isDesktop } = useDevice();
77

88
if (!isDesktop) return null;
@@ -15,3 +15,5 @@ export const AppLogo = () => {
1515
/>
1616
);
1717
};
18+
19+
export default AppLogo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as AppLogo } from './AppLogo';

src/components/AppHeader/MenuItems/index.tsx src/components/AppHeader/MenuItems/MenuItems.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { MenuItem, Text, useDevice } from '@deriv-com/ui';
33
import { MenuItems as items } from '../HeaderConfig';
44
import './MenuItems.scss';
55

6-
export const MenuItems = () => {
6+
const MenuItems = () => {
77
const { localize } = useTranslations();
88
const { isDesktop } = useDevice();
99

@@ -29,3 +29,5 @@ export const MenuItems = () => {
2929
</>
3030
);
3131
};
32+
33+
export default MenuItems;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as MenuItems } from './MenuItems';

src/components/AppHeader/Notifications/index.tsx src/components/AppHeader/Notifications/Notifications.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { LegacyNotificationIcon } from '@deriv/quill-icons';
44
import { useTranslations } from '@deriv-com/translations';
55
import { Notifications as UINotifications, useDevice } from '@deriv-com/ui';
66

7-
export const Notifications = () => {
7+
const Notifications = () => {
88
const [isOpen, setIsOpen] = useState(false);
99
const { localize } = useTranslations();
1010
const { isMobile } = useDevice();
@@ -21,7 +21,7 @@ export const Notifications = () => {
2121
<LegacyNotificationIcon fill='red' iconSize='sm' />
2222
</TooltipMenuIcon>
2323
<UINotifications
24-
className={isMobile ? '' : 'notifications__wrapper absolute top-20 right-80 z-10'}
24+
className={isMobile ? '' : 'absolute top-20 right-80 z-10'}
2525
clearNotificationsCallback={() => {}}
2626
componentConfig={{
2727
clearButtonText: localize('Clear all'),
@@ -36,3 +36,5 @@ export const Notifications = () => {
3636
</>
3737
);
3838
};
39+
40+
export default Notifications;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Notifications } from './Notifications';

src/components/AppHeader/PlatformSwitcher/index.tsx src/components/AppHeader/PlatformSwitcher/PlatformSwitcher.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useTranslations } from '@deriv-com/translations';
22
import { PlatformSwitcher as UIPlatformSwitcher, PlatformSwitcherItem } from '@deriv-com/ui';
33
import { platformsConfig } from '../HeaderConfig';
44

5-
export const PlatformSwitcher = () => {
5+
const PlatformSwitcher = () => {
66
const { localize } = useTranslations();
77

88
return (
@@ -28,3 +28,5 @@ export const PlatformSwitcher = () => {
2828
</UIPlatformSwitcher>
2929
);
3030
};
31+
32+
export default PlatformSwitcher;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PlatformSwitcher } from './PlatformSwitcher';

0 commit comments

Comments
 (0)