diff --git a/src/signs/application/SignService.ts b/src/signs/application/SignService.ts index 86bf3d1b4..7793fc8be 100644 --- a/src/signs/application/SignService.ts +++ b/src/signs/application/SignService.ts @@ -37,7 +37,7 @@ export default class SignService { signName: string, order: string, sortEra: string - ): Bluebird { + ): Bluebird { return this.signsRepository.findSignsByOrder(signName, order, sortEra) } } diff --git a/src/signs/ui/search/SignsSearch.tsx b/src/signs/ui/search/SignsSearch.tsx index a88f9f133..9a99f517e 100644 --- a/src/signs/ui/search/SignsSearch.tsx +++ b/src/signs/ui/search/SignsSearch.tsx @@ -14,6 +14,7 @@ import MesZL from 'signs/ui/search/MesZL' interface Props { signs: Sign[] isIncludeHomophones: boolean + signService: SignService } function sortSigns(signs: Sign[]): Sign[] { @@ -22,13 +23,50 @@ function sortSigns(signs: Sign[]): Sign[] { ) } -function SignsSearch({ signs, isIncludeHomophones }: Props): JSX.Element { +const SignLists = withData< + { sign: Sign; order: string }, + { signService: SignService }, + any[] +>( + ({ data }) => { + console.log(data) + return ( + <> + {data.map((item, index) => ( + {item.name} + ))} + + ) + }, + (props) => + props.signService.findSignsByOrder( + props.sign.name, + props.order, + 'neoAssyrianOnset' + ) +) + +function SignsSearch({ + signs, + isIncludeHomophones, + signService, +}: Props): JSX.Element { const signsNew = isIncludeHomophones ? signs : sortSigns(signs) return ( @@ -75,14 +113,15 @@ function SignComponent({ sign }: { sign: Sign }): JSX.Element { } export default withData< - { signQuery: SignQuery }, - { signService: SignService }, + { signQuery: SignQuery; signService: SignService }, + unknown, Sign[] >( - ({ data, signQuery }) => ( + ({ data, signQuery, signService }) => ( ), (props) => props.signService.search(props.signQuery),