Skip to content

Commit

Permalink
Update UI for surah's name (ar locale)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x1eef committed Oct 23, 2023
1 parent 05b4abb commit 84cdd13
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
25 changes: 9 additions & 16 deletions src/css/pages/SurahStream.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,21 @@
.content.theme.en {}

.content.theme.ar {
.row.details {
display: none;
place-content: flex-end;
}

.row.dropdown-row {
span.surah-name {
position: relative;
left: 20px;
top: 12px;
.row.details {
justify-content: flex-end;
.localized-name {
display: flex;
flex-direction: column;
width: 180px;
font-size: xx-large;
align-items: center;
font-size: x-large;
align-items: flex-end;
line-height: 30px;
height: 30px;
margin-top: 10px;
}
.transliterated-name {
display: none;
}
}

.row.details {
display: none;
}

ul.body.stream {
Expand Down
7 changes: 0 additions & 7 deletions src/css/themes/blue/pages/_SurahStream.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,4 @@

.root .content.theme.blue.ar {
@import "themes/blue/colors";

.row.dropdown-row {
line-height: 30px;
span.surah-name {
color: lighten($gold1, 25%);
}
}
}
9 changes: 0 additions & 9 deletions src/css/themes/green/pages/_SurahStream.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,4 @@

.root .content.theme.green.ar {
@import "themes/green/colors";

.row.dropdown-row {
.surah-name {
color: lighten($green1, 15%);
}
}

ul.body.stream {
}
}
14 changes: 7 additions & 7 deletions src/js/pages/SurahStream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function SurahStream({ node, recitations, locale, paused, t }: Props) {
);
const readyToRender = stream.length > 0;
const ayah = stream[stream.length - 1];
const hasCompactLayout = ["ar"].includes(locale);
const ref = useRef<HTMLDivElement>();

useEffect(() => {
Expand All @@ -63,17 +62,18 @@ function SurahStream({ node, recitations, locale, paused, t }: Props) {
</a>
<div className="row dropdown-row">
<ThemeSelect theme={theme} setTheme={setTheme} />
{hasCompactLayout && (
<span className="surah-name">{surah.localizedName}</span>
)}
<LanguageSelect locale={locale} path={surah.slug} />
</div>
</>
)}
{readyToRender && !hasCompactLayout && (
{readyToRender && (
<div className="row details">
<span lang={locale}>{surah.localizedName}</span>
<span lang="en">{surah.transliteratedName}</span>
<span className="localized-name" lang={locale}>
{surah.localizedName}
</span>
<span className="transliterated-name" lang="en">
{surah.transliteratedName}
</span>
</div>
)}
{readyToRender && (
Expand Down

0 comments on commit 84cdd13

Please sign in to comment.