-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add label component * Add new configuration to plugin * feat: add new plugin configuration
- Loading branch information
1 parent
039481a
commit c17890f
Showing
12 changed files
with
4,676 additions
and
65 deletions.
There are no files selected for viewing
File renamed without changes.
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,9 @@ | ||
module.exports = { | ||
name: "poc-plugin", | ||
pages: { | ||
"my-account": { | ||
path: "/my-account", | ||
appLayout: false, | ||
}, | ||
}, | ||
}; |
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,21 @@ | ||
import { useSession_unstable as useSession } from "@faststore/core/experimental"; | ||
|
||
type PersonalInfoProps = { | ||
title?: string; | ||
}; | ||
export default function PersonalInfo(props: PersonalInfoProps) { | ||
const session = useSession(); | ||
|
||
return ( | ||
<section> | ||
<h2>{props.title || "Title of Personal Info Section"}</h2> | ||
<h1 style={{ color: "blue", fontSize: 40 }}>{JSON.stringify(session)}</h1> | ||
<dl> | ||
<dt>Name:</dt> | ||
<dd>Placeholder for name</dd> | ||
<dt>Address</dt> | ||
<dd>Placeholder for address</dd> | ||
</dl> | ||
</section> | ||
); | ||
} |
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,14 @@ | ||
import { useSession_unstable as useSession } from "@faststore/core/experimental"; | ||
import Link from "next/link"; | ||
|
||
const ProductDetails = () => { | ||
const session = useSession(); | ||
return ( | ||
<> | ||
<h1 style={{ color: "blue", fontSize: 40 }}>{JSON.stringify(session)}</h1> | ||
<Link href="/">Dashboard</Link> | ||
</> | ||
); | ||
}; | ||
|
||
export default ProductDetails; |
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,9 @@ | ||
import PersonalInfo from "./PersonalInfo/PersonalInfo"; | ||
import ProductDetails from "./ProductDetails/ProductDetails"; | ||
|
||
const sections = { | ||
ProductDetails, | ||
PersonalInfo, | ||
}; | ||
|
||
export default sections; |
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 |
---|---|---|
@@ -1,30 +1,24 @@ | ||
import PersonalInfo from "../sections/personal-info"; | ||
|
||
export const config = { | ||
path: "/my-account", | ||
appLayout: false, | ||
name: "MyAccount", | ||
}; | ||
import PersonalInfo from "../components/PersonalInfo/PersonalInfo"; | ||
|
||
export async function loader() { | ||
const result = await fetch( | ||
`https://pokeapi.co/api/v2/pokemon/${Math.ceil(Math.random() * 150)}`, | ||
{ | ||
method: "GET", | ||
}, | ||
); | ||
const result = await fetch( | ||
`https://pokeapi.co/api/v2/pokemon/${Math.ceil(Math.random() * 150)}`, | ||
{ | ||
method: "GET", | ||
} | ||
); | ||
|
||
return await result.json(); | ||
return await result.json(); | ||
} | ||
|
||
// Como eu passo os dados de um loader para as sections de uma forma que as sections possam ser utilizadas fora dssa página? | ||
export default function MyAccount(data: any) { | ||
return ( | ||
<> | ||
<h1>My Account page</h1> | ||
{data.name} | ||
<img src={data.sprites.front_default} /> | ||
<PersonalInfo /> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<h1>My Account page</h1> | ||
{data.name} | ||
<img src={data.sprites.front_default} /> | ||
<PersonalInfo /> | ||
</> | ||
); | ||
} |
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,37 @@ | ||
// ---------------------------------------------------------- | ||
// GLOBAL TOKENS | ||
// Custom Theme | ||
// ---------------------------------------------------------- | ||
|
||
@layer theme { | ||
.theme { | ||
// -------------------------------------------------------- | ||
// Colors (Branding Core) | ||
// -------------------------------------------------------- | ||
--fs-color-main-0: red; | ||
// -------------------------------------------------------- | ||
// Typography (Branding Core) | ||
// -------------------------------------------------------- | ||
|
||
// -------------------------------------------------------- | ||
// Spacing (UI Essentials) | ||
// -------------------------------------------------------- | ||
|
||
// -------------------------------------------------------- | ||
// Grid & Layout (UI Essentials) | ||
// -------------------------------------------------------- | ||
|
||
// -------------------------------------------------------- | ||
// Interactive Controls (UI Essentials) | ||
// -------------------------------------------------------- | ||
|
||
// -------------------------------------------------------- | ||
// Refinements | ||
// -------------------------------------------------------- | ||
|
||
// -------------------------------------------------------- | ||
// FS UI Components | ||
// -------------------------------------------------------- | ||
// Add here the customizations for FastStore UI components. | ||
} | ||
} |
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
Oops, something went wrong.