박권수

feat. Bottle View Component Star

t
This diff is collapsed. Click to expand it.
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
11 "@types/react": "^17.0.0", 11 "@types/react": "^17.0.0",
12 "@types/react-dom": "^17.0.0", 12 "@types/react-dom": "^17.0.0",
13 "axios": "^0.21.1", 13 "axios": "^0.21.1",
14 + "highcharts": "^9.2.0",
15 + "highcharts-react-official": "^3.0.0",
14 "react": "^17.0.2", 16 "react": "^17.0.2",
15 "react-dom": "^17.0.2", 17 "react-dom": "^17.0.2",
16 "react-router-dom": "^5.2.0", 18 "react-router-dom": "^5.2.0",
......
...@@ -6,6 +6,7 @@ import Header from '../components/Header'; ...@@ -6,6 +6,7 @@ import Header from '../components/Header';
6 import { LoginContainer } from "./login"; 6 import { LoginContainer } from "./login";
7 import { RegisterContainer } from './register'; 7 import { RegisterContainer } from './register';
8 import { MainContainer } from "./main"; 8 import { MainContainer } from "./main";
9 +import { BottleInfoContainer } from "./bottleInfo";
9 10
10 11
11 const Router = () => { 12 const Router = () => {
...@@ -17,6 +18,7 @@ const Router = () => { ...@@ -17,6 +18,7 @@ const Router = () => {
17 <Route exact path = '/' component = {MainContainer}/> 18 <Route exact path = '/' component = {MainContainer}/>
18 <Route exact path = '/login' component = {LoginContainer}/> 19 <Route exact path = '/login' component = {LoginContainer}/>
19 <Route exact path = '/register' component = {RegisterContainer}/> 20 <Route exact path = '/register' component = {RegisterContainer}/>
21 + <Route exact path = '/bottle' component = {BottleInfoContainer}/>
20 </Switch> 22 </Switch>
21 </BrowserRouter> 23 </BrowserRouter>
22 ) 24 )
......
1 +import React, { useState, useEffect } from 'react';
2 +import { RouteComponentProps } from 'react-router-dom';
3 +import { useRecoilValue } from 'recoil';
4 +import * as recoilUtil from '../../util/recoilUtil';
5 +
6 +import HighCharts from 'highcharts';
7 +import HighchartsReact from 'highcharts-react-official';
8 +
9 +import BottleInfoPresenter from './BottleInfoPresenter';
10 +
11 +import { doctorApi } from '../../api';
12 +
13 +
14 +type BottleInfoProps = RouteComponentProps
15 +
16 +const BottleInfoContainer = (props : BottleInfoProps) => {
17 +
18 + const token = useRecoilValue(recoilUtil.token);
19 + const userTypeCd = useRecoilValue(recoilUtil.userTypeCd);
20 +
21 +
22 + useEffect(() => {
23 + if(userTypeCd !== 'DOCTOR') {
24 + props.history.push('/');
25 + }
26 + }, [userTypeCd]);
27 +
28 + return (
29 + <BottleInfoPresenter
30 +
31 + />
32 + );
33 +};
34 +
35 +export default BottleInfoContainer;
...\ No newline at end of file ...\ No newline at end of file
1 +import React from 'react';
2 +
3 +import * as styled from './BottleInfoStyled';
4 +
5 +
6 +const BottleInfoPresenter = () => {
7 + return (
8 + <styled.Container>
9 +
10 + </styled.Container>
11 + );
12 +};
13 +
14 +export default BottleInfoPresenter;
...\ No newline at end of file ...\ No newline at end of file
1 +import styled from 'styled-components';
2 +
3 +export const Container = styled.div `
4 +
5 +`;
...\ No newline at end of file ...\ No newline at end of file
1 +export { default as BottleInfoContainer } from './BottleInfoContainer';
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.