Skip to content

Commit 0c600ee

Browse files
committed
Final version
1 parent 3a1937a commit 0c600ee

File tree

3 files changed

+129
-24
lines changed

3 files changed

+129
-24
lines changed

src/components/ReceivePayments.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useState } from 'react';
2-
import { Invoice } from '../app/lightning/invoice';
32
import axios from 'axios';
43

54
const ReceivePayment: React.FC = () => {
@@ -9,7 +8,6 @@ const ReceivePayment: React.FC = () => {
98
const handleGenerateInvoice = async () => {
109
try {
1110
const response = await axios.post('/api/generate-invoice', { amount });
12-
const invoice = response.data.invoice;
1311
setInvoice(response.data.invoice);
1412
} catch (error) {
1513
console.error(error);

src/components/Setting.tsx

+65-22
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
1-
import { IUser } from '../interfaces/user.interface';
1+
// Settings.jsx
22
import React from 'react';
3-
import { Document } from 'mongoose'; // Import Document if you are using mongoose
3+
import styled from 'styled-components';
4+
5+
// Fixed interface import - using IUser instead of User component
6+
// Assuming this is the correct path - adjust if needed
7+
import { IUser } from '../interfaces/user.interface';
48

5-
export interface IUserModel extends IUser, Document {
9+
// If you meant to import the User component, uncomment this and adjust path:
10+
// import User from '../components/User';
11+
12+
// Define the interface properly
13+
export interface IUserModel extends IUser {
614
// Add any additional properties if needed
715
}
816

9-
const Settings: React.FC = () => (
10-
<div className="settings">
11-
<h2>Settings</h2>
12-
<div>
13-
<h3>Network Settings</h3>
14-
<button>Configure Lightning Network Node</button>
15-
<button>Configure Coinjoin</button>
16-
<button>Nostr Backup</button>
17-
<button>Add Relay</button> {/* Fixed typo here */}
18-
</div>
19-
<div>
20-
<h3>Security Settings</h3>
21-
<button>Set PIN/Password</button>
22-
<button>Backup and Recovery</button>
23-
</div>
24-
</div>
25-
);
26-
27-
export default Settings;
17+
// Styled components for better organization
18+
const SettingsContainer = styled.div`
19+
padding: 2rem;
20+
max-width: 800px;
21+
margin: 0 auto;
22+
`;
23+
24+
const Section = styled.div`
25+
margin: 1.5rem 0;
26+
`;
27+
28+
const Title = styled.h2`
29+
color: #333;
30+
margin-bottom: 1rem;
31+
`;
32+
33+
const Subtitle = styled.h3`
34+
color: #555;
35+
margin: 0.5rem 0;
36+
`;
37+
38+
const Button = styled.button`
39+
background-color: #007bff;
40+
color: white;
41+
border: none;
42+
padding: 0.5rem 1rem;
43+
margin: 0.5rem;
44+
border-radius: 4px;
45+
cursor: pointer;
46+
&:hover {
47+
background-color: #0056b3;
48+
}
49+
`;
50+
51+
const Settings = () => {
52+
return (
53+
<SettingsContainer className="settings">
54+
<Title>Settings</Title>
55+
<Section>
56+
<Subtitle>Network Settings</Subtitle>
57+
<Button>Configure Lightning Network Node</Button>
58+
<Button>Configure Coinjoin</Button>
59+
<Button>Nostr Backup</Button>
60+
<Button>Add Relay</Button>
61+
</Section>
62+
<Section>
63+
<Subtitle>Security Settings</Subtitle>
64+
<Button>Set PIN/Password</Button>
65+
<Button>Backup and Recovery</Button>
66+
</Section>
67+
</SettingsContainer>
68+
);
69+
};
2870

71+
export default Settings;

src/components/User.jsx

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Settings.jsx
2+
import React from 'react';
3+
import styled from 'styled-components'; // Added for better styling
4+
5+
// Fixed interface import issues
6+
// Assuming this is the correct path - adjust if needed
7+
import { User } from './User';
8+
9+
10+
// Styled components for better organization
11+
const SettingsContainer = styled.div`
12+
padding: 2rem;
13+
max-width: 800px;
14+
margin: 0 auto;
15+
`;
16+
17+
const Section = styled.div`
18+
margin: 1.5rem 0;
19+
`;
20+
21+
const Title = styled.h2`
22+
color: #333;
23+
margin-bottom: 1rem;
24+
`;
25+
26+
const Subtitle = styled.h3`
27+
color: #555;
28+
margin: 0.5rem 0;
29+
`;
30+
31+
const Button = styled.button`
32+
background-color: #007bff;
33+
color: white;
34+
border: none;
35+
padding: 0.5rem 1rem;
36+
margin: 0.5rem;
37+
border-radius: 4px;
38+
cursor: pointer;
39+
&:hover {
40+
background-color: #0056b3;
41+
}
42+
`;
43+
44+
const Settings = () => {
45+
return (
46+
<SettingsContainer className="settings">
47+
<Title>Settings</Title>
48+
<Section>
49+
<Subtitle>Network Settings</Subtitle>
50+
<Button>Configure Lightning Network Node</Button>
51+
<Button>Configure Coinjoin</Button>
52+
<Button>Nostr Backup</Button>
53+
<Button>Add Relay</Button>
54+
</Section>
55+
<Section>
56+
<Subtitle>Security Settings</Subtitle>
57+
<Button>Set PIN/Password</Button>
58+
<Button>Backup and Recovery</Button>
59+
</Section>
60+
</SettingsContainer>
61+
);
62+
};
63+
64+
export default Settings;

0 commit comments

Comments
 (0)