File tree Expand file tree Collapse file tree 8 files changed +684
-366
lines changed Expand file tree Collapse file tree 8 files changed +684
-366
lines changed Original file line number Diff line number Diff line change 91
91
.card span .h {
92
92
background : # fce10080 ;
93
93
}
94
+ .card .rtl .snippet ,
95
+ .card .rtl .title {
96
+ direction : rtl;
97
+ }
94
98
95
99
.default-card {
96
100
display : inline-block;
Original file line number Diff line number Diff line change 27
27
"@types/react-redux" : " ^7.1.9" ,
28
28
"@yang991178/rss-parser" : " ^3.8.1" ,
29
29
"electron" : " ^19.0.0" ,
30
- "electron-builder" : " ^22.11 .3" ,
30
+ "electron-builder" : " ^23.0 .3" ,
31
31
"electron-react-devtools" : " ^0.5.3" ,
32
32
"electron-store" : " ^5.2.0" ,
33
33
"electron-window-state" : " ^5.0.3" ,
Original file line number Diff line number Diff line change @@ -3,10 +3,12 @@ import { Card } from "./card"
3
3
import CardInfo from "./info"
4
4
import Time from "../utils/time"
5
5
import Highlights from "./highlights"
6
+ import { SourceTextDirection } from "../../scripts/models/source"
6
7
7
8
const className = ( props : Card . Props ) => {
8
9
let cn = [ "card" , "compact-card" ]
9
10
if ( props . item . hidden ) cn . push ( "hidden" )
11
+ if ( props . source . textDir === SourceTextDirection . RTL ) cn . push ( "rtl" )
10
12
return cn . join ( " " )
11
13
}
12
14
@@ -23,15 +25,10 @@ const CompactCard: React.FunctionComponent<Card.Props> = props => (
23
25
text = { props . item . title }
24
26
filter = { props . filter }
25
27
title
26
- dir = { props . source . textDir }
27
28
/>
28
29
</ span >
29
30
< span className = "snippet" >
30
- < Highlights
31
- text = { props . item . snippet }
32
- filter = { props . filter }
33
- dir = { props . source . textDir }
34
- />
31
+ < Highlights text = { props . item . snippet } filter = { props . filter } />
35
32
</ span >
36
33
</ div >
37
34
< Time date = { props . item . date } />
Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import * as React from "react"
2
2
import { Card } from "./card"
3
3
import CardInfo from "./info"
4
4
import Highlights from "./highlights"
5
+ import { SourceTextDirection } from "../../scripts/models/source"
5
6
6
7
const className = ( props : Card . Props ) => {
7
8
let cn = [ "card" , "default-card" ]
8
9
if ( props . item . snippet && props . item . thumb ) cn . push ( "transform" )
9
10
if ( props . item . hidden ) cn . push ( "hidden" )
11
+ if ( props . source . textDir === SourceTextDirection . RTL ) cn . push ( "rtl" )
10
12
return cn . join ( " " )
11
13
}
12
14
@@ -25,19 +27,10 @@ const DefaultCard: React.FunctionComponent<Card.Props> = props => (
25
27
) : null }
26
28
< CardInfo source = { props . source } item = { props . item } />
27
29
< h3 className = "title" >
28
- < Highlights
29
- text = { props . item . title }
30
- filter = { props . filter }
31
- title
32
- dir = { props . source . textDir }
33
- />
30
+ < Highlights text = { props . item . title } filter = { props . filter } title />
34
31
</ h3 >
35
32
< p className = { "snippet" + ( props . item . thumb ? "" : " show" ) } >
36
- < Highlights
37
- text = { props . item . snippet }
38
- filter = { props . filter }
39
- dir = { props . source . textDir }
40
- />
33
+ < Highlights text = { props . item . snippet } filter = { props . filter } />
41
34
</ p >
42
35
</ div >
43
36
)
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ type HighlightsProps = {
7
7
text : string
8
8
filter : FeedFilter
9
9
title ?: boolean
10
- dir ?: SourceTextDirection
11
10
}
12
11
13
12
const Highlights : React . FunctionComponent < HighlightsProps > = props => {
@@ -59,22 +58,10 @@ const Highlights: React.FunctionComponent<HighlightsProps> = props => {
59
58
}
60
59
}
61
60
62
- const testStyle = {
63
- direction : "inherit" ,
64
- } as React . CSSProperties
65
- if ( props . dir === SourceTextDirection . RTL ) {
66
- testStyle . direction = "rtl"
67
- }
68
61
return (
69
62
< >
70
63
{ spans . map ( ( [ text , flag ] ) =>
71
- flag ? (
72
- < div className = "h" style = { testStyle } >
73
- { text }
74
- </ div >
75
- ) : (
76
- < div style = { testStyle } > { text } </ div >
77
- )
64
+ flag ? < span className = "h" > { text } </ span > : text
78
65
) }
79
66
</ >
80
67
)
Original file line number Diff line number Diff line change @@ -3,13 +3,15 @@ import { Card } from "./card"
3
3
import CardInfo from "./info"
4
4
import Highlights from "./highlights"
5
5
import { ViewConfigs } from "../../schema-types"
6
+ import { SourceTextDirection } from "../../scripts/models/source"
6
7
7
8
const className = ( props : Card . Props ) => {
8
9
let cn = [ "card" , "list-card" ]
9
10
if ( props . item . hidden ) cn . push ( "hidden" )
10
11
if ( props . selected ) cn . push ( "selected" )
11
12
if ( props . viewConfigs & ViewConfigs . FadeRead && props . item . hasRead )
12
13
cn . push ( "read" )
14
+ if ( props . source . textDir === SourceTextDirection . RTL ) cn . push ( "rtl" )
13
15
return cn . join ( " " )
14
16
}
15
17
@@ -31,15 +33,13 @@ const ListCard: React.FunctionComponent<Card.Props> = props => (
31
33
text = { props . item . title }
32
34
filter = { props . filter }
33
35
title
34
- dir = { props . source . textDir }
35
36
/>
36
37
</ h3 >
37
38
{ Boolean ( props . viewConfigs & ViewConfigs . ShowSnippet ) && (
38
39
< p className = "snippet" >
39
40
< Highlights
40
41
text = { props . item . snippet }
41
42
filter = { props . filter }
42
- dir = { props . source . textDir }
43
43
/>
44
44
</ p >
45
45
) }
Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import * as React from "react"
2
2
import { Card } from "./card"
3
3
import CardInfo from "./info"
4
4
import Highlights from "./highlights"
5
+ import { SourceTextDirection } from "../../scripts/models/source"
5
6
6
7
const className = ( props : Card . Props ) => {
7
8
let cn = [ "card" , "magazine-card" ]
8
9
if ( props . item . hasRead ) cn . push ( "read" )
9
10
if ( props . item . hidden ) cn . push ( "hidden" )
11
+ if ( props . source . textDir === SourceTextDirection . RTL ) cn . push ( "rtl" )
10
12
return cn . join ( " " )
11
13
}
12
14
@@ -28,14 +30,12 @@ const MagazineCard: React.FunctionComponent<Card.Props> = props => (
28
30
text = { props . item . title }
29
31
filter = { props . filter }
30
32
title
31
- dir = { props . source . textDir }
32
33
/>
33
34
</ h3 >
34
35
< p className = "snippet" >
35
36
< Highlights
36
37
text = { props . item . snippet }
37
38
filter = { props . filter }
38
- dir = { props . source . textDir }
39
39
/>
40
40
</ p >
41
41
</ div >
You can’t perform that action at this time.
0 commit comments