Skip to content

Commit da1d7e6

Browse files
author
Alexandra Zwinger
committed
Fix last bugs
1 parent a23c248 commit da1d7e6

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

src/components/ModuleProgressSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ const ModuleProgressSettings: React.FC<ModalProps> = ({onClose, module, allUserM
8989
setChapters((prev) => [...prev, newChapter]);
9090
};
9191

92-
const saveProgress = () => {
92+
const saveProgress = async () => {
9393
try {
9494
module.chapter = chapters;
9595
const updatedModules = allUserModules.map(userModule =>
9696
userModule.name === module.name ? module : userModule
9797
);
98-
updateUserModules(axiosInstance, updatedModules);
98+
await updateUserModules(axiosInstance, updatedModules);
9999
onClose();
100100
} catch (error) {
101101
console.error("Error saving progress:" + error);

src/components/yourStudies/UserInfo.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function UserInfo(props: { reload: boolean }) {
6060
total += ch.checkbox.length;
6161
checked += ch.checkbox.filter(b => b.checked).length;
6262
});
63-
return total === 0 ? 0 : checked / total;
63+
return total === 0 ? 0 : checked / total * 100;
6464
}
6565

6666
const openProgressModal = (name: string) => {
@@ -70,7 +70,7 @@ export default function UserInfo(props: { reload: boolean }) {
7070

7171
const closeProgressModal = () => {
7272
setIsProgressModalOpen(false);
73-
fetchUserInfo()
73+
fetchUserInfo();
7474
};
7575

7676
const openExamModal = () => setIsExamModalOpen(true);
@@ -93,9 +93,9 @@ export default function UserInfo(props: { reload: boolean }) {
9393
};
9494

9595
return (
96-
<div className="lg:w-[60%] w-[80%] sm:px-8 mb-16 justify-center mt-8">
97-
<div className="w-full md:px-16">
98-
<p className="text-2xl font-bold text-white text-left lg:mt-4 mt-16 mb-7">Prüfungstermine</p>
96+
<div className="xl:w-[60%] w-[80%] sm:px-8 mb-16 justify-center mt-8">
97+
<div className="w-full xl:px-16">
98+
<p className="text-2xl font-bold text-white text-left xl:mt-4 mt-16 mb-7">Prüfungstermine</p>
9999
<table className="w-full border-collapse hidden md:table">
100100
<tbody>
101101
{modules.map((subject, idx) => (
@@ -121,7 +121,7 @@ export default function UserInfo(props: { reload: boolean }) {
121121
</div>
122122
<button
123123
onClick={openExamModal}
124-
className="mt-4 bg-[#56A095] text-white py-2 px-4 rounded-lg hover:bg-[#42907a]"
124+
className="mt-4 bg-[#56A095] text-white py-2 px-4 rounded-xl hover:bg-[#42907a]"
125125
>
126126
Prüfungstermine bearbeiten
127127
</button>

src/components/yourStudies/UserSettings.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ export default function UserSettings(props: { reload: boolean, setReload: Dispat
106106
}
107107

108108
return (
109-
<div className="lg:w-[40%] w-[80%] bg-[#1C212C] text-white sm:p-4 mb-12 lg:ml-16 ml-4 ">
109+
<div className="xl:w-[40%] w-[80%] bg-[#1C212C] text-white sm:p-4 mb-12 xl:ml-16 ml-4 ">
110110
<div className="w-full">
111111
<h1 className="md:text-5xl text-4xl font-bold text-gray-300 text-left mt-16">Mein
112112
Studium</h1>
113113
<p className="text-xl font-medium text-white text-left mt-3">Mein Profil</p>
114-
<div className="p-4 lg:mr-20 mr-8 mt-2">
114+
<div className="p-4 xl:mr-20 mr-8 mt-2">
115115
{editProfile ? (
116116
<input
117117
id="profileName"
@@ -127,22 +127,22 @@ export default function UserSettings(props: { reload: boolean, setReload: Dispat
127127
</div>
128128
<div className="mt-3 mb-8">
129129
{editProfile ? (
130-
<div className={"flex items-center w-full gap-2 lg:pr-20 pr-8"}>
131-
<CuteButton classname="lg:text-base text-sm ml-auto" bgColor={"#598BB1"}
130+
<div className={"flex items-center w-full gap-2 xl:pr-20 pr-8"}>
131+
<CuteButton classname="xl:text-base text-sm ml-auto" bgColor={"#598BB1"}
132132
textColor={"#e6ebfc"} onClick={() => editProfileMode(false)}
133133
text="Abbrechen"/>
134-
<CuteButton classname="lg:text-lg text-base" bgColor={"#56A095"} textColor={"#e8fcf6"}
134+
<CuteButton classname="xl:text-xl text-base" bgColor={"#56A095"} textColor={"#e8fcf6"}
135135
onClick={saveProfileModifications}
136136
text="Speichern"/>
137137
</div>
138138
) : (
139-
<CuteButton bgColor="#598BB1" classname="lg:text-lg text-base" textColor="#e6ebfc"
139+
<CuteButton bgColor="#598BB1" classname="xl:text-xl text-base" textColor="#e6ebfc"
140140
text="Profil verwalten" onClick={() => editProfileMode(true)}/>
141141
)}
142142

143143
</div>
144144
<p className="text-xl font-medium text-white text-left mt-3">Aktuelle Module</p>
145-
<div className="p-4 lg:mr-20 mr-8 mt-2">
145+
<div className="p-4 xl:mr-20 mr-8 mt-2">
146146
<div className="w-full border-collapse">
147147
<div>
148148
{editModule ? (
@@ -196,16 +196,16 @@ export default function UserSettings(props: { reload: boolean, setReload: Dispat
196196
</div>
197197
<div className="mt-3">
198198
{editModule ? (
199-
<div className={"flex items-center w-full gap-2 lg:pr-20 pr-8"}>
200-
<CuteButton classname="lg:text-base text-sm ml-auto" bgColor={"#598BB1"}
199+
<div className={"flex items-center w-full gap-2 xl:pr-20 pr-8"}>
200+
<CuteButton classname="xl:text-base text-sm ml-auto" bgColor={"#598BB1"}
201201
textColor={"#e6ebfc"} onClick={() => editModulesMode(false)}
202202
text="Abbrechen"/>
203-
<CuteButton classname="lg:text-lg text-base" bgColor={"#56A095"} textColor={"#e8fcf6"}
203+
<CuteButton classname="xl:text-xl text-base" bgColor={"#56A095"} textColor={"#e8fcf6"}
204204
onClick={saveModules}
205205
text="Speichern"/>
206206
</div>
207207
) : (
208-
<CuteButton bgColor="#598BB1" classname="lg:text-lg text-base" textColor="#e6ebfc"
208+
<CuteButton bgColor="#598BB1" classname="xl:text-xl text-base" textColor="#e6ebfc"
209209
text="Module verwalten" onClick={() => editModulesMode(true)}/>
210210
)}
211211
</div>

src/pages/YourStudies.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export default function YourStudies() {
77
const [reload, setReload] = useState<boolean>(false);
88
return (
99
<div
10-
className="flex lg:justify-between justify-start lg:flex-row scrollbar flex-col overflow-y-scroll lg:items-start items-center lg:mt-12 mt-4 h-full">
10+
className="flex xl:justify-between justify-start xl:flex-row scrollbar flex-col overflow-y-scroll xl:items-start items-center xl:mt-12 mt-4 h-full">
1111
<UserSettings reload={reload} setReload={setReload}/>
12-
<div className="lg:h-[90%] lg:w-[1px] w-[90%] min-h-[2px] bg-[#1C7E70]"></div>
12+
<div className="xl:h-[90%] xl:w-[1px] w-[90%] min-h-[2px] bg-[#1C7E70]"></div>
1313
<UserInfo reload={reload}/>
1414
</div>
1515
);

0 commit comments

Comments
 (0)