|
| 1 | +import React from 'react'; |
| 2 | +import Head from 'next/head'; |
| 3 | +import App from 'next/app'; |
| 4 | + |
| 5 | +import 'react-tabs/style/react-tabs.css'; |
| 6 | + |
| 7 | +class CustomApp extends App { |
| 8 | + // Only uncomment this method if you have blocking data requirements for |
| 9 | + // every single page in your application. This disables the ability to |
| 10 | + // perform automatic static optimization, causing every page in your app to |
| 11 | + // be server-side rendered. |
| 12 | + // |
| 13 | + // static async getInitialProps(appContext) { |
| 14 | + // // calls page's `getInitialProps` and fills `appProps.pageProps` |
| 15 | + // const appProps = await App.getInitialProps(appContext); |
| 16 | + // |
| 17 | + // return { ...appProps } |
| 18 | + // } |
| 19 | + |
| 20 | + render() { |
| 21 | + const { Component, pageProps } = this.props; |
| 22 | + const pageName = this.props.router.route.substr(1); |
| 23 | + let title = ''; |
| 24 | + if (pageName === '') { |
| 25 | + title = 'react-native-csv'; |
| 26 | + } else if (pageName === 'demo') { |
| 27 | + title = 'Demo'; |
| 28 | + } else if (pageName === 'docs') { |
| 29 | + title = 'Documentation'; |
| 30 | + } |
| 31 | + return ( |
| 32 | + <div> |
| 33 | + <Head> |
| 34 | + <title> {`${title} - Powerful CSV Parser for React`}</title> |
| 35 | + <link rel="shortcut icon" type="image/x-icon" href="" /> |
| 36 | + <meta name="theme-color" content="#ffffff" /> |
| 37 | + <meta name="apple-mobile-web-app-capable" content="yes" /> |
| 38 | + <meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
| 39 | + <meta name="apple-mobile-web-app-title" content="react-native-csv" /> |
| 40 | + <link rel="apple-touch-icon" href="" /> |
| 41 | + <link rel="shortcut icon" type="image/x-icon" href="" /> |
| 42 | + |
| 43 | + <link |
| 44 | + rel="stylesheet" |
| 45 | + href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" |
| 46 | + /> |
| 47 | + <link |
| 48 | + rel="stylesheet" |
| 49 | + href="//fonts.googleapis.com/css?family=Arvo|Source+Sans+Pro:400,400italic,700|Lato:300,400" |
| 50 | + /> |
| 51 | + <link rel="stylesheet" href="/static/css/unsemantic.css" /> |
| 52 | + <link rel="stylesheet" href="/static/css/common.css" /> |
| 53 | + <link rel="stylesheet" href="/static/css/prism.css" /> |
| 54 | + |
| 55 | + {pageName === '' ? ( |
| 56 | + <link rel="stylesheet" href="/static/css/home.css" /> |
| 57 | + ) : ( |
| 58 | + '' |
| 59 | + )} |
| 60 | + {pageName === 'demo' ? ( |
| 61 | + <link rel="stylesheet" href="/static/css/demo.css" /> |
| 62 | + ) : ( |
| 63 | + '' |
| 64 | + )} |
| 65 | + |
| 66 | + <meta property="og:url" content="https://react-native-csv.github.io" /> |
| 67 | + <meta property="og:type" content="website" /> |
| 68 | + <meta property="og:title" content="react-native-csv" /> |
| 69 | + <meta |
| 70 | + property="og:description" |
| 71 | + content="The fastest in-browser CSV (or delimited text) parser for React." |
| 72 | + /> |
| 73 | + <meta |
| 74 | + property="og:image" |
| 75 | + content="/static/images/react-native-csv.png" |
| 76 | + /> |
| 77 | + |
| 78 | + <meta name="twitter:card" content="summary_large_image" /> |
| 79 | + <meta name="twitter:site" content="@bunlongvan" /> |
| 80 | + <meta name="twitter:creator" content="@bunlongvan" /> |
| 81 | + <meta name="twitter:title" content="react-native-csv" /> |
| 82 | + <meta |
| 83 | + name="twitter:description" |
| 84 | + content="The fastest in-browser CSV (or delimited text) parser for React." |
| 85 | + /> |
| 86 | + <meta |
| 87 | + name="twitter:image" |
| 88 | + content="https://react-native-csv.github.io/static/images/react-native-csv.png" |
| 89 | + /> |
| 90 | + |
| 91 | + <link |
| 92 | + rel="shortcut icon" |
| 93 | + href="/static/favicon.ico" |
| 94 | + type="image/x-icon" |
| 95 | + /> |
| 96 | + <link |
| 97 | + rel="icon" |
| 98 | + href="/static/favicon-32.png" |
| 99 | + sizes="32x32" |
| 100 | + type="image/png" |
| 101 | + /> |
| 102 | + <link |
| 103 | + rel="apple-touch-icon-precomposed" |
| 104 | + href="/static/favicon-152.png" |
| 105 | + type="image/png" |
| 106 | + sizes="152x152" |
| 107 | + /> |
| 108 | + <link |
| 109 | + rel="apple-touch-icon-precomposed" |
| 110 | + href="/static/favicon-120.png" |
| 111 | + type="image/png" |
| 112 | + sizes="120x120" |
| 113 | + /> |
| 114 | + <link |
| 115 | + rel="icon" |
| 116 | + href="/static/favicon-96.png" |
| 117 | + sizes="96x96" |
| 118 | + type="image/png" |
| 119 | + /> |
| 120 | + </Head> |
| 121 | + <div> |
| 122 | + <Component {...pageProps} /> |
| 123 | + </div> |
| 124 | + <footer> |
| 125 | + <div className="footer-main"> |
| 126 | + <div className="grid-container"> |
| 127 | + <div className="grid-40 text-center"> |
| 128 | + <div className="logo" /> |
| 129 | + <br /> |
| 130 | + <br /> |
| 131 | + react-native-csv by{' '} |
| 132 | + <a href="https://github.com/bunlong">Bunlong</a> |
| 133 | + <br /> |
| 134 | + © 2018-2020 |
| 135 | + </div> |
| 136 | + |
| 137 | + <div className="grid-15 mobile-grid-50 links"> |
| 138 | + <h5>Learn</h5> |
| 139 | + <a href="/demo">Demo</a> |
| 140 | + <a href="/docs">Documentation</a> |
| 141 | + </div> |
| 142 | + |
| 143 | + <div className="grid-15 mobile-grid-50 links"> |
| 144 | + <h5>Project</h5> |
| 145 | + <a |
| 146 | + href="https://github.com/Bunlong/react-native-csv" |
| 147 | + target="_blank" |
| 148 | + > |
| 149 | + react-native-csv |
| 150 | + </a> |
| 151 | + </div> |
| 152 | + </div> |
| 153 | + </div> |
| 154 | + </footer> |
| 155 | + <script type="text/javascript" src="/static/js/prism.js" /> |
| 156 | + </div> |
| 157 | + ); |
| 158 | + } |
| 159 | +} |
| 160 | + |
| 161 | +export default CustomApp; |
0 commit comments