기준코드 뷰어 목차, 내용 css 추가.
parent
85951254cd
commit
bb200ffbca
|
|
@ -29,6 +29,18 @@ export const SbTitle = styled.div`
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const VwDiv = styled.div`
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-left: ${props => (props.depth * 10)}px;
|
||||||
|
color: ${props => (props.isTitle?'darkcyan':'black')};
|
||||||
|
padding-top: ${props => (props.isTitle?'10':'')}px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const VwPtag = styled.p`
|
||||||
|
cursor: ${props => (props.isTitle?'pointer':'')};
|
||||||
|
`;
|
||||||
|
|
||||||
// 제일 하위메뉴에서 클릭할 Link
|
// 제일 하위메뉴에서 클릭할 Link
|
||||||
export const SbLink = styled(Link)`
|
export const SbLink = styled(Link)`
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, useEffect, useCallback } from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
import SbItem from './SbItem'
|
import SbItem from './SbItem'
|
||||||
import {SbContainer} from './Sb.style'
|
import {SbContainer, VwDiv, VwPtag} from './Sb.style'
|
||||||
import Row from 'react-bootstrap/Row';
|
import Row from 'react-bootstrap/Row';
|
||||||
import Col from 'react-bootstrap/Col';
|
import Col from 'react-bootstrap/Col';
|
||||||
import * as EgovNet from 'api/egovFetch';
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
|
@ -84,15 +84,20 @@ function CodeViewer(props) {
|
||||||
let detailTag = [];
|
let detailTag = [];
|
||||||
if(resp.result.document.length>0){
|
if(resp.result.document.length>0){
|
||||||
resp.result.document.forEach(function (item, index){
|
resp.result.document.forEach(function (item, index){
|
||||||
if(item.full_content.includes(item.group_title)){
|
const isTitle = item.full_content.includes(item.group_title);
|
||||||
|
if(isTitle){
|
||||||
summaryTag.push(
|
summaryTag.push(
|
||||||
<div><p href="#" onClick={() => {
|
<VwDiv depth={item.cont_level} isTitle={isTitle}>
|
||||||
document.location.hash="#"+item.cont_type_cd;
|
<VwPtag href="#" isTitle={isTitle} onClick={() => {
|
||||||
}}>{item.group_title}</p></div>
|
document.location.hash="#"+item.cont_type_cd;
|
||||||
|
}}>
|
||||||
|
{item.group_title}
|
||||||
|
</VwPtag>
|
||||||
|
</VwDiv>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
detailTag.push(
|
detailTag.push(
|
||||||
<div id={item.cont_type_cd} dangerouslySetInnerHTML={ {__html: item.full_content} }></div>
|
<VwDiv depth={item.cont_level} isTitle={isTitle} id={item.cont_type_cd} dangerouslySetInnerHTML={ {__html: item.full_content} }></VwDiv>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue