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

Enhancement added - Now copy Ayah feature includes Surah and Ayah number #647

Merged
merged 5 commits into from
Mar 12, 2017
Merged
Show file tree
Hide file tree
Changes from 3 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=http://quran.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, can we make this staging again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

ONE_QURAN_URL=http://localhost:3030
SEGMENTS_KEY=
SENTRY_KEY_CLIENT=
Expand Down
6 changes: 4 additions & 2 deletions src/components/Copy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import LocaleFormattedMessage from 'components/LocaleFormattedMessage';

export default class Copy extends Component {
static propTypes = {
text: PropTypes.string.isRequired
text: PropTypes.string.isRequired,
verseKey: PropTypes.string.isRequired,
}

state = {
isCopied: false
};

handleCopy = () => {
copyToClipboard(this.props.text);
copyToClipboard(`${this.props.text} - ${this.props.verseKey}`);
this.setState({ isCopied: true });

setTimeout(() => this.setState({ isCopied: false }), 1000);
Expand All @@ -36,4 +37,5 @@ export default class Copy extends Component {
</a>
);
}

}
5 changes: 3 additions & 2 deletions src/components/Verse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class Verse extends Component {
currentVerse: PropTypes.string
};


static defaultProps = {
currentWord: null,
isSearched: false
Expand Down Expand Up @@ -181,11 +182,11 @@ export default class Verse extends Component {
}

renderCopyLink() {
const { isSearched, verse: { textMadani } } = this.props;
const { isSearched, verse } = this.props;

if (!isSearched) {
return (
<Copy text={textMadani} />
<Copy text={verse.textMadani} verseKey={verse.verseKey} />
);
}

Expand Down