-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Resource dashboard MVP #14942
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
Resource dashboard MVP #14942
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
f52302c
feat: initialize resource dashboard components and types
wackerow 92ecd3c
chore: commit resource icon assets
wackerow e98aa96
feat: implement resource logos
wackerow efe8464
feat: intl support to /resources
wackerow e67f81e
patch: rename metadata description
wackerow 5a236c5
chore: update og image
wackerow d01f95d
Merge branch 'dev' into dashboard
wackerow 4bb4701
chore: style adjustments
wackerow f32aae3
init: section nav bar
wackerow 9f2ce62
refactor: use BigNumber for demo
wackerow 6466276
feat: create chart components (area, bar, radial)
wackerow cd7d4a5
feat: add block countdown, median tx cost
wackerow 3fb7826
refactor: use displayName prop
wackerow 1f844a3
chore: rm tempBigNumber, replace with comments
wackerow d378b79
feat: add links to github
wackerow 8480af4
patch: remove label prefix
wackerow a9a50bd
patch: description
wackerow d48487f
refactor: extract intl strings
wackerow c8838e5
feat: create useScrollPositionActiveSection hook
wackerow 00d84bf
feat: floating section nav bar
wackerow 75a3b70
feat: add layoutId, fix mobile width
wackerow 9adce52
fix: section links, active styling
wackerow b594c57
refactor: rm Accordions, convert to sections
wackerow c6010d5
ui: clean up trailing cta
wackerow 7bb39ea
fix: ui/link arrow shrink-0
wackerow e587d89
refactor: convert entire row to link
wackerow 606752f
patch: id to kebab case
wackerow 9ee8ac6
copy: update subtitle
wackerow dd7b08e
refactor: use useActiveHash hook
wackerow ee04921
feat: add link to /resources on homepage
wackerow 3055f16
feat: add prod metadata
wackerow 5458f83
patch: adjust "more activity" cta
wackerow 450ca66
feat: import new icon assets
wackerow 919b290
Merge branch 'dev' into dashboard
wackerow 515c550
refactor: resources page for latest intl updates
wackerow 7779f57
feat: add section icons
wackerow c7817ab
chore: use sentence casing
wackerow 4776e18
refactor: mobile nav bar styling
wackerow 2358abe
fix: add x padding
wackerow 915065e
feat: add resources issue template
wackerow 3a1ce17
feat: create adding resource guide
wackerow b88a0c5
fix: icon size 1em
wackerow 6e121a0
chore: update resource icon assets
wackerow 74790b8
build: add 301 convenience redirects
wackerow 7439542
chore: apply suggestions from code review
wackerow 4c2390c
feat: add "new" banner notification
wackerow 5bf2767
feat: add icons to nav bar
wackerow ed57663
Merge branch 'dev' into dashboard
wackerow fa3dc87
fix: hide arrow; URL already explicit
wackerow e1c50d1
fix: trailing slash to fix github paths
wackerow 4e17e10
fix: link contrast when visited
wackerow 3cbe36a
feat: add smooth scrolling to all elements
wackerow 7dc7aba
fix: hideArrow for ResourceItem
wackerow 67b34b5
refactor: use semantic z-index class
wackerow 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,63 @@ | ||
| name: Suggest a resource | ||
| description: Suggest a new resource to list on ethereum.org/resources | ||
| title: Suggest a resource | ||
| labels: ["resource 📚"] | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Before suggesting a resource, make sure you've read [our listing policy](https://www.ethereum.org/en/contributing/adding-resources/). | ||
| - type: markdown | ||
| attributes: | ||
| value: Only continue with the issue if your resource meets the criteria listed there. | ||
| - type: markdown | ||
| attributes: | ||
| value: If it does, complete the following information which we need to accurately list the resource. | ||
| - type: markdown | ||
| id: resource_info | ||
| attributes: | ||
| value: "## Resource info" | ||
| - type: input | ||
| id: resource_name | ||
| attributes: | ||
| label: Name | ||
| description: Please provide the official name of the resource | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| id: resource_url | ||
| attributes: | ||
| label: Resource URL | ||
| description: Please provide a URL to the resource | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: resource_description | ||
| attributes: | ||
| label: Description | ||
| description: Please provide a short 1-2 sentence description of the resource | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: resource_logo | ||
| attributes: | ||
| label: Logo | ||
| description: | | ||
| Please provide an SVG or transparent PNG | ||
| Tip: You can attach images by clicking this area to highlight it and then dragging files in. | ||
| - type: input | ||
| id: resource_category | ||
| attributes: | ||
| label: Category | ||
| description: Please specify a best fit to categorize the resource (e.g., DeFi, NFT, Scaling, etc.) | ||
| - type: checkboxes | ||
| id: resource_work_on | ||
| attributes: | ||
| label: Would you like to work on this issue? | ||
| options: | ||
| - label: "Yes" | ||
| required: false | ||
| - label: "No" | ||
| required: false | ||
| validations: | ||
| required: true |
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,53 @@ | ||
| --- | ||
| title: Adding Resources | ||
| description: The policy we use when adding resources to ethereum.org | ||
| lang: en | ||
| --- | ||
|
|
||
| # Adding Resources {#adding-resources} | ||
|
|
||
| We want to make sure we list the best resources possible while keeping users safe and confident. | ||
|
|
||
| Anyone is free to suggest new resources to add to the resource dashboard on ethereum.org, currently found at [ethereum.org/resources](/resources/). | ||
|
|
||
| Although we welcome new additions, the current resources were chosen based on an experience we're trying to create for our users. These are based on some of our design principles: | ||
|
|
||
| - _Inspirational_: anything on ethereum.org should offer something new to users | ||
| - _A good story_: what's listed should provide an "aha" moment | ||
|
Comment on lines
+15
to
+16
Contributor
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. Not saying we removed it, but this seems less true in dashboards than elsewhere. Perhaps because dashboards is a more 'advanced page' |
||
| - _Credible_: everything should be legitimate businesses/projects to minimize risk to users | ||
|
|
||
| Overall **ethereum.org aims to provide a seamless onboarding experience for new users**. For that reason, we add resources based on their: | ||
|
|
||
| - ease of use | ||
| - accuracy | ||
| - maintenance | ||
|
|
||
| ## The decision framework {#decision-framework} | ||
|
|
||
| ### Criteria {#criteria} | ||
|
|
||
| - **Honest and accurate listing information** - Any suggested listings must come with honest and accurate information. Products that falsify information will be removed. | ||
| - **Active project** – The resource should be maintained by an active team to ensure quality and support for users. Outdated resources are subject to removal. | ||
|
|
||
| ### Product Ordering {#product-ordering} | ||
|
|
||
| We reserve the right to order products based on their impact. New products will generally be added to the bottom of the list unless otherwise specified. | ||
|
|
||
| ## Maintenance {#maintenance} | ||
|
|
||
| As the Ethereum ecosystem evolves, we will routinely check our content to: | ||
|
|
||
| - Ensure that all resources listed still fulfill our criteria | ||
| - Verify there aren't products that have been suggested that meet more of our criteria than the ones currently listed | ||
|
|
||
| You can help with this by checking and letting us know. [Create an issue](https://github.com/ethereum/ethereum-org-website/issues/new?template=bug_report.yaml) or send an email to [website@ethereum.org](mailto:website@ethereum.org). | ||
|
|
||
| --- | ||
|
|
||
| ## Add your resource {#add-your-resource} | ||
|
|
||
| If you want to add a resource to ethereum.org and it meets the criteria, create an issue on GitHub. | ||
|
|
||
| <ButtonLink href="https://github.com/ethereum/ethereum-org-website/issues/new?assignees=&labels=resource+📚&template=suggest_resource.yaml"> | ||
| Create an issue | ||
| </ButtonLink> | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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,138 @@ | ||
| "use client" | ||
|
|
||
| import { FaArrowTrendUp } from "react-icons/fa6" | ||
| import { | ||
| Area, | ||
| AreaChart as RechartsAreaChart, | ||
| CartesianGrid, | ||
| XAxis, | ||
| } from "recharts" | ||
|
|
||
| import { | ||
| Card, | ||
| CardContent, | ||
| CardDescription, | ||
| CardFooter, | ||
| CardHeader, | ||
| CardTitle, | ||
| } from "@/components/ui/card" | ||
| import { | ||
| ChartConfig, | ||
| ChartContainer, | ||
| ChartTooltip, | ||
| ChartTooltipContent, | ||
| } from "@/components/ui/chart" | ||
|
|
||
| type AreaChartDataPoint = { xValue: string; yValue: number } | ||
|
|
||
| /** | ||
| * AreaChartProps defines the properties for the AreaChart component. | ||
| * | ||
| * @property {AreaChartDataPoint[]} data - The data to be displayed in the chart. Each object should have an `xValue` and `yValue` property. | ||
| * @property {string} [title] - The title of the chart. | ||
| * @property {string} [description] - The description of the chart. | ||
| * @property {string} [footerText] - The footer text of the chart. | ||
| * @property {string} [footerSubText] - The footer subtext of the chart. | ||
| */ | ||
| type AreaChartProps = { | ||
| data: AreaChartDataPoint[] | ||
| title?: string | ||
| description?: string | ||
| footerText?: string | ||
| footerSubText?: string | ||
| } | ||
|
|
||
| const defaultChartConfig = { | ||
| value: { | ||
| label: "Value", | ||
| color: "hsl(var(--accent-a))", | ||
| }, | ||
| } satisfies ChartConfig | ||
|
|
||
| /** | ||
| * AreaChart component renders an area chart with the provided data and optional title, description, footer text, and footer subtext. | ||
| * | ||
| * @param {AreaChartProps} props - The properties for the AreaChart component. | ||
| * @returns {JSX.Element} The rendered AreaChart component. | ||
| */ | ||
| export function AreaChart({ | ||
| data, | ||
| title, | ||
| description, | ||
| footerText, | ||
| footerSubText, | ||
| }: AreaChartProps) { | ||
| return ( | ||
| <Card> | ||
| <CardHeader> | ||
| {title && <CardTitle>{title}</CardTitle>} | ||
| {description && <CardDescription>{description}</CardDescription>} | ||
| </CardHeader> | ||
| <CardContent> | ||
| <ChartContainer config={defaultChartConfig}> | ||
| <RechartsAreaChart | ||
| accessibilityLayer | ||
| data={data} | ||
| margin={{ | ||
| left: 12, | ||
| right: 12, | ||
| top: 12, | ||
| bottom: 12, | ||
| }} | ||
| > | ||
| <CartesianGrid vertical={false} /> | ||
| <XAxis | ||
| dataKey="xValue" | ||
| tickLine={false} | ||
| axisLine={false} | ||
| tick={false} | ||
| tickMargin={8} | ||
| tickFormatter={(value) => value.slice(0, 3)} | ||
| /> | ||
| <ChartTooltip cursor={false} content={<ChartTooltipContent />} /> | ||
| <defs> | ||
| <linearGradient id="fillValue" x1="0" y1="0" x2="0" y2="1"> | ||
| <stop | ||
| offset="5%" | ||
| stopColor="hsl(var(--accent-a))" | ||
| stopOpacity={1} | ||
| /> | ||
| <stop | ||
| offset="95%" | ||
| stopColor="hsl(var(--accent-a))" | ||
| stopOpacity={0.5} | ||
| /> | ||
| </linearGradient> | ||
| </defs> | ||
| <Area | ||
| dataKey="yValue" | ||
| type="natural" | ||
| fill="url(#fillValue)" | ||
| fillOpacity={0.4} | ||
| stroke="var(--color-value)" | ||
| stackId="a" | ||
| /> | ||
| </RechartsAreaChart> | ||
| </ChartContainer> | ||
| </CardContent> | ||
| {(footerText || footerSubText) && ( | ||
| <CardFooter> | ||
| <div className="flex w-full items-start gap-2 text-sm"> | ||
| <div className="grid gap-2"> | ||
| {footerText && ( | ||
| <div className="flex items-center gap-2 font-medium leading-none"> | ||
| {footerText} <FaArrowTrendUp className="h-4 w-4" /> | ||
| </div> | ||
| )} | ||
| {footerSubText && ( | ||
| <div className="text-muted-foreground flex items-center gap-2 leading-none"> | ||
| {footerSubText} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </CardFooter> | ||
| )} | ||
| </Card> | ||
| ) | ||
| } |
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,120 @@ | ||
| "use client" | ||
|
|
||
| import { FaArrowTrendUp } from "react-icons/fa6" | ||
| import { | ||
| Bar, | ||
| BarChart as RechartsBarChart, | ||
| CartesianGrid, | ||
| XAxis, | ||
| } from "recharts" | ||
|
|
||
| import { | ||
| Card, | ||
| CardContent, | ||
| CardDescription, | ||
| CardFooter, | ||
| CardHeader, | ||
| CardTitle, | ||
| } from "@/components/ui/card" | ||
| import { | ||
| ChartConfig, | ||
| ChartContainer, | ||
| ChartTooltip, | ||
| ChartTooltipContent, | ||
| } from "@/components/ui/chart" | ||
|
|
||
| type BarChartDataPoint = { category: string; value: number } | ||
|
|
||
| /** | ||
| * BarChartProps defines the properties for the BarChart component. | ||
| * | ||
| * @property {BarChartItem[]} data - The data to be displayed in the chart. Each object should have a `category` and `value` property. | ||
| * @property {string} [title] - The title of the chart. | ||
| * @property {string} [description] - The description of the chart. | ||
| * @property {string} [footerText] - The footer text of the chart. | ||
| * @property {string} [footerSubText] - The footer subtext of the chart. | ||
| */ | ||
| type BarChartProps = { | ||
| data: BarChartDataPoint[] | ||
| title?: string | ||
| description?: string | ||
| footerText?: string | ||
| footerSubText?: string | ||
| } | ||
|
|
||
| const defaultChartConfig = { | ||
| value: { | ||
| label: "Value", | ||
| color: "hsl(var(--accent-a))", | ||
| }, | ||
| } satisfies ChartConfig | ||
|
|
||
| /** | ||
| * BarChart component renders a bar chart with the provided data and optional title, description, footer text, and footer subtext. | ||
| * | ||
| * @param {BarChartProps} props - The properties for the BarChart component. | ||
| * @returns {JSX.Element} The rendered BarChart component. | ||
| */ | ||
| export function BarChart({ | ||
| data, | ||
| title, | ||
| description, | ||
| footerText, | ||
| footerSubText, | ||
| }: BarChartProps) { | ||
| return ( | ||
| <Card> | ||
| <CardHeader> | ||
| {title && <CardTitle>{title}</CardTitle>} | ||
| {description && <CardDescription>{description}</CardDescription>} | ||
| </CardHeader> | ||
| <CardContent> | ||
| <ChartContainer config={defaultChartConfig}> | ||
| <RechartsBarChart | ||
| accessibilityLayer | ||
| data={data} | ||
| margin={{ | ||
| left: 12, | ||
| right: 12, | ||
| top: 12, | ||
| bottom: 12, | ||
| }} | ||
| > | ||
| <CartesianGrid vertical={false} /> | ||
| <XAxis | ||
| dataKey="category" | ||
| tickLine={false} | ||
| axisLine={false} | ||
| tickMargin={8} | ||
| /> | ||
| <ChartTooltip cursor={false} content={<ChartTooltipContent />} /> | ||
| <Bar | ||
| dataKey="value" | ||
| fill="hsl(var(--accent-a))" | ||
| barSize={16} | ||
| radius={[8, 8, 0, 0]} | ||
| /> | ||
| </RechartsBarChart> | ||
| </ChartContainer> | ||
| </CardContent> | ||
| {(footerText || footerSubText) && ( | ||
| <CardFooter> | ||
| <div className="flex w-full items-start gap-2 text-sm"> | ||
| <div className="grid gap-2"> | ||
| {footerText && ( | ||
| <div className="flex items-center gap-2 font-medium leading-none"> | ||
| {footerText} <FaArrowTrendUp className="h-4 w-4" /> | ||
| </div> | ||
| )} | ||
| {footerSubText && ( | ||
| <div className="text-muted-foreground flex items-center gap-2 leading-none"> | ||
| {footerSubText} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </CardFooter> | ||
| )} | ||
| </Card> | ||
| ) | ||
| } |
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.
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.
@nloureiro any thoughts on what we should call this page? resources doesnt seem right, but @wackerow mentioned that he feels the same about ethereum.org 'dashboard'
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.
Yeah, would suggest perhaps a redirect from
/dashboards/-301->/resources/if we want to use that