-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from DistributedCollective/fix/active-loan-table
Fix/active loan table
- Loading branch information
Showing
25 changed files
with
1,169 additions
and
76 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
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,15 @@ | ||
/** | ||
* | ||
* Asynchronously loads the component for TutorialDialogModal | ||
* | ||
*/ | ||
|
||
import React from 'react'; | ||
import { lazyLoad } from 'utils/loadable'; | ||
import { PageSkeleton } from 'app/components/PageSkeleton'; | ||
|
||
export const TutorialDialogModal = lazyLoad( | ||
() => import('./index'), | ||
module => module.TutorialDialogModal, | ||
{ fallback: <PageSkeleton /> }, | ||
); |
111 changes: 111 additions & 0 deletions
111
src/app/containers/TutorialDialogModal/component/index.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,111 @@ | ||
import React, { useState } from 'react'; | ||
import { reactLocalStorage } from 'reactjs-localstorage'; | ||
import { useTranslation } from 'react-i18next'; | ||
import background from 'assets/images/tutorial/test.svg'; | ||
import close from 'assets/images/tutorial/close.svg'; | ||
import { translations } from 'locales/i18n'; | ||
import { Screen1 } from './screen1'; | ||
import { Screen2 } from './screen2'; | ||
import { Screen3 } from './screen3'; | ||
import { Screen4 } from './screen4'; | ||
|
||
export function TutorialDialogComponent(props) { | ||
const { t } = useTranslation(); | ||
const [mouseLeave, setMouseLeave] = useState(false); | ||
const activeTutorial = | ||
reactLocalStorage.get('tutorial_active') === 'true' && | ||
props.onNetwork === true | ||
? true | ||
: false; | ||
const [screen, setScreen] = useState(activeTutorial ? 2 : 1); | ||
|
||
function changeScreen(num) { | ||
setScreen(num); | ||
} | ||
|
||
function back() { | ||
screen === 3 ? setScreen(4) : setScreen(1); | ||
} | ||
|
||
return ( | ||
<> | ||
<div | ||
className="wallet-tutorial_container position-absolute mx-auto" | ||
onMouseLeave={() => { | ||
console.log('Mouse out'); | ||
if (screen === 2) { | ||
setMouseLeave(true); | ||
} else { | ||
setMouseLeave(false); | ||
} | ||
}} | ||
> | ||
<div className={`${screen === 2 && 'left'} position-absolute`}> | ||
<div className="background position-relative w-100"> | ||
<img src={background} alt="" className="w-100 h-100" /> | ||
</div> | ||
<div className="close" onClick={props.handleClose}> | ||
<img src={close} alt="close" /> | ||
</div> | ||
{screen !== 1 && ( | ||
<div className="back position-absolute" onClick={() => back()}> | ||
<button>{t(translations.common.back)}</button> | ||
</div> | ||
)} | ||
<div className="title position-absolute"> | ||
<h1> | ||
{t( | ||
translations.rskConnectTutorial.screens[screen.toString()] | ||
.title, | ||
)} | ||
</h1> | ||
</div> | ||
<div className="banner"> | ||
<p> | ||
{t( | ||
translations.rskConnectTutorial.screens[screen.toString()] | ||
.banner, | ||
)}{' '} | ||
{screen === 1 && ( | ||
<a | ||
href="https://metamask.io/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Metamask.io | ||
</a> | ||
)} | ||
{screen !== 1 && ( | ||
<a | ||
href="https://discord.com/invite/J22WS6z" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
https://discord.com/invite/J22WS6z | ||
</a> | ||
)} | ||
</p> | ||
</div> | ||
{/* <Screen3 /> */} | ||
{screen === 1 && ( | ||
<Screen1 | ||
handleClick={changeScreen} | ||
onNetwork={props.onNetwork} | ||
handleEngage={props.handleEngage} | ||
/> | ||
)} | ||
{screen === 2 && ( | ||
<Screen2 | ||
onNetwork={props.onNetwork} | ||
handleEngage={props.handleEngage} | ||
mouseLeave={mouseLeave} | ||
activeTutorial={activeTutorial} | ||
/> | ||
)} | ||
{screen === 3 && <Screen3 />} | ||
{screen === 4 && <Screen4 handleClick={changeScreen} />} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
85 changes: 85 additions & 0 deletions
85
src/app/containers/TutorialDialogModal/component/screen1/index.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,85 @@ | ||
import React from 'react'; | ||
import rectangle from 'assets/images/tutorial/screen1_rectangle.svg'; | ||
import browserIcon from 'assets/images/tutorial/brower_icon.svg'; | ||
import mobileIcon from 'assets/images/tutorial/mobile_icon.svg'; | ||
import hardwareIcon from 'assets/images/tutorial/hardware_icon.svg'; | ||
import badger1 from 'assets/images/tutorial/badger_1.svg'; | ||
import planet from 'assets/images/tutorial/planet.svg'; | ||
import { translations } from 'locales/i18n'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
interface Props { | ||
handleClick: (num: Number) => void; | ||
onNetwork: boolean; | ||
handleEngage: () => void; | ||
} | ||
|
||
export function Screen1(props: Props) { | ||
const { t } = useTranslation(); | ||
|
||
function handleBrowserClick() { | ||
if (props.onNetwork === true) { | ||
props.handleEngage(); | ||
} else { | ||
props.handleClick(2); | ||
} | ||
} | ||
|
||
return ( | ||
<> | ||
<div className="screen1"> | ||
<div className="badger1 position-absolute"> | ||
<img src={badger1} alt="" className="h-100 w-100" /> | ||
</div> | ||
<div className="planet position-absolute"> | ||
<img src={planet} alt="" className="h-100 w-100" /> | ||
</div> | ||
<div className="browser-wallet" onClick={handleBrowserClick}> | ||
<div className="rectangle1"> | ||
<img src={rectangle} alt="" /> | ||
</div> | ||
<div className="browser-icon position-absolute"> | ||
<img | ||
src={browserIcon} | ||
alt="browser wallet icon" | ||
className="h-100 w-100" | ||
/> | ||
</div> | ||
<div className="browser-wallet-text position-absolute"> | ||
<p>{t(translations.rskConnectTutorial.browser_wallet)}t</p> | ||
</div> | ||
</div> | ||
<div className="mobile-wallet" onClick={() => props.handleClick(4)}> | ||
<div className="rectangle2"> | ||
<img src={rectangle} alt="" /> | ||
</div> | ||
<div className="mobile-icon position-absolute"> | ||
<img | ||
src={mobileIcon} | ||
alt="browser wallet icon" | ||
className="h-100 w-100" | ||
/> | ||
</div> | ||
<div className="mobile-wallet-text position-absolute"> | ||
<p>{t(translations.rskConnectTutorial.mobile_wallet)}</p> | ||
</div> | ||
</div> | ||
<div className="hardware-wallet"> | ||
<div className="rectangle3"> | ||
<img src={rectangle} alt="" /> | ||
</div> | ||
<div className="hardware-icon position-absolute"> | ||
<img | ||
src={hardwareIcon} | ||
alt="browser wallet icon" | ||
className="h-100 w-100" | ||
/> | ||
</div> | ||
<div className="hardware-wallet-text position-absolute"> | ||
<p>{t(translations.rskConnectTutorial.hardware_wallet)}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
Oops, something went wrong.