-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V2 Intro page + some page placeholders (#744)
- Loading branch information
Showing
23 changed files
with
350 additions
and
94 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 |
---|---|---|
@@ -1,14 +1,5 @@ | ||
"use client"; | ||
|
||
import { useStore } from "@/store/useStore"; | ||
|
||
export default function CreateAccount() { | ||
const { network } = useStore(); | ||
|
||
return ( | ||
<div> | ||
Create Account | ||
<div>{`Current network: ${network?.id}`}</div> | ||
</div> | ||
); | ||
return <div>Create Account</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 |
---|---|---|
@@ -1,74 +1,5 @@ | ||
"use client"; | ||
|
||
import { useStore } from "@/store/useStore"; | ||
import { Input, Button, Select } from "@stellar/design-system"; | ||
import { useState } from "react"; | ||
|
||
export default function FundAccount() { | ||
const { | ||
account: { value, update, updateNested, reset }, | ||
} = useStore(); | ||
|
||
const [testValue, setTestValue] = useState(value); | ||
|
||
const handleUpdateNested = (event: any) => { | ||
const val = event.target.value; | ||
let submitValue = { | ||
nestedValue1: "AAA", | ||
nestedValue2: 111, | ||
}; | ||
|
||
if (val === "Two") { | ||
submitValue = { | ||
nestedValue1: "BBB", | ||
nestedValue2: 222, | ||
}; | ||
} | ||
|
||
updateNested(submitValue); | ||
}; | ||
|
||
return ( | ||
<div> | ||
Fund Account | ||
<div> | ||
<div>{`Test value: ${value}`}</div> | ||
|
||
<p>Store value is updated on blur</p> | ||
|
||
<Input | ||
id="test-1" | ||
fieldSize="sm" | ||
value={testValue} | ||
onChange={(event) => setTestValue(event.target.value)} | ||
onBlur={(event) => update(event.target.value)} | ||
label="Value" | ||
/> | ||
|
||
<p>Testing nested object update</p> | ||
|
||
<Select | ||
id="select-1" | ||
fieldSize="sm" | ||
onChange={handleUpdateNested} | ||
label="Nested value" | ||
> | ||
<option></option> | ||
<option value="One">One</option> | ||
<option value="Two">Two</option> | ||
</Select> | ||
|
||
<Button | ||
size="sm" | ||
variant="primary" | ||
onClick={() => { | ||
reset(); | ||
setTestValue(""); | ||
}} | ||
> | ||
Reset | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
return <div>Fund Account</div>; | ||
} |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
"use client"; | ||
|
||
export default function ExploreEndpoints() { | ||
return <div>Explore Endpoints</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,19 @@ | ||
"use client"; | ||
|
||
import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent"; | ||
|
||
export default function ExploreEndpointsTemplate({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<LayoutSidebarContent | ||
sidebar={{ | ||
navItems: [], | ||
}} | ||
> | ||
{children} | ||
</LayoutSidebarContent> | ||
); | ||
} |
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,5 @@ | ||
"use client"; | ||
|
||
export default function SorobanContractExplorer() { | ||
return <div>Soroban Contract Explorer</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,19 @@ | ||
"use client"; | ||
|
||
import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent"; | ||
|
||
export default function TransactionTemplate({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<LayoutSidebarContent | ||
sidebar={{ | ||
navItems: [], | ||
}} | ||
> | ||
{children} | ||
</LayoutSidebarContent> | ||
); | ||
} |
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,5 @@ | ||
"use client"; | ||
|
||
export default function BuildTransaction() { | ||
return <div>Build Transaction</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,5 @@ | ||
"use client"; | ||
|
||
export default function FeeBumpTransaction() { | ||
return <div>Fee Bump Transaction</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,5 @@ | ||
"use client"; | ||
|
||
export default function SignTransaction() { | ||
return <div>Sign Transaction</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,5 @@ | ||
"use client"; | ||
|
||
export default function SimulateTransaction() { | ||
return <div>Simulate Transaction</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,5 @@ | ||
"use client"; | ||
|
||
export default function SubmitTransaction() { | ||
return <div>Submit Transaction</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,41 @@ | ||
"use client"; | ||
|
||
import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent"; | ||
import { Routes } from "@/constants/routes"; | ||
|
||
export default function TransactionTemplate({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<LayoutSidebarContent | ||
sidebar={{ | ||
navItems: [ | ||
{ | ||
route: Routes.BUILD_TRANSACTION, | ||
label: "Build Transaction", | ||
}, | ||
{ | ||
route: Routes.SIGN_TRANSACTION, | ||
label: "Sign Transaction", | ||
}, | ||
{ | ||
route: Routes.SIMULATE_TRANSACTION, | ||
label: "Simulate Transaction", | ||
}, | ||
{ | ||
route: Routes.SUBMIT_TRANSACTION, | ||
label: "Submit Transaction", | ||
}, | ||
{ | ||
route: Routes.FEE_BUMP_TRANSACTION, | ||
label: "Fee Bump", | ||
}, | ||
], | ||
}} | ||
> | ||
{children} | ||
</LayoutSidebarContent> | ||
); | ||
} |
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,29 @@ | ||
"use client"; | ||
|
||
import { LayoutSidebarContent } from "@/components/layout/LayoutSidebarContent"; | ||
import { Routes } from "@/constants/routes"; | ||
|
||
export default function XdrTemplate({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<LayoutSidebarContent | ||
sidebar={{ | ||
navItems: [ | ||
{ | ||
route: Routes.VIEW_XDR, | ||
label: "View XDR", | ||
}, | ||
{ | ||
route: Routes.TO_XDR, | ||
label: "To XDR", | ||
}, | ||
], | ||
}} | ||
> | ||
{children} | ||
</LayoutSidebarContent> | ||
); | ||
} |
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,5 @@ | ||
"use client"; | ||
|
||
export default function ToXdr() { | ||
return <div>To XDR</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,5 @@ | ||
"use client"; | ||
|
||
export default function ViewXdr() { | ||
return <div>View XDR</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 |
---|---|---|
@@ -1,11 +1,114 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import { Card, Link, Text, Button, Icon } from "@stellar/design-system"; | ||
|
||
import { NextLink } from "@/components/NextLink"; | ||
import { LayoutContentContainer } from "@/components/layout/LayoutContentContainer"; | ||
import { Routes } from "@/constants/routes"; | ||
|
||
export default function Introduction() { | ||
const router = useRouter(); | ||
|
||
const infoCards = [ | ||
{ | ||
id: "stellar-quest", | ||
title: "Stellar Quest", | ||
description: | ||
"Learn to build world-class applications on the Stellar network in a gamified experience", | ||
buttonLabel: "Go to site", | ||
buttonIcon: <Icon.LinkExternal01 />, | ||
buttonAction: () => window.open("https://quest.stellar.org/", "_blank"), | ||
}, | ||
{ | ||
id: "tools", | ||
title: "Tools", | ||
description: | ||
"Tools for reading and interacting with Soroban smart contracts on the Stellar Network", | ||
buttonLabel: "See tools", | ||
buttonIcon: undefined, | ||
buttonAction: () => router.push(Routes.SOROBAN_CONTRACT_EXPLORER), | ||
}, | ||
{ | ||
id: "soroban-rpc", | ||
title: "Learn about the Soroban RPC", | ||
description: "Learn about the Soroban RPC, a RPC gateway to Stellar", | ||
buttonLabel: "Go to docs", | ||
buttonIcon: <Icon.LinkExternal01 />, | ||
buttonAction: () => | ||
window.open("https://soroban.stellar.org/docs/reference/rpc", "_blank"), | ||
}, | ||
{ | ||
id: "horizon", | ||
title: "Learn about Horizon", | ||
description: | ||
"Learn about the Horizon for interacting with the Stellar network", | ||
buttonLabel: "Go to docs", | ||
buttonIcon: <Icon.LinkExternal01 />, | ||
buttonAction: () => | ||
window.open("https://developers.stellar.org/api/horizon", "_blank"), | ||
}, | ||
]; | ||
|
||
return ( | ||
<LayoutContentContainer> | ||
<div>Introduction</div> | ||
<Card> | ||
<div className="CardText"> | ||
<Text size="lg" as="h1" weight="medium"> | ||
Stellar Laboratory | ||
</Text> | ||
|
||
<Text size="sm" as="p"> | ||
The Stellar Laboratory is a set of tools that enables people to try | ||
out and learn about the Stellar network. The laboratory can{" "} | ||
<NextLink href={Routes.BUILD_TRANSACTION} sds-variant="primary"> | ||
build transactions | ||
</NextLink> | ||
,{" "} | ||
<NextLink href={Routes.SIGN_TRANSACTION} sds-variant="primary"> | ||
sign them | ||
</NextLink> | ||
, and{" "} | ||
<NextLink href={Routes.SUBMIT_TRANSACTION} sds-variant="primary"> | ||
submit them to the network | ||
</NextLink> | ||
. It can also make requests to any of the Horizon endpoints. | ||
</Text> | ||
|
||
<Text size="sm" as="p"> | ||
For Stellar docs, take a look at the{" "} | ||
<Link href="https://developers.stellar.org/docs"> | ||
Stellar developers site | ||
</Link> | ||
. | ||
</Text> | ||
</div> | ||
</Card> | ||
|
||
<div className="IntroCards"> | ||
{infoCards.map((c) => ( | ||
<Card key={c.id}> | ||
<Text size="md" as="h2" weight="medium"> | ||
{c.title} | ||
</Text> | ||
|
||
<Text size="sm" as="p"> | ||
{c.description} | ||
</Text> | ||
|
||
<div> | ||
<Button | ||
variant="secondary" | ||
size="md" | ||
icon={c.buttonIcon} | ||
onClick={c.buttonAction} | ||
> | ||
{c.buttonLabel} | ||
</Button> | ||
</div> | ||
</Card> | ||
))} | ||
</div> | ||
</LayoutContentContainer> | ||
); | ||
} |
Oops, something went wrong.