Skip to content

Commit e5abbc6

Browse files
committed
Add reset button to Push Notifications panel with proper layout and white text styling
1 parent caad4a2 commit e5abbc6

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

src/components/settings/panels/PushNotificationPanel.tsx

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,27 @@ import React, { useEffect, useState } from 'react';
22
import { Form, Input, InputNumber, Switch, Tooltip, Alert, Spin, Divider, Button } from 'antd';
33
import {
44
QuestionCircleOutlined,
5-
SaveOutlined
5+
SaveOutlined,
6+
RedoOutlined
67
} from '@ant-design/icons';
78
import useGenericSettings from '@app/hooks/useGenericSettings';
89
import { SettingsGroupType } from '@app/types/settings.types';
910
import { LiquidBlueButton } from '@app/components/common/LiquidBlueButton';
1011

12+
const defaultPushSettings = {
13+
enabled: false,
14+
service_worker_count: 10,
15+
service_queue_size: 1000,
16+
service_retry_attempts: 3,
17+
service_retry_delay: '1s',
18+
service_batch_size: 100,
19+
apns_enabled: false,
20+
apns_key_path: '',
21+
apns_bundle_id: '',
22+
fcm_enabled: false,
23+
fcm_credentials_path: ''
24+
};
25+
1126
const PushNotificationPanel: React.FC = () => {
1227
const {
1328
settings,
@@ -73,6 +88,12 @@ const PushNotificationPanel: React.FC = () => {
7388
}
7489
};
7590

91+
const handleReset = () => {
92+
form.setFieldsValue(defaultPushSettings);
93+
updateSettings(defaultPushSettings);
94+
setIsUserEditing(true);
95+
};
96+
7697
return (
7798
<>
7899
{error && (
@@ -356,14 +377,27 @@ const PushNotificationPanel: React.FC = () => {
356377
/>
357378
</Form.Item>
358379

359-
{/* Save Button at bottom like other sections */}
380+
{/* Reset and Save Buttons at bottom */}
360381
<Form.Item style={{ marginTop: '2rem', marginBottom: 0 }}>
361382
<div style={{
362383
display: 'flex',
363384
justifyContent: 'flex-end',
385+
gap: '0.5rem',
364386
paddingTop: '1rem',
365387
borderTop: '1px solid rgba(82, 196, 255, 0.2)'
366388
}}>
389+
<Button
390+
icon={<RedoOutlined />}
391+
onClick={handleReset}
392+
disabled={loading || saveLoading}
393+
style={{
394+
background: 'transparent',
395+
border: '1px solid rgba(255, 255, 255, 0.2)',
396+
color: '#ffffff'
397+
}}
398+
>
399+
Reset
400+
</Button>
367401
<LiquidBlueButton
368402
variant="primary"
369403
icon={<SaveOutlined />}

0 commit comments

Comments
 (0)