Skip to content

Commit 661d04b

Browse files
committed
headings
1 parent 730615e commit 661d04b

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

src/components/Onboarding.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { TypographyProps } from '@mui/material'
2+
import { Typography } from '@mui/material'
13
import React from 'react'
24

35
import { useOnBoarding } from '../hooks/index.ts'
@@ -12,11 +14,19 @@ export const Onboarding: React.FC = () => {
1214

1315
return (
1416
<>
17+
<SectionHeadingTypography active={!producerIsReachable}>Start Producer and Copy Seed Phrase</SectionHeadingTypography>
1518
{producerIsReachable ? <RunProducerAlerts.Found /> : <RunProducerAlerts.NotFound />}
1619
{producerIsReachable && <RunProducerAlerts.CopyPhrase />}
20+
<SectionHeadingTypography active={walletIsNotInstalled}>Install and Setup Wallet</SectionHeadingTypography>
1721
{walletIsNotInstalled === true && <WalletAlerts.NotInstalled />}
1822
{walletIsInstalled === true && <WalletAlerts.Installed />}
1923
{walletIsInstalled === true && <WalletAlerts.Setup />}
2024
</>
2125
)
2226
}
27+
28+
export const SectionHeadingTypography: React.FC<TypographyProps & { active?: boolean }> = ({ active, ...props }) => {
29+
return (
30+
<Typography variant="subtitle1" sx={{ opacity: active ? 1 : 0.33 }} {...props} />
31+
)
32+
}

src/components/alerts/CollapsibleAlert.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import {
66
import { isDefined } from '@xylabs/typeof'
77
import React, { useState } from 'react'
88

9-
export const CollapsibleAlert: React.FC<AlertProps & { alertTitle: string }> = ({
9+
export interface CollapsableAlertProps extends AlertProps {
10+
alertTitle?: string
11+
}
12+
13+
export const CollapsibleAlert: React.FC<CollapsableAlertProps> = ({
1014
alertTitle, sx, ...props
1115
}) => {
1216
const [open, setOpen] = useState(true)

src/components/alerts/InstallWalletAlerts.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Stack,
55
} from '@mui/material'
66

7+
import type { CollapsableAlertProps } from './CollapsibleAlert.tsx'
78
import { CollapsibleAlert } from './CollapsibleAlert.tsx'
89

910
const InstallWalletAlert: React.FC<AlertProps> = (props) => {
@@ -30,7 +31,7 @@ const WalletInstalledAlert: React.FC<AlertProps> = (props) => {
3031
)
3132
}
3233

33-
const WalletSetupAlert: React.FC<AlertProps> = (props) => {
34+
const WalletSetupAlert: React.FC<CollapsableAlertProps> = (props) => {
3435
return (
3536
<CollapsibleAlert alertTitle="Wallet Setup Required" severity="info" {...props}>
3637
Once the wallet is installed:

src/components/alerts/RunProducerAlerts.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import { grey } from '@mui/material/colors'
77
import { useState } from 'react'
88

9+
import type { CollapsableAlertProps } from './CollapsibleAlert.tsx'
910
import { CollapsibleAlert } from './CollapsibleAlert.tsx'
1011

1112
const START_COMMAND = 'npm run start-cli'
@@ -65,15 +66,15 @@ const StartProducerAlert: React.FC<AlertProps> = (props) => {
6566
)
6667
}
6768

68-
const ProducerFoundAlert: React.FC<AlertProps> = (props) => {
69+
const ProducerFoundAlert: React.FC<CollapsableAlertProps> = (props) => {
6970
return (
7071
<CollapsibleAlert severity="success" alertTitle="Connected to Local Blockchain" {...props}>
7172
You can now submit transactions to your local XYO Layer One blockchain.
7273
</CollapsibleAlert>
7374
)
7475
}
7576

76-
const CopyProducerPhraseAlert: React.FC<AlertProps> = (props) => {
77+
const CopyProducerPhraseAlert: React.FC<CollapsableAlertProps> = (props) => {
7778
return (
7879
<CollapsibleAlert alertTitle="Copy the Producer Phrase" severity="info" {...props}>
7980
Check the CLI output for the producer seed phrase. You will need this to see balances and submit transactions in your wallet.

0 commit comments

Comments
 (0)