Skip to content

Commit

Permalink
Merge pull request #143 from onflow/bastian/example-1.0
Browse files Browse the repository at this point in the history
Update example on front page to 1.0
  • Loading branch information
turbolent authored Sep 6, 2024
2 parents 26790c3 + ebe3e90 commit 5ab792d
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ import learnAnimation from "./learn.json";
import styles from './index.module.css';


const example = `pub resource NFT {
pub fun greet(): String {
return "I'm NFT #"
.concat(self.uuid.toString())
}
const example = `access(all)
resource NFT {
access(all)
fun greet(): String {
return "I'm NFT #"
.concat(self.uuid.toString())
}
}
pub fun main(): String {
let nft <- create NFT()
let greeting = nft.greet()
destroy nft
return greeting
access(all)
fun main(): String {
let nft <- create NFT()
let greeting = nft.greet()
destroy nft
return greeting
}`

function cadence(Prism) {
Expand All @@ -40,7 +44,7 @@ function cadence(Prism) {
greedy: true
},
keyword:
/\b(?:pub|fun|resource|create|let|destroy|return|self)\b/,
/\b(?:access|all|fun|resource|create|let|destroy|return|self)\b/,
'class-name': /\b[A-Z][A-Za-z_\d]*\b/,
function: /\b[a-z_]\w*(?=\s*\()/i,
}
Expand All @@ -58,7 +62,7 @@ function HomepageHeader() {
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>

</div>
</div>
</header>
Expand All @@ -72,7 +76,7 @@ export default function Home() {
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<main>

<div className="content-wrapper">
<div className="feature">
<div>
Expand Down

0 comments on commit 5ab792d

Please sign in to comment.