Skip to content

Commit

Permalink
Merge pull request #219 from donfrigo/master
Browse files Browse the repository at this point in the history
Update nextjs example
  • Loading branch information
timocov committed Apr 7, 2021
2 parents cbf4e01 + f33299f commit ce6966b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
4 changes: 2 additions & 2 deletions nextjs-javascript/README.md
Expand Up @@ -3,8 +3,8 @@
## How to start

1. Install dependencies `npm install`.
1. Copy `charting_library` folder from https://github.com/tradingview/charting_library/ to `/static` folders. The earliest supported version of the Charting Library is 17. If you get 404 then you need to [request an access to this repository](https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/).
1. Copy `datafeeds` folder from https://github.com/tradingview/charting_library/ to `/static`.
1. Copy `charting_library` folder from https://github.com/tradingview/charting_library/ to `/public/static` folders. The earliest supported version of the Charting Library is 17. If you get 404 then you need to [request an access to this repository](https://www.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/).
1. Copy `datafeeds` folder from https://github.com/tradingview/charting_library/ to `/public/static`.
1. Run `npm run build` and `npm run start`. It will build the project and open a default browser with the Charting Library.
1. Run `npm run dev` when you start to develop with this project.

Expand Down
6 changes: 3 additions & 3 deletions nextjs-javascript/components/TVChartContainer/index.jsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import './index.css';
import { widget } from '../../static/charting_library';
import styles from './index.module.css';
import { widget } from '../../public/static/charting_library';

function getLanguageFromURL() {
const regex = new RegExp('[\\?&]lang=([^&#]*)');
Expand Down Expand Up @@ -79,7 +79,7 @@ export class TVChartContainer extends React.PureComponent {
return (
<div
id={ this.props.containerId }
className={ 'TVChartContainer' }
className={ styles.TVChartContainer }
/>
);
}
Expand Down
9 changes: 1 addition & 8 deletions nextjs-javascript/next.config.js
@@ -1,8 +1 @@
const withCSS = require('@zeit/next-css');

/* Without CSS Modules, with PostCSS */
module.exports = withCSS({
webpack: function(config) {
return config;
},
});
module.exports = {};
9 changes: 4 additions & 5 deletions nextjs-javascript/package.json
Expand Up @@ -7,13 +7,12 @@
"start": "next start"
},
"dependencies": {
"@zeit/next-css": "^1.0.2-canary.2",
"next": "^9.0.6",
"react": "^16.8.0",
"react-dom": "^16.8.0"
"next": "^10.1.3",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"license": "ISC",
"devDependencies": {
"prettier": "^1.18.2"
"prettier": "^2.2.1"
}
}
File renamed without changes.

0 comments on commit ce6966b

Please sign in to comment.