Browse Source

render style improve

amenpunk 2 years ago
parent
commit
52b816c09a
3 changed files with 24 additions and 50 deletions
  1. 3 0
      src/App.css
  2. 17 43
      src/Components/Test/Cleaver/Question.jsx
  3. 4 7
      src/Pages/Pruebas/Cleaver.jsx

+ 3 - 0
src/App.css

327
   padding-bottom:35px;
327
   padding-bottom:35px;
328
   margin-bottom:35px;
328
   margin-bottom:35px;
329
 }
329
 }
330
+.nextquestion_btn:hover{
331
+  background-color: var(--main) !important;
332
+}

+ 17 - 43
src/Components/Test/Cleaver/Question.jsx

1
 import * as React from 'react';
1
 import * as React from 'react';
2
 
2
 
3
-import Card from '@mui/material/Card';
4
-// import CardActions from '@mui/material/CardActions';
5
-import CardContent from '@mui/material/CardContent';
6
-// import Button from '@mui/material/Button';
7
-// import Typography from '@mui/material/Typography';
8
-// import Avatar from '@mui/material/Avatar';
9
-import Checkbox from '@mui/material/Checkbox';
10
-// import { deepPurple } from '@mui/material/colors';
3
+import { 
4
+  Remove as RemoveIcon,
5
+  Add as AddIcon
6
+} from '@mui/icons-material';
11
 
7
 
12
-import List from '@mui/material/List';
13
-import Tooltip from '@mui/material/Tooltip';
14
-import ListItem from '@mui/material/ListItem';
15
-import ListItemButton from '@mui/material/ListItemButton';
16
-import ListItemIcon from '@mui/material/ListItemIcon';
17
-import ListItemText from '@mui/material/ListItemText';
18
-
19
-import AddIcon from '@mui/icons-material/Add';
20
-import RemoveIcon from '@mui/icons-material/Remove';
8
+import {
9
+  Card,CardContent,Avatar,Checkbox,List,Tooltip,
10
+  ListItem,ListItemButton,ListItemIcon,ListItemText
11
+} from '@mui/material'
21
 
12
 
13
+import { deepPurple } from '@mui/material/colors';
22
 
14
 
23
 function CheckboxexHeader(prop) {
15
 function CheckboxexHeader(prop) {
24
   return (
16
   return (
25
     <List sx={{ width: '100%', bgcolor: 'background.paper' }}>
17
     <List sx={{ width: '100%', bgcolor: 'background.paper' }}>
26
       <ListItem>
18
       <ListItem>
19
+        <Avatar sx={{ bgcolor: deepPurple[500] }}>{prop.group}</Avatar>
27
         <ListItemButton role={undefined} dense>
20
         <ListItemButton role={undefined} dense>
28
           <ListItemText style={{marginRight :25, color:'silver'}} primary={prop.title} />
21
           <ListItemText style={{marginRight :25, color:'silver'}} primary={prop.title} />
29
           <ListItemIcon>
22
           <ListItemIcon>
62
         return (
55
         return (
63
           <ListItem key={value.id}>
56
           <ListItem key={value.id}>
64
             <ListItemButton role={undefined} onClick={handleToggle(value)} dense>
57
             <ListItemButton role={undefined} onClick={handleToggle(value)} dense>
65
-
66
               <Tooltip title={value.decription} placement="top-start" arrow>
58
               <Tooltip title={value.decription} placement="top-start" arrow>
67
-                <ListItemText className="checkbox_label_question" id={labelId} primary={value.nombre} />
59
+                <ListItemText 
60
+                  sx={{ '& .MuiTypography-root' : {
61
+                      fontWeight:'bold'
62
+                  }}} className="checkbox_label_question" id={labelId} primary={value.nombre} />
68
               </Tooltip>
63
               </Tooltip>
69
 
64
 
70
               <ListItemIcon>
65
               <ListItemIcon>
93
   );
88
   );
94
 }
89
 }
95
 
90
 
96
-export function Question({ quiz, group }) {
97
-  // console.log('quiz: ', quiz)
98
-  let { instrucciondepregunta, respuestas } = quiz
91
+export function Question({ quiz}) {
92
+  let { instrucciondepregunta, respuestas,id } = quiz
99
   return (
93
   return (
100
-
101
     <Card sx={{ minWidth: 275, margin: '30px !important', borderLeft: '5px solid var(--main)'}}>
94
     <Card sx={{ minWidth: 275, margin: '30px !important', borderLeft: '5px solid var(--main)'}}>
102
       <CardContent>
95
       <CardContent>
103
 
96
 
104
-        {/*
105
-        <div sx={{ fontSize: 17 }}>
106
-          <div className="quiz_title_text">
107
-            <Avatar sx={{ bgcolor: deepPurple[500] }}>{id}</Avatar>
108
-            <Typography style={{ paddingLeft: 15 }}>
109
-              {instrucciondepregunta}
110
-            </Typography>
111
-          </div>
112
-        </div>
113
-      */}
114
-
115
         <div variant="body2">
97
         <div variant="body2">
116
           <List>
98
           <List>
117
-            <CheckboxexHeader title={group + " - " + instrucciondepregunta}/>
99
+            <CheckboxexHeader  group={id} title={instrucciondepregunta}/>
118
           </List>
100
           </List>
119
           <CheckboxesGroup quiz={respuestas} />
101
           <CheckboxesGroup quiz={respuestas} />
120
         </div>
102
         </div>
121
       </CardContent>
103
       </CardContent>
122
-
123
-        {/*
124
-      <CardActions>
125
-        <Button variant="contained" size="small">Anterior</Button>
126
-        <Button variant="contained" size="small">Siguiente</Button>
127
-      </CardActions>
128
-      */}
129
-
130
     </Card>
104
     </Card>
131
   );
105
   );
132
 }
106
 }

+ 4 - 7
src/Pages/Pruebas/Cleaver.jsx

1
 import React, { useMemo } from 'react'
1
 import React, { useMemo } from 'react'
2
-
3
 import { Service } from '../../Utils/HTTP'
2
 import { Service } from '../../Utils/HTTP'
4
 import useAuth from '../../Auth/useAuth.js';
3
 import useAuth from '../../Auth/useAuth.js';
5
 import { Question } from '../../Components/Test/Cleaver/Question.jsx'
4
 import { Question } from '../../Components/Test/Cleaver/Question.jsx'
6
-
7
-import Box from '@mui/material/Box';
8
-import Button from '@mui/material/Button';
9
-import Collapse from '@mui/material/Collapse';
10
-import List from '@mui/material/List';
5
+import { Box,Button, Collapse, List } from '@mui/material'
11
 import { TransitionGroup } from 'react-transition-group';
6
 import { TransitionGroup } from 'react-transition-group';
12
 import * as Scroll from 'react-scroll';
7
 import * as Scroll from 'react-scroll';
13
 
8
 
56
             <TransitionGroup >
51
             <TransitionGroup >
57
               {totalRespondidas.map((item) => (
52
               {totalRespondidas.map((item) => (
58
                 <Collapse key={item.id} >
53
                 <Collapse key={item.id} >
59
-                  <Question key={item.id} quiz={item} group={item.nombre}/>
54
+                  <Question key={item.id} id={item.id} quiz={item} />
60
                 </Collapse>
55
                 </Collapse>
61
               ))
56
               ))
62
             }
57
             }
66
 
61
 
67
         <div className="question_btn">
62
         <div className="question_btn">
68
         <Button
63
         <Button
64
+          className="nextquestion_btn"
65
+          sx={{ backgroundColor: 'var(--main)' }}
69
           variant="contained"
66
           variant="contained"
70
           disabled={totalPreguntas.length <= 0}
67
           disabled={totalPreguntas.length <= 0}
71
           onClick={handleAddQuestion}
68
           onClick={handleAddQuestion}