-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add onboarding automation steps (#111)
* feat: add onboarding automation steps * fix: add children to StepBody
- Loading branch information
1 parent
ad706f3
commit 625a638
Showing
10 changed files
with
255 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"title": "Automation wallet state", | ||
"subtitle": "Quickly verify if your automation wallet is active and funded", | ||
"body": "From the contextual menu under the automation icon on the menubar, you'll be able to enable/disable the automation.\n\nYou can quickly asses the automation wallet state by looking at the icon:\n\n- the automation is enabled if the icon has a colored background\n\n- the wallet is completely funded if the top right indicator is green, partially funded if the indicator is yellow, and insufficient funded if the indicator is red.", | ||
"image": "/images/onboarding/automation_wallet_state.png" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"title": "Activate Automation", | ||
"subtitle": "Activate the assets consumption automation", | ||
"body": "Click on the button to import the wallet you want to use for the automation, you will be asked to provide the encrypted json file and the password to unlock it.", | ||
"image": "/images/onboarding/automation_wallet_import.png", | ||
"buttonLabel": "Import Wallet Json", | ||
"buttonSuccess": "Wallet Imported Successfully" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/components/@shared/Onboarding/Steps/AutomationWalletState.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, { ReactElement } from 'react' | ||
import { OnboardingStep } from '..' | ||
import StepBody from '../StepBody' | ||
import StepHeader from '../StepHeader' | ||
import content from '../../../../../content/onboarding/steps/automationWalletState.json' | ||
|
||
export default function AutomationWalletState(): ReactElement { | ||
const { title, subtitle, body, image }: OnboardingStep = content | ||
|
||
return ( | ||
<div> | ||
<StepHeader title={title} subtitle={subtitle} /> | ||
<StepBody body={body} image={image} /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { ReactElement, useEffect, useState } from 'react' | ||
import { OnboardingStep } from '..' | ||
import StepBody from '../StepBody' | ||
import StepHeader from '../StepHeader' | ||
import content from '../../../../../content/onboarding/steps/importAutomationWallet.json' | ||
import Import from '@components/Header/UserPreferences/Automation/Import' | ||
import { useAutomation } from '@context/Automation/AutomationProvider' | ||
import Decrypt from '@components/Header/UserPreferences/Automation/Decrypt' | ||
import Alert from '@components/@shared/atoms/Alert' | ||
|
||
export default function ImportWallet(): ReactElement { | ||
const { title, subtitle, body, image }: OnboardingStep = content | ||
const { autoWallet, hasValidEncryptedWallet } = useAutomation() | ||
const [needsImport, setNeedsImport] = useState<boolean>( | ||
!hasValidEncryptedWallet | ||
) | ||
|
||
useEffect(() => { | ||
setNeedsImport(!hasValidEncryptedWallet) | ||
}, [hasValidEncryptedWallet]) | ||
|
||
return ( | ||
<div> | ||
<StepHeader title={title} subtitle={subtitle} /> | ||
<StepBody body={body} image={image}> | ||
{autoWallet ? ( | ||
<Alert text={content.buttonSuccess} state="success" /> | ||
) : needsImport ? ( | ||
<Import /> | ||
) : ( | ||
<Decrypt /> | ||
)} | ||
</StepBody> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters