Skip to content

Commit 674927a

Browse files
committed
refactor: quick start component
1 parent c6cf613 commit 674927a

1 file changed

Lines changed: 54 additions & 32 deletions

File tree

client/src/Components/TeacherHomepage/Instruction.tsx

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,65 @@ import startImg from '../../Assets/startsession.png';
44
import attendanceImg from '../../Assets/classdata.png';
55
import studentData from '../../Assets/studentdata.png';
66

7-
const imgStyle = "bg-white rounded-full h-16 w-16 flex justify-center items-center"
8-
const info = "w-2/3 text-2xl h-20 flex md:pl-8 pl-1 pr-2 items-center rounded-full justify-between"
7+
const imgStyle =
8+
'bg-white rounded-full h-16 w-16 flex justify-center items-center';
9+
const info =
10+
'w-2/3 text-2xl h-20 flex flex-row md:pl-8 pl-1 pr-2 mb-8 items-center rounded-full justify-between';
11+
12+
interface Props {
13+
el: { color: string; text: string; img: string };
14+
}
15+
16+
const Floop: React.FC<Props> = ({ el }) => {
17+
return (
18+
<div className={`${info} ${el.color}`}>
19+
<p>{el.text}</p>
20+
<div className={imgStyle}>
21+
<img src={el.img} alt={el.text} className="h-10 w-10" />
22+
</div>
23+
</div>
24+
);
25+
};
26+
27+
const create = {
28+
color: 'bg-shades-one',
29+
text: 'Create or open a class',
30+
img: openOrCreate,
31+
};
32+
33+
const register = {
34+
color: 'bg-shades-two',
35+
text: 'Register students',
36+
img: registerImg,
37+
};
38+
39+
const start = {
40+
color: 'bg-shades-three',
41+
text: 'Start a session',
42+
img: startImg,
43+
};
44+
45+
const access = {
46+
color: 'bg-shades-four',
47+
text: 'Access attendance data',
48+
img: attendanceImg,
49+
};
50+
51+
const check = {
52+
color: 'bg-shades-five',
53+
text: 'Check individual student data',
54+
img: studentData,
55+
};
956

1057
const Instruction = () => {
1158
return (
1259
<div className="h-screen flex flex-col items-center">
1360
<h1 className="text-5xl my-8">Quick start</h1>
14-
<p className={`${info} mb-4 bg-shades-one`}>
15-
Create or open a class
16-
<div className={imgStyle}>
17-
<img src={openOrCreate} alt="Open or create class" className="h-10 w-10" />
18-
</div>
19-
</p>
20-
<p className={`${info} my-4 bg-shades-two`}>
21-
Register students
22-
<div className={imgStyle}>
23-
<img src={registerImg} alt="Open or create class" className="h-10 w-10" />
24-
</div>
25-
</p>
26-
<p className={`${info} my-4 bg-shades-three`}>
27-
Start a session
28-
<div className={imgStyle}>
29-
<img src={startImg} alt="Open or create class" className="h-10 w-10" />
30-
</div>
31-
</p>
32-
<p className={`${info} my-4 bg-shades-four`}>
33-
Access attendance data
34-
<div className={imgStyle}>
35-
<img src={attendanceImg} alt="Open or create class" className="h-10 w-10" />
36-
</div>
37-
</p>
38-
<p className={`${info} my-4 bg-shades-five`}>
39-
Check individual student data
40-
<div className={imgStyle}>
41-
<img src={studentData} alt="Open or create class" className="h-10 w-10" />
42-
</div>
43-
</p>
61+
<Floop el={create} />
62+
<Floop el={register} />
63+
<Floop el={start} />
64+
<Floop el={access} />
65+
<Floop el={check} />
4466
</div>
4567
);
4668
};

0 commit comments

Comments
 (0)