Skip to content

Commit 1548adf

Browse files
committed
Fix TypeScript error in LoginForm - change button type from 'button' to 'default'
1 parent 311bdf0 commit 1548adf

9 files changed

Lines changed: 17 additions & 39 deletions

File tree

src/components/auth/LoginForm/LoginForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const LoginForm: React.FC = () => {
155155
{t('login.noAccount')}
156156
</Auth.Text>
157157
<Link to="/auth/sign-up" style={{ display: 'block', textDecoration: 'none' }}>
158-
<Auth.SecondaryButton type="button" block>
158+
<Auth.SecondaryButton type="default" block>
159159
{t('common.createAccount')}
160160
</Auth.SecondaryButton>
161161
</Link>

src/components/auth/SignUpForm/SignUpForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const SignUpForm: React.FC = () => {
9494
{t('signup.alreadyHaveAccount')}
9595
</Auth.Text>
9696
<Link to="/auth/login" style={{ display: 'block', textDecoration: 'none' }}>
97-
<Auth.SecondaryButton type="button" block>
97+
<Auth.SecondaryButton type="default" block>
9898
{t('common.login')}
9999
</Auth.SecondaryButton>
100100
</Link>

src/components/common/BaseModal/BaseModal.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,9 @@ export const BaseModal: BaseModalInterface = ({
3737
}
3838

3939
// Determine the container based on fullscreen status
40-
const getModalContainer = () => {
41-
// Check if we're in fullscreen mode
42-
if (document.fullscreenElement) {
43-
return document.fullscreenElement as HTMLElement;
44-
}
45-
// Otherwise, render in parent (getContainer={false} means render in parent)
46-
return false;
47-
};
40+
const getModalContainer = document.fullscreenElement
41+
? () => document.fullscreenElement as HTMLElement
42+
: false;
4843

4944
return (
5045
<Modal

src/components/header/components/GithubButton/GitHubButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import React from 'react';
22
import { GithubOutlined } from '@ant-design/icons';
33
import styled from 'styled-components';
4-
import { useAppSelector } from '@app/hooks/reduxHooks';
54
import { BASE_COLORS } from '@app/styles/themes/constants';
65
import { BaseButton as BaseButton } from '@app/components/common/BaseButton/BaseButton';
76

87
export const GitHubButton: React.FC = (props) => {
9-
const theme = useAppSelector((state) => state.theme.theme);
8+
// For liquid-blue theme, use light appearance
9+
const isDark = false;
1010

1111
return (
1212
<Button
1313
type="default"
1414
href="https://github.com/altence/lightence-admin"
1515
icon={<GithubIcon />}
1616
target="_blank"
17-
$isDark={theme === 'dark'}
17+
$isDark={isDark}
1818
{...props}
1919
>
2020
GitHub
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
import React from 'react';
22
import { MoonSunSwitch } from '@app/components/common/MoonSunSwitch/MoonSunSwitch';
3-
import { ThemeType } from '@app/interfaces/interfaces';
4-
import { useAppDispatch, useAppSelector } from '@app/hooks/reduxHooks';
5-
import { setTheme } from '@app/store/slices/themeSlice';
6-
import { setNightMode } from '@app/store/slices/nightModeSlice';
73

84
export const ThemePicker: React.FC = () => {
9-
const dispatch = useAppDispatch();
10-
const theme = useAppSelector((state) => state.theme.theme);
11-
12-
const handleClickButton = (theme: ThemeType) => {
13-
dispatch(setTheme(theme));
14-
dispatch(setNightMode(false));
15-
};
16-
5+
// Only liquid-blue theme is supported - theme switching is disabled
176
return (
187
<MoonSunSwitch
19-
isMoonActive={theme === 'dark'}
20-
onClickMoon={() => handleClickButton('dark')}
21-
onClickSun={() => handleClickButton('light')}
8+
isMoonActive={false}
9+
onClickMoon={() => {}}
10+
onClickSun={() => {}}
2211
/>
2312
);
2413
};

src/components/layouts/main/sider/SiderLogo.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { RightOutlined } from '@ant-design/icons';
44
import { useResponsive } from 'hooks/useResponsive';
55
import logo from 'assets/logo.png';
66
import logoDark from 'assets/logo-dark.png';
7-
import { useAppSelector } from '@app/hooks/reduxHooks';
87

98
interface SiderLogoProps {
109
isSiderCollapsed: boolean;
@@ -13,9 +12,8 @@ interface SiderLogoProps {
1312
export const SiderLogo: React.FC<SiderLogoProps> = ({ isSiderCollapsed, toggleSider }) => {
1413
const { tabletOnly } = useResponsive();
1514

16-
const theme = useAppSelector((state) => state.theme.theme);
17-
18-
const img = theme === 'dark' ? logoDark : logo;
15+
// For liquid-blue theme, use the default logo
16+
const img = logo;
1917

2018
return (
2119
<S.SiderLogoDiv>

src/components/payment/PaymentNotifications/PaymentNotifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export const PaymentNotifications: React.FC<PaymentNotificationsProps> = ({ clas
182182
<BaseRow justify="space-between" align="middle">
183183
<BaseCol>
184184
{notifications.some(n => !n.is_read) && (
185-
<BaseButton type="default" onClick={markAllAsRead}>
185+
<BaseButton type="default" onClick={() => markAllAsRead()}>
186186
{t('payment.notifications.readAll', 'Mark all as read')}
187187
</BaseButton>
188188
)}

src/components/relay-dashboard/Balance/components/SendButton/SendButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import React, { useState } from 'react';
22
import { SendOutlined } from '@ant-design/icons';
33
import * as S from '../TopUpBalanceButton/TopUpBalanceButton.styles';
44
import SendModal from '../SendModal/SendModal';
5-
import { useAppSelector } from '@app/hooks/reduxHooks';
65

76
const SendButton: React.FC = () => {
8-
const { theme } = useAppSelector((state) => state.theme);
97
const [isModalOpen, setIsModalOpen] = useState(false);
108
const handleButtonClick = () => {
119
setIsModalOpen(true);
@@ -16,7 +14,7 @@ const SendButton: React.FC = () => {
1614
return (
1715
<>
1816
<S.TopUpButton
19-
type={theme === 'dark' ? 'ghost' : 'primary'}
17+
type="primary"
2018
block
2119
onClick={handleButtonClick}
2220
icon={<SendOutlined />}

src/components/relay-dashboard/Balance/components/TopUpBalanceButton/TopUpBalanceButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import React, { useState } from 'react';
22
import { DownloadOutlined } from '@ant-design/icons';
33
import { useTranslation } from 'react-i18next';
4-
import { useAppSelector } from '@app/hooks/reduxHooks';
54
import { TopUpBalanceModal } from '../TopUpBalanceModal/TopUpBalanceModal';
65
import * as S from './TopUpBalanceButton.styles';
76

87
export const TopUpBalanceButton: React.FC = () => {
98
const { t } = useTranslation();
10-
const { theme } = useAppSelector((state) => state.theme);
119
const [isModalOpen, setIsModalOpen] = useState(false);
1210

1311
const handleButtonClick = () => {
@@ -25,7 +23,7 @@ export const TopUpBalanceButton: React.FC = () => {
2523
return (
2624
<>
2725
<S.TopUpButton
28-
type={theme === 'dark' ? 'ghost' : 'primary'}
26+
type="primary"
2927
block
3028
onClick={handleButtonClick}
3129
icon={<DownloadOutlined />}

0 commit comments

Comments
 (0)