forked from fossabot/ai_web_RISKOUT_BTS
generated from osamhack2021/Repo_Sample-Main-Technology_Sub-Technology_ProjectName_TeamName
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from osamhack2021/feature/front-common-compon…
…ents Feature/front common components
- Loading branch information
Showing
16 changed files
with
135 additions
and
292 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 76 additions & 75 deletions
151
WEB/frontend/src/components/DetectionStatus/FilterBar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,79 @@ | ||
import { | ||
Box, | ||
Button, | ||
Card, | ||
CardHeader, | ||
CardContent, | ||
Divider, | ||
Stack, | ||
Typography, | ||
} from '@mui/material'; | ||
import FilterCheckbox from './FilterCheckbox'; | ||
|
||
import { useRecoilState, useRecoilValue } from 'recoil'; | ||
import { filterListState } from '../../atoms/filterListState'; | ||
import { searchListState } from '../../atoms/searchListState'; | ||
|
||
export default function FilterBar() { | ||
const filterList = useRecoilValue(filterListState); | ||
const searchList = useRecoilValue(searchListState); | ||
|
||
return ( | ||
<Card | ||
sx={{ right: 0, marginTop: '38px', minHeight: '100%' }} | ||
elevation={1} | ||
spacing={3} | ||
> | ||
<CardHeader | ||
action={ | ||
<Button style={{ fontSize: '10px', marginTop: '10px' }} size="small"> | ||
RESET | ||
</Button> | ||
} | ||
titleTypographyProps={{ variant: 'body1' }} | ||
title="FILTER" | ||
/> | ||
<Divider /> | ||
|
||
{Object.entries(namedEntityMap).map(([filterLabel, filterCode]) => { | ||
const filterTags = Object.entries(searchList.filterTags[filterCode]); | ||
return ( | ||
<CardContent style={{ marginBottom: '16px' }}> | ||
<Box className="filter_con"> | ||
<Stack | ||
direction="row" | ||
alignItems="center" | ||
justifyContent="space-between" | ||
> | ||
<Typography>글에서 찾은 {filterLabel}</Typography> | ||
<Typography>{filterTags.length}</Typography> | ||
</Stack> | ||
<Box> | ||
{/* <FilterCheckbox count={10} hashtag="myHashtag" key="myHashtag" onToggle={toggleFilter} /> */} | ||
{filterTags | ||
.sort(([_, a], [__, b]) => (a < b ? 1 : -1)) | ||
.map(([hashtag, freq], i) => ( | ||
<FilterCheckbox | ||
count={freq} | ||
hashtag={hashtag} | ||
key={hashtag} | ||
checked={filterList.includes(hashtag)} | ||
/> | ||
))} | ||
<Button | ||
size="small" | ||
sx={{ float: 'right', marginRight: '-15px' }} | ||
Box, | ||
Button, | ||
Card, | ||
CardHeader, | ||
CardContent, | ||
Divider, | ||
Stack, | ||
Typography, | ||
} from '@mui/material'; | ||
import FilterCheckbox from './FilterCheckbox'; | ||
|
||
import { useRecoilState, useRecoilValue } from 'recoil'; | ||
import { filterListState } from '../../atoms/filterListState'; | ||
import { searchListState } from '../../atoms/searchListState'; | ||
|
||
export default function FilterBar() { | ||
const filterList = useRecoilValue(filterListState); | ||
const searchList = useRecoilValue(searchListState); | ||
|
||
return ( | ||
<Card | ||
sx={{ right: 0, marginTop: '38px', minHeight: '100%', marginRight: '5em' }} | ||
elevation={1} | ||
spacing={3} | ||
> | ||
<CardHeader | ||
action={ | ||
<Button style={{ fontSize: '11px', fontWeight: '800', fontFamily: 'Noto sans KR', marginTop: '-20px', marginRight: '-8px', marginBottom: '-6px' }} size="small"> | ||
RESET | ||
</Button> | ||
} | ||
titleTypographyProps={{ variant: 'body1' }} | ||
title="FILTER" | ||
sx={{ fontFamily: "Noto sans KR", fontSize: "1.5em", fontWeight: "600"}} | ||
/> | ||
<Divider /> | ||
|
||
{Object.entries(namedEntityMap).map(([filterLabel, filterCode]) => { | ||
const filterTags = Object.entries(searchList.filterTags[filterCode]); | ||
return ( | ||
<CardContent style={{ marginBottom: '35px' }}> | ||
<Box className="filter_con" sx={{lineHeight: "2.8"}}> | ||
<Stack | ||
direction="row" | ||
alignItems="center" | ||
justifyContent="space-between" | ||
> | ||
더보기 | ||
</Button> | ||
<Typography sx={{ fontFamily: "Noto sans KR", fontSize: "1.0rem" }}>글에서 찾은 {filterLabel}</Typography> | ||
<Typography sx={{ fontFamily: "Noto sans KR", fontSize: "1.0rem" }}>{filterTags.length}</Typography> | ||
</Stack> | ||
<Box> | ||
{/* <FilterCheckbox count={10} hashtag="myHashtag" key="myHashtag" onToggle={toggleFilter} /> */} | ||
{filterTags | ||
.sort(([_, a], [__, b]) => (a < b ? 1 : -1)) | ||
.map(([hashtag, freq], i) => ( | ||
<FilterCheckbox | ||
count={freq} | ||
hashtag={hashtag} | ||
key={hashtag} | ||
checked={filterList.includes(hashtag)} | ||
/> | ||
))} | ||
<Button | ||
size="small" | ||
sx={{ float: 'right', marginRight: '-15px', fontFamily: "Noto sans KR" }} | ||
> | ||
더보기 | ||
</Button> | ||
</Box> | ||
</Box> | ||
</Box> | ||
</CardContent> | ||
); | ||
})} | ||
</Card> | ||
); | ||
} | ||
|
||
const namedEntityMap = { 단체: 'ORG', 인물: 'CVL', 시간대: 'TIM' }; | ||
</CardContent> | ||
); | ||
})} | ||
</Card> | ||
); | ||
} | ||
|
||
const namedEntityMap = { 단체: 'ORG', 인물: 'CVL', 시간대: 'TIM' }; |
74 changes: 0 additions & 74 deletions
74
WEB/frontend/src/components/DetectionStatus/FilterTable.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.