This repository was archived by the owner on Oct 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +52
-1
lines changed
Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import styled from 'styled-components' ;
3+ import { Heading , Paragraph } from 'ts/components/text' ;
4+ import { WebsitePaths } from 'ts/types' ;
5+ import { constants } from 'ts/utils/constants' ;
6+
7+ import { Link } from '../documentation/shared/link' ;
8+
9+ const navData = [
10+ {
11+ title : '0x Docs' ,
12+ description : 'Learn and build with 0x' ,
13+ url : WebsitePaths . Docs ,
14+ } ,
15+ {
16+ title : '(Alpha Release) 0x Docs' ,
17+ description : 'Get a sneak peek at our updated documentation' ,
18+ url : 'https://docs.0x.org/' ,
19+ shouldOpenInNewTab : true ,
20+ } ,
21+ ] ;
22+
23+ export const DropdownDocs : React . FC = ( ) => (
24+ < List >
25+ { navData . map ( ( item , index ) => (
26+ < li key = { `productLink-${ index } ` } >
27+ < Link to = { item . url } shouldOpenInNewTab = { item . shouldOpenInNewTab } >
28+ < Heading asElement = "h3" color = "inherit" isNoMargin = { true } size = "small" >
29+ { item . title }
30+ </ Heading >
31+
32+ { item . description && (
33+ < Paragraph color = "inherit" isNoMargin = { true } size = "small" isMuted = { 0.5 } >
34+ { item . description }
35+ </ Paragraph >
36+ ) }
37+ </ Link >
38+ </ li >
39+ ) ) }
40+ </ List >
41+ ) ;
42+
43+ const List = styled . ul `
44+ a {
45+ padding: 15px 30px;
46+ display: block;
47+ color: inherit;
48+ }
49+ ` ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Link } from 'ts/components/documentation/shared/link';
77import { Button } from 'ts/components/button' ;
88// import { DropdownProducts } from 'ts/components/dropdowns/dropdown_products';
99// import { DropdownResources } from 'ts/components/dropdowns/dropdown_resources';
10+ import { DropdownDocs } from 'ts/components/dropdowns/dropdown_docs' ;
1011import { Hamburger } from 'ts/components/hamburger' ;
1112import { Logo } from 'ts/components/logo' ;
1213import { MobileNav } from 'ts/components/mobile_nav' ;
@@ -41,7 +42,8 @@ const navItems: NavItemProps[] = [
4142 {
4243 id : 'docs' ,
4344 text : 'Developers' ,
44- url : WebsitePaths . Docs ,
45+ dropdownComponent : DropdownDocs ,
46+ dropdownWidth : 270 ,
4547 } ,
4648 {
4749 id : 'zrx' ,
You can’t perform that action at this time.
0 commit comments