Skip to content

Commit

Permalink
Merge pull request #146 from Normal-OJ/feat/courses-page-mobile
Browse files Browse the repository at this point in the history
feat: update table width in `pages/courses`
  • Loading branch information
laporchen authored Aug 7, 2023
2 parents f1aec19 + 6115991 commit 43f0a76
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/courses/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { useAxios } from "@vueuse/integrations/useAxios";
import { fetcher } from "@/models/api";
import { useSession, UserRole } from "@/stores/session";
import useInteractions from "@/composables/useInteractions";
const { isDesktop } = useInteractions();
useTitle("Courses | Normal OJ");
const { data: courses, error, isLoading } = useAxios<CourseList>("/course", fetcher);
Expand Down Expand Up @@ -41,7 +45,11 @@ const rolesCanCreateCourse = [UserRole.Admin, UserRole.Teacher];
</thead>
<tbody>
<tr v-for="{ course, teacher } in courses" :key="course" class="hover">
<td>
<td
:class="{
'min-w-[10rem] max-w-[12rem] whitespace-pre-wrap': !isDesktop,
}"
>
<router-link :to="`/course/${course}`" class="link-hover link">{{ course }}</router-link>
</td>
<td>{{ teacher.username }}</td>
Expand Down

0 comments on commit 43f0a76

Please sign in to comment.