-
Couldn't load subscription status.
- Fork 274
feat: added wip callout feature #769
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b38e0e7
feat: added wip callout feature
brokewhale e2f8a49
Added Superscan by Routescan
iJaack 470db99
FIx wording
iJaack a37db00
Update words.txt
cpengilly 787a174
content reuse example
sbvegan 15bbcaf
Update notes/content-reuse.md
cpengilly a7c20cd
Apply suggestions from code review
sbvegan 75e868d
Update oracles.mdx
0xmariniere a92e317
lint fixes and heading changes
cpengilly 0f1791a
Update stack-contribute.mdx
cpengilly 7abd58d
fix broken links
cpengilly a3e2796
Update next-sitemap.config.js
cpengilly e2140d9
Update oracles.mdx
cpengilly 35bee74
lint fixes
cpengilly 669758a
content reuse
sbvegan 1d9f2c8
Update notes/content-reuse.md
cpengilly 4196792
Update fp-components.mdx - fix typos
michalsidzej 20405f1
fix: grammar error
michalsidzej fc63048
Update standard-bridge-custom-token.mdx
evanlikn fa6c7fa
Add Chainstack to RPC providers
akegaviar addfde4
Update words.txt
cpengilly 1003674
fix: message test align
brokewhale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,39 @@ | ||
| /** | ||
| * The WipCallout function renders a custom callout component with optional context text for | ||
| * displaying maintenance messages. | ||
| * @param {Props} - The code snippet you provided is a React component named `WipCallout` that | ||
| * renders a special callout message. The component takes an optional prop `context` of type string, | ||
| * which can be used to customize the message displayed in the callout. | ||
| * @returns The WipCallout component is being returned, which is a React element representing a | ||
| * custom callout with a message. The message displayed depends on the value of the `context` prop | ||
| * passed to the component. If `context` is provided, it will display the provided context message. If | ||
| * `context` is not provided, it will display a default maintenance message. | ||
| */ | ||
| import type { ReactElement } from 'react'; | ||
| interface Props { | ||
| context?: string; | ||
| } | ||
| export function WipCallout({ context }: Props): ReactElement { | ||
| return ( | ||
| <div className="custom-callouts nx-w-full nx-mt-6 nx-flex nx-justify-center nx-items-center nx-bg-white dark:nx-bg-black"> | ||
| <div className="nx-w-full nx-px-4 nx-text-center nx-font-medium nx-text-sm nx-text-left"> | ||
| {context ? ( | ||
| context | ||
| ) : ( | ||
| <div className="nx-text-left"> | ||
| Please do not rely on the content of this page as it is currently | ||
| undergoing maintenance. Code samples and solutions may not function | ||
| as expected. Please check back for an update or{' '} | ||
| <a | ||
| href="https://github.com/ethereum-optimism/docs/issues" | ||
| className="callout-link" | ||
| > | ||
| signup to help us revise this page | ||
| </a> | ||
| . We welcome your contribution! ❤️ | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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 @@ | ||
| `op-proposer` is the service that submits the output roots to the L1. This is to enable trustless execution of L2-to-L1 messaging and creates the view into the L2 state from the L1's perspective. | ||
This file contains hidden or 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 @@ | ||
| export { default as OpProposerDescriptionShort } from './OpProposerDescriptionShort.md' |
This file contains hidden or 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,3 @@ | ||
| Please **do not rely** on the content of this page as it is currently undergoing maintenance. **Code samples and solutions may not function as expected.** Please check back for an update or [signup to help us revise this | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| page](https://github.com/ethereum-optimism/docs/labels/tutorial). We welcome | ||
| your contribution! ❤️ | ||
This file contains hidden or 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 hidden or 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,45 @@ | ||
| # Content Reuse | ||
|
|
||
| Content reuse is when you reuse the same piece of content in various places. It means that technical writers don't have to re-write text many times, and it means that the original piece of copy should be easy to locate so that it can be used as often as needed. When changes are made to that original piece of text, it will then be automatically changed wherever else that piece of text is used, which saves a lot of time. | ||
|
|
||
| ## Content Directory | ||
|
|
||
| The content directory contains markdown files that can be imported across the nextra website. | ||
|
|
||
| ## How to Write Reusable Content | ||
|
|
||
| Create a `.md` file in the `/content` directory. | ||
|
|
||
| ### How to Use a Single Reusable Content Components | ||
|
|
||
| 1. Import it at the top of `.mdx` file: | ||
|
|
||
| ``` | ||
brokewhale marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import DescriptionShort from '@/content/DescriptionShort.md' | ||
| ``` | ||
|
|
||
| 1. Use it within the file | ||
|
|
||
| ``` | ||
| Text before | ||
|
|
||
| <OpProposerDescriptionShort /> | ||
|
|
||
| Text after | ||
| ``` | ||
|
|
||
| ### How to Use a Multiple Reusable Content Components | ||
|
|
||
| 1. You can create a `index.js` file in the `content` directories and export | ||
brokewhale marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| the components like this: | ||
|
|
||
| ``` | ||
| export { default as ComponentA } from './ComponentA.md' | ||
| export { default as ComponentB } from './ComponentB.md' | ||
| ``` | ||
|
|
||
| 1. Import it at the top of `.mdx` file: | ||
|
|
||
| ``` | ||
| import {ComponentA, ComponentB} from '@/content/index.js' | ||
| ``` | ||
This file contains hidden or 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 @@ | ||
| ## Wip Callout: Rendering Custom Maintenance Messages | ||
|
|
||
| The WipCallout component is a React functional component designed to render custom callouts for displaying messages about the page. This feature allows you to provide users with important information, including optional context text that makes it dynamic and reusable. | ||
|
|
||
| ## Directory | ||
|
|
||
| You can find the WipCallout component in the `/components` directory. | ||
|
|
||
| ## Behavior | ||
|
|
||
| When imported into a page, this component renders a message at the top of the nested page. It also sticks to the top when scrolling, ensuring users don't miss the important information. To add a different message, simply pass the `context` prop with your intended message. | ||
|
|
||
| ## How to Use Wip Callout | ||
|
|
||
| 1. Import it into your `.mdx` file: | ||
|
|
||
| ```typescript | ||
| import { WipCallout } from '@/components/WipCallout'; | ||
| ``` | ||
|
|
||
| 2. Use it within the file | ||
|
|
||
| ```typescript | ||
| <WipCallout /> // with default message | ||
|
|
||
| <WipCallout context="this tutorial is outdated" /> // with custom message | ||
|
|
||
| // with a custom `.md` file | ||
| import WipMsg from "@/message/WipMsg.md" //import the md file | ||
|
|
||
| <WipCallout context={<WipMsg/>} /> // with custom message | ||
|
|
||
| ``` | ||
|
|
||
| ## Maintenance | ||
|
|
||
| Maintenance of this feature is straightforward. As a simple React component, you can find it located in the `/components` directory. Additionally, the relevant styling for this component can be found in the global CSS file at `/styles/global.css`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.