Skip to content

Commit

Permalink
type changing
Browse files Browse the repository at this point in the history
  • Loading branch information
wakie92 committed Apr 1, 2020
1 parent 656b7dd commit a9ca640
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
14 changes: 2 additions & 12 deletions components/Write/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ import '../../lib/styles/github-markdown.css';
import { breakpoints } from '../../lib/styles/responsive';
import Prism from "prismjs";
import { colors } from '../../lib/styles/global';
// import 'prismjs/themes/prism-okaidia.css';
// import 'prismjs/components/prism-jsx.min.js';
// let Prism = null;
// const isBrowser = process.env.APP_ENV === 'browser';
// if(isBrowser) {
// Prism = require('prismjs');
// require('prismjs/components/prism-bash.min.js');
// require('prismjs/components/prism-javascript.min.js');
// require('prismjs/components/prism-jsx.min.js');
// require('prismjs/components/prism-css.min.js');
// }
import 'prismjs/themes/prism-okaidia.css';

interface PreviewProps {
inputValue: string;
Expand All @@ -35,7 +25,7 @@ export default function Preview({ inputValue, mdRef, onChange }: PreviewProps) {
return (
<>
<Wrapper ref={mdRef}>
<div className="md" dangerouslySetInnerHTML={{ __html: html }}>
<div className="markdown-body" dangerouslySetInnerHTML={{ __html: html }}>

</div>
</Wrapper>
Expand Down
6 changes: 0 additions & 6 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import Header from '../components/CommonUI/Header';
import rootReducer, { rootSaga } from '../store/modules';
import configureStore from '../store/configureStore';
import { useState, useEffect } from 'react';
import Prism from "prismjs";
import 'prismjs/themes/prism-okaidia.css';
import 'prismjs/components/prism-jsx.min.js';
// styles/global.js

type IProps = { store: Store } & AppInitialProps & AppContext
Expand Down Expand Up @@ -52,12 +49,9 @@ const MyApp2 = (props: IProps) => {
}
MyApp2.getInitialProps = async ({ Component, ctx }) => {
let pageProps = {}
console.log(Component.type);
console.log(ctx.isServer);
// 서버사이드에서 리덕스 연결 성공. 원인 공부
if (ctx.isServer) {
pageProps = await Component.getInitialProps(ctx)
console.log(pageProps)
}

return { pageProps }
Expand Down
12 changes: 11 additions & 1 deletion pages/admin/oscar/login.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { logoutFn, loginPopup } from "../../../lib/Utils/utils";
import { RootState } from "../../../store/modules";
import { useSelector } from "react-redux";
import { NextPage, NextPageContext } from "next";

const login = () => {

type loginProps = {
isServer: string;
};
const login: NextPage = ({ isServer }: loginProps) => {
const { isLogged } = useSelector((state: RootState) => ({
isLogged: state.loginUI.isLogged,
}))

const onLoginModal = () => {
// dispatch(getLoginModal());
const token = JSON.parse(sessionStorage.getItem("idToken"));
Expand All @@ -23,5 +29,9 @@ const login = () => {
</button>
)
}
login.getInitialProps = async (ctx: NextPageContext) => {
const isServer = ctx.req ? 'server' : 'client';
return { isServer };
};

export default login;

0 comments on commit a9ca640

Please sign in to comment.