Skip to content

Commit

Permalink
fix good front practices
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienFT committed May 13, 2024
1 parent 8af71ee commit ebe20fd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ module.exports = {
plugins: ['html', 'import'],
rules: {
'no-console': 'off',
camelcase: 'warn',
},
};
5 changes: 2 additions & 3 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import { MNSManagement } from './components/MNSManagement';
const faqData: FAQData[] = [
{
question: 'What is Massa Name Service ?',
answer:
'Massa Name Service is a decentralized naming protocol that allows users to register a human-readable name for their Massa address. This name can be used to send and receive Massa, and to interact with smart contracts and dApps.',
answer: 'Massa Name Service is a decentralized naming ...',
},
{
question: 'How do I register a name ?',
answer:
'To register a name, you must connect your wallet and search for an available name. If the name is available, you can register it for a fee.',
'To register a name, you must connect your wallet and search for an available name...',
},
];

Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export interface FAQData {
answer: string;
}

export function FAQ({ data }: { data: FAQData[] }) {
interface FAQProps {
data: FAQData[];
}

export function FAQ(props: FAQProps) {
const { data } = props;
if (!data) return null;
return (
<>
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/components/MNSManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { useAccountStore } from '../lib/connectMassaWallets/store';
import { MNSClaim } from './MNSClaim';
import { MNSList } from './MNSList';

export function MNSManagement({ customClass }: { customClass?: string }) {
interface MNSManagementProps {
customClass?: string;
}

export function MNSManagement(props: MNSManagementProps) {
const { customClass } = props;
const { connectedAccount, currentProvider } = useAccountStore();

const connected = !!connectedAccount && !!currentProvider;
Expand All @@ -15,7 +20,7 @@ export function MNSManagement({ customClass }: { customClass?: string }) {
</h2>
</div>
) : (
<div className="grid grid-cols-1 divide-y">
<div className="flex flex-col divide-y">
<MNSClaim />
<MNSList />
</div>
Expand Down

0 comments on commit ebe20fd

Please sign in to comment.