Skip to content

Commit b81f6ff

Browse files
committed
Merge branch 'frontend-named-exports'
2 parents ab47bcf + 7b7961a commit b81f6ff

File tree

22 files changed

+46
-48
lines changed

22 files changed

+46
-48
lines changed

frontends/web/src/components/forms/checkbox.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { describe, expect, it } from 'vitest';
1818
import { render, screen } from '@testing-library/react';
19-
import Checkbox from './checkbox';
19+
import { Checkbox } from './checkbox';
2020

2121
describe('components/forms/checkbox', () => {
2222
it('renders checkbox with proper attributes', () => {

frontends/web/src/components/forms/checkbox.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright 2018 Shift Devices AG
3-
* Copyright 2021 Shift Crypto AG
3+
* Copyright 2021-2024 Shift Crypto AG
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ type CheckboxProps = JSX.IntrinsicElements['input'] & {
2424
checkboxStyle?: 'default' | 'info' | 'warning' | 'success';
2525
}
2626

27-
const Checkbox: FunctionComponent<CheckboxProps> = ({
27+
export const Checkbox: FunctionComponent<CheckboxProps> = ({
2828
disabled = false,
2929
label,
3030
id,
@@ -45,5 +45,3 @@ const Checkbox: FunctionComponent<CheckboxProps> = ({
4545
</span>
4646
);
4747
};
48-
49-
export default Checkbox;

frontends/web/src/components/forms/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
export { Button, ButtonLink } from './button';
19-
export { default as Checkbox } from './checkbox';
19+
export { Checkbox } from './checkbox';
2020
export { Radio } from './radio';
2121
export { Field } from './field';
2222
export { Input } from './input';

frontends/web/src/components/groupedaccountselector/groupedaccountselector.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
import { useContext, useEffect, useState } from 'react';
1718
import { useTranslation } from 'react-i18next';
1819
import Select, { components, SingleValueProps, OptionProps, SingleValue, DropdownIndicatorProps, GroupProps, GroupHeadingProps as ReactSelectGroupHeadingProps } from 'react-select';
1920
import { AccountCode, IAccount } from '../../api/account';
2021
import { Button } from '../forms';
21-
import Logo from '../icon/logo';
22+
import { Logo } from '../icon/logo';
2223
import { AppContext } from '../../contexts/AppContext';
2324
import { USBSuccess } from '../icon';
2425
import { Badge } from '../badge/badge';

frontends/web/src/components/headerssync/headerssync.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright 2018 Shift Devices AG
3-
* Copyright 2021 Shift Crypto AG
3+
* Copyright 2021-2024 Shift Crypto AG
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import { useMountedRef } from '../../hooks/mount';
2121
import { CoinCode } from '../../api/account';
2222
import { subscribeCoinHeaders } from '../../api/coins';
2323
import { useSubscribe } from '../../hooks/api';
24-
import Spinner from '../spinner/ascii';
24+
import { AsciiSpinner } from '../spinner/ascii';
2525
import style from './headerssync.module.css';
2626

2727
export type TProps = {
@@ -57,7 +57,7 @@ export const HeadersSync = ({ coinCode }: TProps) => {
5757
{' '}
5858
{ !loaded && `(${Math.ceil(value)}%)` }
5959
</div>
60-
{ !loaded ? (<Spinner />) : null }
60+
{ !loaded ? (<AsciiSpinner />) : null }
6161
</div>
6262
<div data-testid="progress-bar" className={style.progressBar}>
6363
<div className={style.progressValue} style={{ width: `${value}%` }}></div>

frontends/web/src/components/icon/logo.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright 2018 Shift Devices AG
3-
* Copyright 2021 Shift Crypto AG
3+
* Copyright 2021-2024 Shift Crypto AG
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -104,7 +104,12 @@ interface Props {
104104
stacked?: boolean;
105105
}
106106

107-
function Logo({ coinCode, active, stacked, ...rest }: Props) {
107+
export const Logo = ({
108+
coinCode,
109+
active,
110+
stacked,
111+
...rest
112+
}: Props) => {
108113
if (!logoMap[coinCode]) {
109114
console.error('logo undefined for ', coinCode);
110115
return null;
@@ -123,6 +128,4 @@ function Logo({ coinCode, active, stacked, ...rest }: Props) {
123128
</div>}
124129
</div>
125130
);
126-
}
127-
128-
export default Logo;
131+
};

frontends/web/src/components/sidebar/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import settings from '../../assets/icons/settings-alt.svg';
3030
import settingsGrey from '../../assets/icons/settings-alt_disabled.svg';
3131
import deviceSettings from '../../assets/icons/wallet-light.svg';
3232
import { debug } from '../../utils/env';
33-
import Logo, { AppLogoInverted } from '../icon/logo';
33+
import { AppLogoInverted, Logo } from '../icon/logo';
3434
import { CloseXWhite, USBSuccess } from '../icon';
3535
import { getAccountsByKeystore, isAmbiguiousName, isBitcoinOnly } from '../../routes/account/utils';
3636
import { SkipForTesting } from '../../routes/device/components/skipfortesting';

frontends/web/src/components/spinner/ascii.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2020 Shift Crypto AG
2+
* Copyright 2020-2024 Shift Crypto AG
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,10 +16,10 @@
1616

1717
import style from './ascii.module.css';
1818

19-
export default function AsciiSpinner() {
19+
export const AsciiSpinner = () => {
2020
return (
2121
<div className={style.spinnerContainer}>
2222
<div className={style.spinner}></div>
2323
</div>
2424
);
25-
}
25+
};

frontends/web/src/contexts/DarkmodeContext.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2023 Shift Crypto AG
2+
* Copyright 2023-2024 Shift Crypto AG
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,4 @@ type DarkModeContextProps = {
2121
toggleDarkmode: (darkmode: boolean) => void;
2222
}
2323

24-
const DarkModeContext = createContext<DarkModeContextProps>({} as DarkModeContextProps);
25-
26-
export default DarkModeContext;
24+
export const DarkModeContext = createContext<DarkModeContextProps>({} as DarkModeContextProps);

frontends/web/src/contexts/DarkmodeProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { getConfig, setConfig } from '../utils/config';
1919
import { setDarkTheme, detectDarkTheme } from '../api/darktheme';
2020
import { runningInAndroid } from '../utils/env';
2121
import { useMediaQuery } from '../hooks/mediaquery';
22-
import DarkModeContext from './DarkmodeContext';
22+
import { DarkModeContext } from './DarkmodeContext';
2323

2424
type TProps = {
2525
children: ReactNode;

0 commit comments

Comments
 (0)