-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated onboarding #4
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import clsx from 'clsx'; | ||
import styles from './styles.module.css'; | ||
import React from 'react'; | ||
|
||
|
||
import OutwardArrowIcon from '@site/static/img/icons/outward_arrow.svg' | ||
import InfoIcon from '@site/static/img/icons/info.svg' | ||
import CodeIcon from '@site/static/img/icons/code.svg' | ||
import OpenBookIcon from '@site/static/img/icons/open_book.svg' | ||
|
||
const advantageItems = [ | ||
{ | ||
title: 'Lowest Borrow Rates.', | ||
}, | ||
{ | ||
title: 'More assets, higher LTVs.', | ||
}, | ||
{ | ||
title: 'Fixed rates for fixed terms.', | ||
}, | ||
]; | ||
|
||
function AdvantageContent(advantageItem) { | ||
const { title } = advantageItem; | ||
return ( | ||
<div className={clsx('card')}> | ||
<div className={clsx('card__body')}> | ||
<div className={clsx(styles.advantageHeader)}> | ||
<div> | ||
<InfoIcon className={clsx(styles.advantageIcon)} role="img" /> | ||
<div></div> | ||
</div> | ||
<h4>{title}</h4> | ||
</div> | ||
</div> | ||
</div > | ||
) | ||
} | ||
|
||
function Advantage(advantageItem) { | ||
return ( | ||
<div className={clsx('col col--4 ')}> | ||
<AdvantageContent {...advantageItem} /> | ||
</div > | ||
) | ||
}; | ||
Comment on lines
+40
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use destructuring for function parameters. The Apply this diff to use destructuring: -function Advantage(advantageItem) {
+function Advantage({ title }) {
|
||
export default function Advantages() { | ||
return ( | ||
<section> | ||
<div className="container"> | ||
<div className="row"> | ||
{advantageItems.map((props, idx) => ( | ||
<Advantage key={idx} {...props} /> | ||
))} | ||
</div> | ||
</div> | ||
</section > | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,47 @@ import React from 'react'; | |
|
||
import OutwardArrowIcon from '@site/static/img/icons/outward_arrow.svg' | ||
import InfoIcon from '@site/static/img/icons/info.svg' | ||
import CodeIcon from '@site/static/img/icons/code.svg' | ||
import XLogo from "@site/static/img/x_logo.svg"; | ||
import DiscordLogo from "@site/static/img/discord_logo.svg"; | ||
import AppLogo from "@site/static/img/app_logo.svg"; | ||
import OpenBookIcon from '@site/static/img/icons/open_book.svg' | ||
|
||
|
||
|
||
const featureItems = [ | ||
{ | ||
title: 'Stay Updated', | ||
Icon: XLogo, | ||
description: ( | ||
<> | ||
Follow us on Twitter to get the most recent updates on product, partnerships, and opportunties on Loopscale! | ||
</> | ||
), | ||
external_url: "https://x.com/LoopscaleLabs", | ||
disabled: false | ||
}, | ||
{ | ||
title: 'Access Alpha', | ||
Icon: DiscordLogo, | ||
description: ( | ||
<> | ||
Jump in the Discord to ask questions, learn about the future of the Loopscale ecosystem, and more. | ||
</> | ||
), | ||
external_url: "https://discord.gg/loopscale", | ||
disabled: false | ||
}, | ||
{ | ||
title: 'Use Loopscale', | ||
Icon: AppLogo, | ||
description: ( | ||
<> | ||
Jump on the app and start lending or borrowing. Rack up points to stay as far ahead as you can. | ||
</> | ||
), | ||
external_url: "https://app.loopscale.com", | ||
disabled: false | ||
}, | ||
{ | ||
title: 'What is Loopscale', | ||
Icon: InfoIcon, | ||
|
@@ -31,20 +66,7 @@ const featureItems = [ | |
</> | ||
), | ||
slug: "/user-guides/create-an-account", | ||
disabled: true | ||
|
||
}, | ||
{ | ||
title: 'Loopscale Protocol', | ||
Icon: CodeIcon, | ||
description: ( | ||
<> | ||
Learn about the architecture of the Loopscale Protocol smart contracts through guided examples. | ||
</> | ||
), | ||
slug: "/protocol", | ||
disabled: true | ||
|
||
disabled: false | ||
}, | ||
]; | ||
function Tag({ text }) { | ||
|
@@ -69,23 +91,29 @@ function FeatureContent(featureItem) { | |
|
||
function Feature(featureItem) { | ||
const { slug, disabled } = featureItem; | ||
const colSize = featureItem.small ? 'col col--4 ' : 'col col--6 '; | ||
return ( | ||
<div className={clsx('col col--4 ')}> | ||
<div className={clsx(colSize)}> | ||
Comment on lines
+94
to
+96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use destructuring for function parameters. The Apply this diff to use destructuring: -function Feature(featureItem) {
- const { slug, disabled } = featureItem;
+function Feature({ slug, disabled, small }) {
|
||
{ | ||
disabled ? <FeatureContent {...featureItem} /> : | ||
<a target="_self" href={slug}><FeatureContent {...featureItem} /></a> | ||
|
||
} | ||
</div > | ||
) | ||
}; | ||
|
||
export default function Features() { | ||
return ( | ||
<section> | ||
<div className="container"> | ||
<div className="row"> | ||
{featureItems.map((props, idx) => ( | ||
<Feature key={idx} {...props} /> | ||
{featureItems.slice(0,3).map((props, idx) => ( | ||
<Feature key={idx} {...{...props, small: true}} /> | ||
))} | ||
</div> | ||
<div className="row"> | ||
{featureItems.slice(3,5).map((props, idx) => ( | ||
<Feature key={idx} {...{...props, small: false}} /> | ||
))} | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,44 @@ | ||||||||||||||||||
import clsx from 'clsx'; | ||||||||||||||||||
import styles from './styles.module.css'; | ||||||||||||||||||
import React from 'react'; | ||||||||||||||||||
import connect from "@site/static/img/docs/onboarding-cards/connect.png" | ||||||||||||||||||
import points from "@site/static/img/docs/onboarding-cards/points.png" | ||||||||||||||||||
import borrow from "@site/static/img/docs/onboarding-cards/borrow.png" | ||||||||||||||||||
import OutwardArrowIcon from '@site/static/img/icons/outward_arrow.svg' | ||||||||||||||||||
|
||||||||||||||||||
const onboardingSteps = [ | ||||||||||||||||||
{ | ||||||||||||||||||
imgPath: connect, | ||||||||||||||||||
}, | ||||||||||||||||||
{ | ||||||||||||||||||
imgPath: points | ||||||||||||||||||
}, | ||||||||||||||||||
{ | ||||||||||||||||||
imgPath: borrow | ||||||||||||||||||
}, | ||||||||||||||||||
] | ||||||||||||||||||
|
||||||||||||||||||
const OnboardingStep = (stepDetails) => { | ||||||||||||||||||
const { imgPath } = stepDetails; | ||||||||||||||||||
|
||||||||||||||||||
return ( | ||||||||||||||||||
<div className={clsx('card', styles.product)}> | ||||||||||||||||||
<OutwardArrowIcon className={clsx(styles.productArrowIcon)} role="img" /> | ||||||||||||||||||
<img src={imgPath} className={clsx(styles.productImage)} /> | ||||||||||||||||||
</div> | ||||||||||||||||||
) | ||||||||||||||||||
}; | ||||||||||||||||||
|
||||||||||||||||||
export default function GettingStarted() { | ||||||||||||||||||
return ( | ||||||||||||||||||
<div className="container"> | ||||||||||||||||||
<div className="row"> | ||||||||||||||||||
{onboardingSteps.map(productItem => | ||||||||||||||||||
<div className={clsx('col col--4')}> | ||||||||||||||||||
<OnboardingStep {...productItem} /> | ||||||||||||||||||
</div>) | ||||||||||||||||||
Comment on lines
+36
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a key property to the iterable. The Apply this diff to add the key property: {onboardingSteps.map((productItem, index) =>
<div className={clsx('col col--4')} key={index}>
<OnboardingStep {...productItem} />
</div>)
} Committable suggestion
Suggested change
ToolsBiome
|
||||||||||||||||||
} | ||||||||||||||||||
</div> | ||||||||||||||||||
</div> | ||||||||||||||||||
); | ||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export { default as Home } from '@site/src/js-components/Home.js'; | ||
export { default as Resources } from '@site/src/js-components/Resources.js'; | ||
export { default as Products } from '@site/src/js-components/Products.js'; | ||
|
||
export { default as GettingStarted } from "@site/src/js-components/GettingStarted.js"; | ||
export { default as Advantages } from '@site/src/js-components/Advantages.js'; | ||
export { default as Features } from '@site/src/js-components/Features.js'; | ||
export * from '@site/src/js-components/inline.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use destructuring for function parameters.
The
AdvantageContent
function can use destructuring directly in the parameter list for cleaner code.Apply this diff to use destructuring:
Committable suggestion