1
1
import { graphql , useFragment } from 'react-relay'
2
2
import { StoryPreview_node$key } from '../../queries/__generated__/StoryPreview_node.graphql'
3
- import Card from '../Card'
4
- import StoryAbstract from './StoryAbstract'
5
3
import StoryPreviewFooter from './StoryPreviewFooter'
6
4
import UserSnippet from './UserSnippet'
5
+ import { GoKebabVertical } from '@react-icons/all-files/go/GoKebabVertical'
7
6
8
7
type StoryPreviewProps = {
9
8
story : StoryPreview_node$key
@@ -32,13 +31,16 @@ const StoryPreview = ({ story }: StoryPreviewProps) => {
32
31
< img className = "cover-image" src = { data . thumbnail } alt = "" />
33
32
</ div >
34
33
< div className = "px-4 pb-4" >
35
- < UserSnippet user = { data . createdBy } />
34
+ < div className = "flex flex-row justify-between" >
35
+ < UserSnippet user = { data . createdBy } />
36
+ < GoKebabVertical className = "mt-4" />
37
+ </ div >
36
38
< div className = "prose dark:text-gray-100" >
37
39
< h3 className = "dark:text-gray-200" > { data . title } </ h3 >
38
- < p > { data . abstractContent } </ p >
40
+ < p className = "abstract-content" > { data . abstractContent } </ p >
39
41
</ div >
40
- < StoryPreviewFooter />
41
42
</ div >
43
+ < StoryPreviewFooter />
42
44
< style jsx >
43
45
{ `
44
46
.cover-image {
@@ -47,6 +49,16 @@ const StoryPreview = ({ story }: StoryPreviewProps) => {
47
49
width: 100%;
48
50
object-fit: cover;
49
51
}
52
+
53
+ .abstract-content {
54
+ text-overflow: ellipsis;
55
+ overflow: hidden;
56
+ // Addition lines for 2 line or multiline ellipsis
57
+ display: -webkit-box !important;
58
+ -webkit-line-clamp: 4;
59
+ -webkit-box-orient: vertical;
60
+ white-space: normal;
61
+ }
50
62
` }
51
63
</ style >
52
64
</ div >
0 commit comments