Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged

Juz tab #1071

Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NODE_ENV=development
PORT=8000
API_URL=http://staging.quran.com:3000
API_URL=https://staging.quran.com:3000
ONE_QURAN_URL=http://localhost:3030
SEGMENTS_KEY=
SENTRY_KEY_CLIENT=
Expand Down
7 changes: 5 additions & 2 deletions src/components/ChapterLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,17 @@ const ChapterLink: React.SFC<Props> = ({ chapter }: Props) => (
{chapter.chapterNumber}
</TableItem>
<TableItem width={7 / 12}>{chapter.nameSimple}</TableItem>
<TableItem width={3 / 12} className="text-left">
<TableItem width={3 / 12}>
<Arabic>
<ChapterIcon id={String(chapter.id)} />
</Arabic>
</TableItem>
</Table>

<Translated>
<span className={`text-uppercase ${''}`}>
<span
className={`text-uppercase ${chapter.translatedName.languageName}`}
>
{chapter.translatedName.name}
</span>
</Translated>
Expand Down
50 changes: 34 additions & 16 deletions src/components/JuzLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,7 +17,6 @@ const Arabic = styled.div`

const Translated = styled.div`
font-size: 10px;
color: #777;
`;

const Link = styled(RouterLink)`
Expand All @@ -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 };
Expand All @@ -43,23 +54,30 @@ const JuzLink: React.SFC<Props> = ({ juz, chapters }: Props) => {
className="row"
{...JUZ_LIST_EVENTS.CLICK.JUZ_LINK.PROPS}
>
<div className="col-xs-9">
<Name>{chapters[chapterId].nameSimple}</Name>
<Table>
<TableItem width={9 / 12}>
<Name>{chapters[chapterId].nameSimple}</Name>

<span className="h5">
<small>{juz.verseMapping[chapterId]}</small>
</span>
</div>
<Arabic className="col-xs-3 text-left">
<span className={`icon-surah${chapters[chapterId].id}`} />
</Arabic>
<span className="h5">
<small>{juz.verseMapping[chapterId]}</small>
</span>
</TableItem>

<TableItem width={3 / 12}>
<Arabic>
<ChapterIcon id={String(chapterId)} />
</Arabic>
</TableItem>
</Table>

<Translated
className={`col-xs-10 text-uppercase ${
chapters[chapterId].languageName
}`}
>
<small>{chapters[chapterId].translatedName.name}</small>
<Translated>
<span
className={`text-uppercase ${
chapters[chapterId].translatedName.languageName
}`}
>
{chapters[chapterId].translatedName.name}
</span>
</Translated>
</Link>
</Translated>
Expand Down
12 changes: 9 additions & 3 deletions src/components/T.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -11,6 +12,7 @@ import LOCALE_KEYS from '../locale/keys';
type Props = {
id: LOCALE_KEYS;
values?: { [key: string]: string };
intl?: $TsFixMe;
children?: (...formattedMessage: Array<string | JSX.Element>) => ReactNode;
};

Expand All @@ -20,14 +22,18 @@ const T: React.SFC<Props> = ({
id,
values,
children,
intl,
}: Props & InjectedIntlProps) => (
<FormattedMessage id={id} defaultMessage={en.messages[id]} values={values}>
{children}
</FormattedMessage>
<span className={`${intl.messages.local}`}>
<FormattedMessage id={id} defaultMessage={en.messages[id]} values={values}>
{children}
</FormattedMessage>
</span>
);

T.propTypes = {
id: PropTypes.string.isRequired,
intl: intlShape.isRequired,
values: PropTypes.object, // eslint-disable-line
children: PropTypes.node, // eslint-disable-line
};
Expand Down
2 changes: 2 additions & 0 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ const listener = app.listen(config('port'), () =>
).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'
)}
Expand Down