From c21c8eda7d3cb9b888fbbb9b66280ce1c8f8dc39 Mon Sep 17 00:00:00 2001 From: Kichiyaki Date: Sun, 28 Mar 2021 09:32:45 +0200 Subject: [PATCH] add Suggestions component --- .../features/TestPage/TestPage.tsx | 2 + .../components/Suggestions/Suggestions.tsx | 71 +++++++++++++++++++ .../features/TestPage/queries.ts | 1 + 3 files changed, 74 insertions(+) create mode 100644 src/features/QualificationPage/features/TestPage/components/Suggestions/Suggestions.tsx diff --git a/src/features/QualificationPage/features/TestPage/TestPage.tsx b/src/features/QualificationPage/features/TestPage/TestPage.tsx index 60faedd..33d280c 100644 --- a/src/features/QualificationPage/features/TestPage/TestPage.tsx +++ b/src/features/QualificationPage/features/TestPage/TestPage.tsx @@ -18,6 +18,7 @@ import { import Layout from 'common/Layout/Layout'; import SEO from 'common/SEO/SEO'; +import Suggestions from './components/Suggestions/Suggestions'; export type TestPageParams = { slug: string; @@ -39,6 +40,7 @@ const TestPage = ({ questions, suggestions, qualification }: TestPageProps) => { questions.length } ${polishPlurals('pytanie', 'pytania', 'pytań', questions.length)}`} /> + ); }; diff --git a/src/features/QualificationPage/features/TestPage/components/Suggestions/Suggestions.tsx b/src/features/QualificationPage/features/TestPage/components/Suggestions/Suggestions.tsx new file mode 100644 index 0000000..27c9e5f --- /dev/null +++ b/src/features/QualificationPage/features/TestPage/components/Suggestions/Suggestions.tsx @@ -0,0 +1,71 @@ +import { polishPlurals } from 'polish-plurals'; +import { Qualification } from 'libs/graphql'; +import { QUESTIONS } from 'config/app'; +import { Route } from 'config/routing'; + +import { + Button, + Card, + CardActions, + CardHeader, + Container, + Grid, + Typography, +} from '@material-ui/core'; +import Section from 'common/Section/Section'; +import Link from 'common/Link/Link'; + +export interface SuggestionsProps { + suggestions: Qualification[]; +} + +const Suggestions = ({ suggestions }: SuggestionsProps) => { + return ( +
+ + + Podobne kwalifikacje + + + {suggestions.map(suggestion => { + return ( + + + + + {QUESTIONS.map(limit => { + return ( + + + + ); + })} + + + + ); + })} + + +
+ ); +}; + +export default Suggestions; diff --git a/src/features/QualificationPage/features/TestPage/queries.ts b/src/features/QualificationPage/features/TestPage/queries.ts index aa44f2e..2e77a47 100644 --- a/src/features/QualificationPage/features/TestPage/queries.ts +++ b/src/features/QualificationPage/features/TestPage/queries.ts @@ -41,6 +41,7 @@ export const QUERY_GENERATE_TEST_SIMILAR_QUALIFICATIONS = gql` id name code + slug } } }