Refactored intl messages.

This commit is contained in:
Mike Cao 2023-01-25 07:42:46 -08:00
parent fbccf4d3af
commit 7725b5c129
44 changed files with 558 additions and 485 deletions

View file

@ -1,7 +1,10 @@
import { TextArea } from 'react-basics';
import { TRACKER_SCRIPT_URL } from 'lib/constants';
import { messages } from 'components/messages';
import { useIntl } from 'react-intl';
export default function TrackingCode({ websiteId }) {
const { formatMessage } = useIntl();
const url = TRACKER_SCRIPT_URL.startsWith('http')
? TRACKER_SCRIPT_URL
: `${location.origin}${TRACKER_SCRIPT_URL}`;
@ -10,10 +13,7 @@ export default function TrackingCode({ websiteId }) {
return (
<>
<p>
To track stats for this website, place the following code in the <code>&lt;head&gt;</code>{' '}
section of your HTML.
</p>
<p>{formatMessage(messages.trackingCode)}</p>
<TextArea rows={4} value={code} readOnly allowCopy />
</>
);