Skip to content

Commit

Permalink
Update onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
olehmell committed Dec 7, 2023
1 parent ed57aef commit 1888865
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import Spaces from './steps/Spaces'
import Topics from './steps/Topics'
import { OnBoardingContentProps, OnBoardingModalProps } from './types'

const HOW_TO_GET_SUB_URL = 'https://docs.subsocial.network/docs/tutorials/get-sub'

const steps: {
[key in keyof OnBoardingDataTypes]: {
title: string | JSX.Element
Expand All @@ -58,7 +60,7 @@ const steps: {
energy: {
content: Energy,
title: '⚡ Energy',
subtitle: `Energy allows you to use ${config.appName}. You can create energy here by burning SUB or get a small amount of energy for free (only for new users), allowing you to start posting without getting tokens.`,
subtitle: <>Energy allows you to use {config.appName}. You can create energy here by burning SUB. <a href={HOW_TO_GET_SUB_URL} target='_blank' rel='noreferrer' /></>,
},
signer: {
content: Signer,
Expand Down
23 changes: 11 additions & 12 deletions src/components/onboarding/OnBoardingModal/steps/Energy/Energy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Tabs } from 'antd'
import { useState } from 'react'
import { useAuth } from 'src/components/auth/AuthContext'
import EnergyDiscordInstruction from 'src/components/energy/EnergyDiscordInstruction'
// import EnergyDiscordInstruction from 'src/components/energy/EnergyDiscordInstruction'
import EnergyForm from 'src/components/energy/EnergyForm'
import {
useOnBoardingData,
Expand All @@ -19,15 +19,14 @@ const getTabKey = (key: Tabs) => key

export default function Energy({ ...props }: OnBoardingContentProps) {
const {
balance,
energy: { status },
} = useAuth()
const openState = useOnBoardingModalOpenState()
const [selectedTab, setSelectedTab] = useState<Tabs>(
!balance.isZero() ? 'burn-sub' : 'free-energy',
'burn-sub' // !balance.isZero() ? 'burn-sub' : 'free-energy',
)
const [isDisabled, setIsDisabled] = useState(false)
const [isDiscordLinkClicked, setIsDiscordLinkClicked] = useState(false)
// const [isDiscordLinkClicked, setIsDiscordLinkClicked] = useState(false)

const inputtedSubAmt = useOnBoardingData('energy')
const saveInputtedSubAmt = useSaveOnBoardingData('energy')
Expand All @@ -45,7 +44,7 @@ export default function Energy({ ...props }: OnBoardingContentProps) {
<OnBoardingContentContainer
{...props}
disableSubmitBtn={disableSubmitBtn}
loadingSubmitBtn={isDiscordLinkClicked && disableSubmitBtn}
// loadingSubmitBtn={isDiscordLinkClicked && disableSubmitBtn}
hideSubmitBtn={withoutSubmitButton}
>
<div className={styles.Energy}>
Expand All @@ -68,13 +67,13 @@ export default function Energy({ ...props }: OnBoardingContentProps) {
}}
/>
</TabPane>
<TabPane tab='Get Free Energy' key={getTabKey('free-energy')}>
<EnergyDiscordInstruction
withWaitStep
className='FontNormal'
onDiscordLinkClick={() => setIsDiscordLinkClicked(true)}
/>
</TabPane>
{/*<TabPane tab='Get Free Energy' key={getTabKey('free-energy')}>*/}
{/* <EnergyDiscordInstruction*/}
{/* withWaitStep*/}
{/* className='FontNormal'*/}
{/* onDiscordLinkClick={() => setIsDiscordLinkClicked(true)}*/}
{/* />*/}
{/*</TabPane>*/}
</Tabs>
</div>
</OnBoardingContentContainer>
Expand Down

0 comments on commit 1888865

Please sign in to comment.