@@ -15,7 +15,7 @@ import { Config } from "../../config/store";
1515import { isCaptchaAvailable } from "../../controllers/captcha-controller" ;
1616import QuotesController , { Quote } from "../../controllers/quotes-controller" ;
1717import * as DB from "../../db" ;
18- import { isAuthenticated } from "../../firebase " ;
18+ import { isLoggedIn } from "../../states/core " ;
1919import { hideLoaderBar , showLoaderBar } from "../../states/loader-bar" ;
2020import {
2121 hideModalAndClearChain ,
@@ -100,12 +100,12 @@ function getLengthDesc(quote: Quote): string {
100100function Item ( props : {
101101 quote : Quote ;
102102 matchedTerms : string [ ] ;
103- dataBalloonDirection : string ;
103+ isRtl : boolean ;
104104 onSelect : ( ) => void ;
105105 onReport : ( ) => void ;
106106 onToggleFavorite : ( ) => Promise < boolean > ;
107107} ) : JSXElement {
108- const loggedOut = ( ) : boolean => ! isAuthenticated ( ) ;
108+ const loggedOut = ( ) : boolean => ! isLoggedIn ( ) ;
109109 const [ isFav , setIsFav ] = createSignal (
110110 // oxlint-disable-next-line solid/reactivity -- intentionally reading once as initial value
111111 ! loggedOut ( ) && QuotesController . isQuoteFavorite ( props . quote ) ,
@@ -169,7 +169,7 @@ function Item(props: {
169169 } }
170170 balloon = { {
171171 text : "Report quote" ,
172- position : props . dataBalloonDirection as "left" | "right ",
172+ position : props . isRtl ? "right" : "left ",
173173 } }
174174 />
175175 < Button
@@ -184,7 +184,7 @@ function Item(props: {
184184 } }
185185 balloon = { {
186186 text : "Favorite quote" ,
187- position : props . dataBalloonDirection as "left" | "right ",
187+ position : props . isRtl ? "right" : "left ",
188188 } }
189189 />
190190 </ div >
@@ -213,7 +213,7 @@ export function QuoteSearchModal(): JSXElement {
213213 quotes : Quote [ ] ;
214214 matchedTerms : string [ ] ;
215215 } > ( { quotes : [ ] , matchedTerms : [ ] } ) ;
216- const [ dataBalloonDirection , setDataBalloonDirection ] = createSignal ( "left" ) ;
216+ const [ isRtl , setIsRtl ] = createSignal ( false ) ;
217217 const [ favVersion , setFavVersion ] = createSignal ( 0 ) ;
218218
219219 const debouncedSearch = debounce ( 250 , ( text : string ) => {
@@ -374,7 +374,7 @@ export function QuoteSearchModal(): JSXElement {
374374
375375 const handleAfterShow = async ( ) : Promise < void > => {
376376 const quotesLanguage = await getLanguage ( Config . language ) ;
377- setDataBalloonDirection ( quotesLanguage ?. rightToLeft ? "right" : "left" ) ;
377+ setIsRtl ( quotesLanguage ?. rightToLeft ?? false ) ;
378378 const { quotes : fetchedQuotes } = await QuotesController . getQuotes (
379379 Config . language ,
380380 ) ;
@@ -455,7 +455,7 @@ export function QuoteSearchModal(): JSXElement {
455455 < div class = "flex flex-col justify-between gap-2 sm:flex-row" >
456456 < div class = "text-2xl text-sub" > Quote search</ div >
457457 < div class = "grid gap-2" >
458- < Show when = { isAuthenticated ( ) } >
458+ < Show when = { isLoggedIn ( ) } >
459459 < Button
460460 fa = { { icon : "fa-plus" } }
461461 text = "Submit a quote"
@@ -509,7 +509,7 @@ export function QuoteSearchModal(): JSXElement {
509509 } }
510510 />
511511 </ div >
512- < Show when = { isAuthenticated ( ) } >
512+ < Show when = { isLoggedIn ( ) } >
513513 < Button
514514 variant = "button"
515515 fa = { { icon : "fa-heart" , fixedWidth : true } }
@@ -518,13 +518,16 @@ export function QuoteSearchModal(): JSXElement {
518518 />
519519 </ Show >
520520 </ div >
521- < div class = "grid content-baseline gap-2 overflow-y-auto" dir = "auto" >
521+ < div
522+ class = "grid content-baseline gap-2 overflow-y-auto"
523+ dir = { isRtl ( ) ? "rtl" : undefined }
524+ >
522525 < For each = { pageQuotes ( ) } >
523526 { ( quote ) => (
524527 < Item
525528 quote = { quote }
526529 matchedTerms = { searchResults ( ) . matchedTerms }
527- dataBalloonDirection = { dataBalloonDirection ( ) }
530+ isRtl = { isRtl ( ) }
528531 onSelect = { ( ) => applyQuote ( quote . id ) }
529532 onReport = { ( ) => showQuoteReportModal ( quote . id ) }
530533 // oxlint-disable-next-line solid/reactivity, typescript-eslint/promise-function-async -- fire-and-forget, no reactive tracking needed
0 commit comments