adjust layout

This commit is contained in:
c9s 2022-05-12 22:12:45 +08:00
parent f99e874072
commit 7a45f010fa
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
3 changed files with 6 additions and 38 deletions

View File

@ -15,10 +15,6 @@ const Home: NextPage = () => {
</Head>
<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
<StockChart> </StockChart>
</main>
</div>

View File

@ -69,20 +69,20 @@ interface WithOHLCState {
message: string;
}
export function withOHLCData(dataSet = "DAILY") {
export function withOHLCData(interval : string = "5m") {
return <TProps extends WithOHLCDataProps>(OriginalComponent: React.ComponentClass<TProps>) => {
return class WithOHLCData extends React.Component<Omit<TProps, "data">, WithOHLCState> {
public constructor(props: Omit<TProps, "data">) {
super(props);
this.state = {
message: `Loading ${dataSet} data...`,
message: `Loading price data...`,
};
}
public componentDidMount() {
fetch(
`https://raw.githubusercontent.com/reactivemarkets/react-financial-charts/master/packages/stories/src/data/${dataSet}.tsv`,
`/data/klines/ETHUSDT-5m.csv`,
)
.then((response) => response.text())
.then((data) => tsvParse(data, parseData()))
@ -276,12 +276,12 @@ class StockChart extends React.Component<StockChartProps> {
};
}
export default withOHLCData()(withSize({ style: { minHeight: 600 } })(withDeviceRatio()(StockChart)));
export default withOHLCData()(withSize({ style: { minHeight: 400 } })(withDeviceRatio()(StockChart)));
export const MinutesStockChart = withOHLCData("MINUTES")(
withSize({ style: { minHeight: 600 } })(withDeviceRatio()(StockChart)),
withSize({ style: { minHeight: 400 } })(withDeviceRatio()(StockChart)),
);
export const SecondsStockChart = withOHLCData("SECONDS")(
withSize({ style: { minHeight: 600 } })(withDeviceRatio()(StockChart)),
withSize({ style: { minHeight: 400 } })(withDeviceRatio()(StockChart)),
);

View File

@ -23,34 +23,6 @@
flex-grow: 1;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
}
.description {
margin: 4rem 0;
line-height: 1.5;
font-size: 1.5rem;
}
.code {
background: #fafafa;
border-radius: 5px;