Skip to content

Commit e5b8613

Browse files
committed
style: improve results ui slightly
1 parent b348610 commit e5b8613

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

src/client/components/ResultPage/RenderResults.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import useResultRefCallback from '../../hooks/useResultRefCallback'
66
import RiskTableDOM from './RiskTableDOM'
77
import MuiComponentProvider from '../Common/MuiComponentProvider'
88
import RenderAnswersDOM from './RenderAnswersDOM'
9+
import { Box } from '@mui/material'
910

1011
const RenderResults = ({ riskData }: { riskData: RiskData }) => {
1112
const { survey } = useSurvey()
@@ -17,6 +18,7 @@ const RenderResults = ({ riskData }: { riskData: RiskData }) => {
1718
<div ref={refCallback}>
1819
<MuiComponentProvider>
1920
<RiskTableDOM riskData={riskData} countryData={riskData.country[0]} />
21+
<Box sx={{ mt: 4 }} />
2022
<RenderAnswersDOM survey={survey} resultData={riskData.answers} />
2123
</MuiComponentProvider>
2224
</div>

src/resultRenderer/RenderAnswers.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ import type { Survey } from '@client/types'
66

77
import { extraOrganisations } from '@common/organisations'
88

9-
import styles from './styles'
109
import { useComponents } from './context'
1110

12-
const { resultStyles } = styles
13-
1411
const RenderAnswers = ({
1512
survey,
1613
resultData,
@@ -62,12 +59,12 @@ const RenderAnswers = ({
6259
<Typography variant="h6" style={{ fontSize: '24px', marginBottom: '20px' }}>
6360
{t('results:answerBoxTitle')}
6461
</Typography>
65-
<Div style={resultStyles.resultElementWrapper}>
62+
<Div style={{ borderLeft: '1px solid lightgray' }}>
6663
{survey?.Questions.map(currentQuestion => (
6764
<Div key={currentQuestion.id}>
6865
{!currentQuestion.parentId && (
6966
<>
70-
<Div style={resultStyles.card}>
67+
<Div style={{ margin: '16px' }}>
7168
<Typography style={{ fontWeight: '800' }}>
7269
{currentQuestion.id === 8 && resultData[4] === 'multilateral'
7370
? t('questions:additionalPartnerOrganisationCountryQuestion')
@@ -79,10 +76,10 @@ const RenderAnswers = ({
7976
</Div>
8077
{survey?.Questions.filter(childQuestion => childQuestion.parentId === currentQuestion.id)?.map(
8178
childQuestion => (
82-
<Div key={childQuestion.id}>
83-
<Div>
79+
<Div key={childQuestion.id} style={{ margin: '16px' }}>
80+
<Div style={{ borderLeft: '1px solid lightgray' }}>
8481
{answers[childQuestion.id] && (
85-
<Div style={resultStyles.answerBox}>
82+
<Div style={{ margin: '16px' }}>
8683
<Typography style={{ fontWeight: '800' }}>
8784
{childQuestion.title[language as keyof Locales]}
8885
</Typography>
@@ -100,14 +97,14 @@ const RenderAnswers = ({
10097
</>
10198
)}
10299
{currentQuestion.id === 6 && answers[21] && (
103-
<Div style={resultStyles.answerBox}>
100+
<Div style={{ margin: '16px' }}>
104101
<Typography style={{ fontWeight: '800' }}>
105102
{survey.Questions.find(childQuestion => childQuestion.id === 21)?.title[language as keyof Locales]}
106103
</Typography>
107104
</Div>
108105
)}
109106
{currentQuestion.id === 1 && (
110-
<Div style={resultStyles.card}>
107+
<Div style={{ margin: '16px' }}>
111108
<Typography style={{ fontWeight: '800' }}>{t('facultySelect:title')}</Typography>
112109
<Typography>
113110
{organisations.find(faculty => faculty.code === answers.faculty)?.name[language as keyof Locales]}

src/resultRenderer/RiskTable.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,7 @@ const RiskTable = ({
6262
</Typography>
6363
<Div style={resultStyles.resultElementWrapper}>
6464
<TableContainer>
65-
<Table
66-
sx={{
67-
width: '80%',
68-
'& .MuiTableCell-sizeMedium': {
69-
padding: '10px',
70-
},
71-
}}
72-
>
65+
<Table>
7366
<TableBody>
7467
<RiskElement infoText={totalRiskText} title={totalRisk.title} level={totalRisk.level} />
7568
<TableRow>

0 commit comments

Comments
 (0)