Skip to content

Commit dff4ba7

Browse files
authored
Merge pull request #113 from fachschaftinformatik/fix/links
fix(website): fix missing imports
2 parents f560ba9 + 9f5b3e6 commit dff4ba7

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

website/src/routes/d/[id]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState } from "react";
2-
import { useParams, useNavigate, Link } from "react-router-dom";
2+
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
33
import Avatar from "@mui/material/Avatar";
44
import Box from "@mui/material/Box";
55
import Stack from "@mui/material/Stack";
@@ -311,7 +311,7 @@ export default function ViewPost() {
311311
{post.user_name ? post.user_name[0].toUpperCase() : "A"}
312312
</Avatar>
313313
<Typography variant="body2" color="text.secondary">
314-
von <Typography component={Link} to={`/u/${post.user_id}`} variant="body2" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{post.user_name || "Anonym"}</Typography> · {isoToShort(post.created_at || "")}
314+
von <Typography component={RouterLink} to={`/u/${post.user_id}`} variant="body2" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{post.user_name || "Anonym"}</Typography> · {isoToShort(post.created_at || "")}
315315
</Typography>
316316
</Stack>
317317
</Stack>

website/src/routes/d/components.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from "react";
2+
import { Link as RouterLink } from "react-router-dom";
23
import Box from "@mui/material/Box";
34
import Stack from "@mui/material/Stack";
45
import Paper from "@mui/material/Paper";
@@ -226,7 +227,7 @@ export function CommentThread({
226227
<Stack direction="row" justifyContent="space-between" alignItems="center">
227228
<Stack direction="row" spacing={1} alignItems="center" sx={{ minWidth: 0 }}>
228229
<Typography
229-
component={Link}
230+
component={RouterLink}
230231
to={`/u/${node.user_id}`}
231232
variant="subtitle2"
232233
fontWeight={700}

website/src/routes/d/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { useNavigate, Link } from "react-router-dom";
2+
import { useNavigate, Link as RouterLink } from "react-router-dom";
33
import Box from "@mui/material/Box";
44
import Stack from "@mui/material/Stack";
55
import Paper from "@mui/material/Paper";
@@ -265,7 +265,7 @@ function PostItem({
265265
{post.user_name ? post.user_name[0].toUpperCase() : "A"}
266266
</Avatar>
267267
<Typography variant="caption" sx={{ color: theme.palette.text.secondary }}>
268-
von <Typography component={Link} to={`/u/${post.user_id}`} onClick={(e) => e.stopPropagation()} variant="caption" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{post.user_name || "Anonym"}</Typography> · {isoToShort(post.created_at ?? "")}
268+
von <Typography component={RouterLink} to={`/u/${post.user_id}`} onClick={(e) => e.stopPropagation()} variant="caption" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{post.user_name || "Anonym"}</Typography> · {isoToShort(post.created_at ?? "")}
269269
{post.updated_at && post.created_at && post.updated_at !== post.created_at && " (bearbeitet)"}
270270
{" · "}
271271
{post.comment_count} {post.comment_count === 1 ? "Kommentar" : "Kommentare"}

website/src/routes/home/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
TimelineDot,
2323
TimelineOppositeContent,
2424
} from '@mui/lab';
25-
import { useNavigate, Link as RouterLink, Link } from 'react-router-dom';
25+
import { useNavigate, Link as RouterLink } from 'react-router-dom';
2626

2727
import { Sidebar } from '@components/layout';
2828
import { useAuth } from '@lib/auth';
@@ -469,7 +469,7 @@ const NewsFeedPage: React.FC = () => {
469469
{item.user_name ? item.user_name[0].toUpperCase() : "A"}
470470
</Avatar>
471471
<Typography variant="caption" sx={{ color: 'text.secondary' }}>
472-
von <Typography component={Link} to={`/u/${item.user_id}`} onClick={(e) => e.stopPropagation()} variant="caption" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{item.user_name || "Anonym"}</Typography> · {formatNewsDate(item.created_at || "")}
472+
von <Typography component={RouterLink} to={`/u/${item.user_id}`} onClick={(e) => e.stopPropagation()} variant="caption" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{item.user_name || "Anonym"}</Typography> · {formatNewsDate(item.created_at || "")}
473473
</Typography>
474474
</Stack>
475475
<Typography variant="subtitle1" sx={{ fontWeight: 700, lineHeight: 1.2 }}>{item.title}</Typography>
@@ -498,7 +498,7 @@ const NewsFeedPage: React.FC = () => {
498498
{post.author ? post.author[0].toUpperCase() : "A"}
499499
</Avatar>
500500
<Typography variant="caption" sx={{ color: 'text.secondary' }}>
501-
von <Typography component={Link} to={`/u/${post.authorId}`} onClick={(e) => e.stopPropagation()} variant="caption" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{post.author}</Typography> · {formatForumDate(post.createdAt)}
501+
von <Typography component={RouterLink} to={`/u/${post.authorId}`} onClick={(e) => e.stopPropagation()} variant="caption" sx={{ color: 'inherit', fontWeight: 600, textDecoration: 'none', '&:hover': { textDecoration: 'underline', color: 'primary.main' } }}>{post.author}</Typography> · {formatForumDate(post.createdAt)}
502502
</Typography>
503503
</Stack>
504504
<Typography variant="subtitle1" sx={{ fontWeight: 700, lineHeight: 1.2 }}>{post.title}</Typography>

0 commit comments

Comments
 (0)