Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 packages/react-scripts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/react-scripts/scripts/utils/frontierInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function installFrontierDependencies(appPath, appName, answers, ownPath) {
'@fs/zion-testing-library',
'eslint@5.12.0',
'i18next-scanner@2.10.0',
'@alienfast/i18next-loader@1.0.18',
'react-styleguidist@9.0.4',
'webpack@4.28.3',
'jest-dom@3.1.3',
Expand Down
10 changes: 7 additions & 3 deletions packages/react-scripts/template/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Router, Link, NotFound, RequiresAuth } from '@fs/router'
import { Router, Link, NotFound, RequiresAuth } from '@fs/zion-router'
import Subnav from '@fs/zion-subnav'
import { Trans } from 'react-i18next'
import Home from './home/Home'
Expand All @@ -9,8 +9,12 @@ function App() {
return (
<>
<Subnav>
<Link to="/"><Trans i18nkey="nav.home">Home</Trans></Link>
<Link to="user"><Trans i18nkey="nav.userInfo">User Info</Trans></Link>
<Link to="/">
<Trans i18nKey="nav.home">Home</Trans>
</Link>
<Link to="user">
<Trans i18nKey="nav.userInfo">User Info</Trans>
</Link>
</Subnav>

<Router>
Expand Down
36 changes: 19 additions & 17 deletions packages/react-scripts/template/src/components/home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ const Home = () => (
css={css`
text-align: center;
`}
>
<HomeHeader>
<Logo />
<p>
<Trans i18nkey="update.instructions">Edit <code>src/components/App.js</code> and save to reload.</Trans>
</p>
<a
css={css`
>
<HomeHeader>
<Logo />
<p>
<Trans i18nKey="update.instructions">
Edit <code>src/components/App.js</code> and save to reload.
</Trans>
</p>
<a
css={css`
color: #61dafb;
`}
href="https://www.familysearch.org/frontier/docs/#/"
target="_blank"
rel="noopener noreferrer"
>
<Trans i18nkey="learn.frontier">Learn Frontier</Trans>
</a>
</HomeHeader>
</div>
)
href="https://www.familysearch.org/frontier/docs/#/"
target="_blank"
rel="noopener noreferrer"
>
<Trans i18nKey="learn.frontier">Learn Frontier</Trans>
</a>
</HomeHeader>
</div>
)

export default Home
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { render } from '@fs/testing-library'
import { render } from '@fs/zion-testing-library'
import Home from './Home'

test('renders with Learn Frontier on the page', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { css } from '@emotion/core'
import { i18n } from '@fs/locale'
import { i18n } from '@fs/zion-locale'
import logo from './Logo.svg'

const styles = css`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import { useUser } from '@fs/user'
import { useUser } from '@fs/zion-user'
import { useTranslation } from 'react-i18next'

export default function UserInfo() {
const user = useUser()
const { t } = useTranslation()
return <div>{t('user.greeting', 'Hello, {{user.displayName}}!')}</div>
return <div>{t('user.greeting', { user, defaultValue: 'Hello, {{user.displayName}}!' })}</div>
}
6 changes: 3 additions & 3 deletions packages/react-scripts/template/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Suspense } from 'react'
import ReactDOM from 'react-dom'
import { UserProvider } from '@fs/user'
import RootErrorBoundary from '@fs/error-boundary'
import { I18nProvider, addTranslations } from '@fs/locale'
import { UserProvider } from '@fs/zion-user'
import RootErrorBoundary from '@fs/zion-error-boundary'
import { I18nProvider, addTranslations } from '@fs/zion-locale'
import App from './components/App'
import * as serviceWorker from './serviceWorker'
import translations from './locales'
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/template/src/locales/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// This file is intentionally blank, used as a mount point to load the locales
// This file is intentionally blank, used as a mount point to load the locales
2 changes: 1 addition & 1 deletion packages/react-scripts/template/src/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
import { cleanup } from '@fs/testing-library'
import { cleanup } from '@fs/zion-testing-library'
import 'jest-dom/extend-expect'

afterEach(cleanup)