diff --git a/src/components/ChapterLink.tsx b/src/components/ChapterLink.tsx index 86324bec6..8b50f160b 100644 --- a/src/components/ChapterLink.tsx +++ b/src/components/ChapterLink.tsx @@ -57,14 +57,17 @@ const ChapterLink: React.SFC = ({ chapter }: Props) => ( {chapter.chapterNumber} {chapter.nameSimple} - + + - + {chapter.translatedName.name} diff --git a/src/components/JuzDecoration.tsx b/src/components/JuzDecoration.tsx index 5fcbac0d3..271b05433 100644 --- a/src/components/JuzDecoration.tsx +++ b/src/components/JuzDecoration.tsx @@ -40,7 +40,7 @@ type Props = { const JuzDecoration: React.SFC = ({ juzNumber }: Props) => ( - + جزء @@ -51,7 +51,7 @@ const JuzDecoration: React.SFC = ({ juzNumber }: Props) => ( {JUZ_AND_HIZB_ARABIC_NUMBERS[juzNumber * 2 - 1]} - + ); diff --git a/src/components/JuzLink.tsx b/src/components/JuzLink.tsx index 1d8d9bd5d..05c97a83c 100644 --- a/src/components/JuzLink.tsx +++ b/src/components/JuzLink.tsx @@ -4,6 +4,7 @@ import { Link as RouterLink } from 'react-router-dom'; import { JUZ_LIST_EVENTS } from '../events'; import { ChapterShape } from '../shapes'; import JuzShape from '../shapes/JuzShape'; +import ChapterIcon from './ChapterIcon'; const Name = styled.span` margin-right: 5px; @@ -16,7 +17,6 @@ const Arabic = styled.div` const Translated = styled.div` font-size: 10px; - color: #777; `; const Link = styled(RouterLink)` @@ -28,6 +28,17 @@ const Link = styled(RouterLink)` } `; +const Table = styled.div` + display: table; + width: 100%; +`; + +const TableItem = styled.div<{ width: number }>` + display: table-cell; + vertical-align: middle; + width: ${({ width }) => `${width * 100}%`}; +`; + type Props = { juz: JuzShape; chapters: { [id: string]: ChapterShape }; @@ -43,23 +54,30 @@ const JuzLink: React.SFC = ({ juz, chapters }: Props) => { className="row" {...JUZ_LIST_EVENTS.CLICK.JUZ_LINK.PROPS} > -
- {chapters[chapterId].nameSimple} + + + {chapters[chapterId].nameSimple} - - {juz.verseMapping[chapterId]} - - - - - + + {juz.verseMapping[chapterId]} + + + + + + + + +
- - {chapters[chapterId].translatedName.name} + + + {chapters[chapterId].translatedName.name} + diff --git a/src/components/JuzMarker.tsx b/src/components/JuzMarker.tsx index 41948daa3..36a0c81d7 100644 --- a/src/components/JuzMarker.tsx +++ b/src/components/JuzMarker.tsx @@ -1,11 +1,9 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; -import { Tooltip } from 'react-tippy'; import { JUZ_START } from '../constants'; import JuzDecoration from './JuzDecoration'; import { VerseShape } from '../shapes'; -import T, { KEYS } from './T'; const StyledAyah = styled.div` margin-top: 3%; @@ -29,18 +27,9 @@ export const JuzMarker: React.SFC = ({ return ( - - } - > - - + + {text} diff --git a/src/components/T.tsx b/src/components/T.tsx index fb36d75aa..a30f6726a 100644 --- a/src/components/T.tsx +++ b/src/components/T.tsx @@ -2,6 +2,7 @@ import React, { ReactNode } from 'react'; import PropTypes from 'prop-types'; import { injectIntl, + intlShape, FormattedMessage, InjectedIntlProps, // eslint-disable-line } from 'react-intl'; @@ -11,6 +12,7 @@ import LOCALE_KEYS from '../locale/keys'; type Props = { id: LOCALE_KEYS; values?: { [key: string]: string }; + intl?: $TsFixMe; children?: (...formattedMessage: Array) => ReactNode; }; @@ -20,14 +22,18 @@ const T: React.SFC = ({ id, values, children, + intl, }: Props & InjectedIntlProps) => ( - - {children} - + + + {children} + + ); T.propTypes = { id: PropTypes.string.isRequired, + intl: intlShape.isRequired, values: PropTypes.object, // eslint-disable-line children: PropTypes.node, // eslint-disable-line }; diff --git a/src/components/Word.tsx b/src/components/Word.tsx index 543f36250..fd8bc2b19 100644 --- a/src/components/Word.tsx +++ b/src/components/Word.tsx @@ -96,6 +96,17 @@ class Word extends Component { return title; }; + getLanguageName = () => { + const { word, tooltip } = this.props; + const content = word[tooltip]; + + if (content) { + return content.languageName; + } + + return ''; + }; + handleWordPlay = () => { const { word } = this.props; @@ -143,6 +154,7 @@ class Word extends Component { const className = `${useTextFont ? 'text-' : ''}${word.className} ${ word.charType } ${word.highlight ? word.highlight : ''}`; + const id = `word-${(verseKey || '').replace(/:/, '-')}-${audioPosition}`; if (useTextFont) { @@ -155,12 +167,19 @@ class Word extends Component { text = word.code; } + const tooltipText = this.getTooltipTitle(); + const tooltipHtml = ( +
{tooltipText}
+ ); + return ( ).join(', ')}) Server is now listening on Port ${config('port')} + API URL ${config('api')} + You can access it in the browser at http://${config('host')}:${config( 'port' )}