Skip to content

Commit 9d1d96a

Browse files
committed
Improve bookmarks view on the profile page
1 parent c8b0f72 commit 9d1d96a

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

UI/src/features/pages/regular/profile/profile.tsx

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import { TextField, Button, Grid, Paper, Typography, Box, Avatar, Tabs, Tab, IconButton, List, ListItem, ListItemText, ListItemIcon, ListItemSecondaryAction } from '@mui/material';
2+
import { TextField, Button, Grid, Paper, Typography, Box, Avatar, Tabs, Tab, IconButton, List, ListItem, ListItemIcon, ListItemSecondaryAction } from '@mui/material';
33
import { useProfile } from './hooks';
44
import { styled } from '@mui/material/styles';
55
import { showError, showSuccess } from '../../../dialog-handler/dialog-handler';
@@ -363,22 +363,40 @@ export const Profile: React.FC = () => {
363363
<ListItemIcon sx={{ color: 'primary.main' }}>
364364
{getBookmarkIcon(bookmark.bookmarkType)}
365365
</ListItemIcon>
366-
<ListItemText
367-
primary={
368-
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
369-
<Typography variant="subtitle1" sx={{ fontWeight: 600 }}>
370-
{bookmark.title}
371-
</Typography>
372-
</Box>
373-
}
374-
secondary={
375-
bookmark.description && (
376-
<Typography variant="body2" sx={{ color: 'text.secondary', mt: 0.5 }}>
377-
{bookmark.description}
378-
</Typography>
379-
)
380-
}
381-
/>
366+
<Box sx={{ flexGrow: 1, minWidth: 0, pr: 8 }}>
367+
<Typography variant="subtitle1" sx={{ fontWeight: 600, mb: 0.5 }}>
368+
{bookmark.title}
369+
</Typography>
370+
{bookmark.description && (
371+
<MarkdownView
372+
content={bookmark.description.length > 200
373+
? bookmark.description.substring(0, 200) + '...'
374+
: bookmark.description
375+
}
376+
sx={{
377+
p: 0,
378+
'& .markdown-content': {
379+
fontSize: '0.875rem',
380+
color: 'text.secondary',
381+
'& p': { margin: 0 },
382+
'& h1, & h2, & h3, & h4, & h5, & h6': {
383+
fontSize: '0.875rem',
384+
fontWeight: 'normal',
385+
margin: 0
386+
},
387+
'& ul, & ol': {
388+
margin: 0,
389+
paddingLeft: 16
390+
},
391+
'& li': { margin: 0 },
392+
'& code': {
393+
fontSize: '0.8125rem'
394+
}
395+
}
396+
}}
397+
/>
398+
)}
399+
</Box>
382400
<ListItemSecondaryAction>
383401
<IconButton
384402
edge="end"

0 commit comments

Comments
 (0)