Skip to content

Commit

Permalink
Release latest to Stage (#988)
Browse files Browse the repository at this point in the history
* Add French translation and set the language selection (#978)

* should be almost set

* dropdown styling

* done with translation

* nits here and there

* Apply suggestions from code review

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* missing translations

* add locale with dayjs

* lingui extract

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>

* Fix design nits (#987)

* setup warning

* colors

* icon

* buttons

* dropdown menu 14

* images

* nits

* title too big and switch buttons order

* Apply suggestions from code review

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* update link closes #849

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Michael Yankelev <myankelev@gmail.com>

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
  • Loading branch information
3 people authored Apr 27, 2021
1 parent c60b181 commit 4e362c8
Show file tree
Hide file tree
Showing 25 changed files with 947 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const MenuDropdown: React.FC<IMenuDropdownProps> = ({
{title && (
<Typography
component="p"
variant="body2"
variant="body1"
className={classNames?.titleText}
>
{title}
Expand Down
2 changes: 1 addition & 1 deletion packages/files-ui/.linguirc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"formatOptions": {
"origins": false
},
"locales": ["en"],
"locales": ["en", "fr"],
"sourceLocale": "en"
}
112 changes: 60 additions & 52 deletions packages/files-ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react"
import React, { useCallback, useEffect } from "react"
import { init as initSentry, ErrorBoundary, showReportDialog } from "@sentry/react"
import { Web3Provider } from "@chainsafe/web3-context"
import { ImployApiProvider, UserProvider, BillingProvider } from "@chainsafe/common-contexts"
Expand All @@ -25,13 +25,42 @@ if (
environment: process.env.REACT_APP_SENTRY_ENV
})
}

const availableLanguages = [
{ id: "en", label: "English" },
{ id: "fr", label: "Français" }
]

const onboardConfig = {
dappId: process.env.REACT_APP_BLOCKNATIVE_ID || "",
walletSelect: {
wallets: [
{ walletName: "coinbase" },
{
walletName: "trust",
rpcUrl:
"https://mainnet.infura.io/v3/a7e16429d2254d488d396710084e2cd3"
},
{ walletName: "metamask", preferred: true },
{ walletName: "authereum" },
{ walletName: "opera" },
{ walletName: "operaTouch" },
{ walletName: "torus" },
{ walletName: "status" },
{
walletName: "walletConnect",
infuraKey: "a7e16429d2254d488d396710084e2cd3",
preferred: true
}
]
}
}

const App: React.FC<{}> = () => {
const { initHotjar } = useHotjar()
const { canUseLocalStorage } = useLocalStorage()
const hotjarId = process.env.REACT_APP_HOTJAR_ID
const apiUrl =
process.env.REACT_APP_API_URL || "https://stage.imploy.site/api/v1"

const apiUrl = process.env.REACT_APP_API_URL || "https://stage.imploy.site/api/v1"
// This will default to testnet unless mainnet is specifically set in the ENV
const directAuthNetwork = (process.env.REACT_APP_DIRECT_AUTH_NETWORK === "mainnet") ? "mainnet" : "testnet"

Expand All @@ -41,64 +70,43 @@ const App: React.FC<{}> = () => {
}
}, [hotjarId, initHotjar])

const fallBack = useCallback(({ error, componentStack, eventId, resetError }) => (
<Modal
active
closePosition="none"
setActive={resetError}
>
<Typography>
An error occurred and has been logged. If you would like to
provide additional info to help us debug and resolve the issue,
click the `&quot;`Provide Additional Details`&quot;` button
</Typography>
<Typography>{error?.message.toString()}</Typography>
<Typography>{componentStack}</Typography>
<Typography>{eventId}</Typography>
<Button
onClick={() => showReportDialog({ eventId: eventId || "" })}
>
Provide Additional Details
</Button>
<Button onClick={resetError}>Reset error</Button>
</Modal>
), [])

return (
<ThemeSwitcher
storageKey="csf.themeKey"
themes={{ light: lightTheme, dark: darkTheme }}
>
<ErrorBoundary
fallback={({ error, componentStack, eventId, resetError }) => (
<Modal
active
closePosition="none"
setActive={resetError}
>
<Typography>
An error occurred and has been logged. If you would like to
provide additional info to help us debug and resolve the issue,
click the `&quot;`Provide Additional Details`&quot;` button
</Typography>
<Typography>{error?.message.toString()}</Typography>
<Typography>{componentStack}</Typography>
<Typography>{eventId}</Typography>
<Button
onClick={() => showReportDialog({ eventId: eventId || "" })}
>
Provide Additional Details
</Button>
<Button onClick={resetError}>Reset error</Button>
</Modal>
)}
fallback={fallBack}
onReset={() => window.location.reload()}
>
<LanguageProvider availableLanguages={[{ id: "en", label: "English" }]}>
<CssBaseline />
<CssBaseline />
<LanguageProvider availableLanguages={availableLanguages}>
<ToasterProvider autoDismiss>
<Web3Provider
onboardConfig={{
dappId: process.env.REACT_APP_BLOCKNATIVE_ID || "",
walletSelect: {
wallets: [
{ walletName: "coinbase" },
{
walletName: "trust",
rpcUrl:
"https://mainnet.infura.io/v3/a7e16429d2254d488d396710084e2cd3"
},
{ walletName: "metamask", preferred: true },
{ walletName: "authereum" },
{ walletName: "opera" },
{ walletName: "operaTouch" },
{ walletName: "torus" },
{ walletName: "status" },
{
walletName: "walletConnect",
infuraKey: "a7e16429d2254d488d396710084e2cd3",
preferred: true
}
]
}
}}
onboardConfig={onboardConfig}
checkNetwork={false}
cacheWalletSelection={canUseLocalStorage}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/files-ui/src/Components/Elements/MnemonicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const useStyles = makeStyles(({ animation, constants, palette, zIndex }: CSFThem
width: 35,
marginLeft: constants.generalUnit * 3,
"&.active": {
fill: palette.success.main
fill: palette.primary.main
}
},
loader: {
Expand Down Expand Up @@ -160,7 +160,7 @@ const MnemonicForm = ({ buttonLabel, onComplete }: Props) => {
<div className={clsx(classes.copiedFlag, { "active": copied })}>
<span>
<Trans>
Copied!
Copied!
</Trans>
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/files-ui/src/Components/FilesRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ROUTE_LINKS = {
Terms: "https://files.chainsafe.io/terms-of-service",
ChainSafe: "https://chainsafe.io/",
// TODO: update link
ApplyCryptography: "https://chainsafe.io/",
ApplyCryptography: "https://medium.com/chainsafe-systems/major-improvement-to-chainsafe-files-ab489d3e52a2",
Home: (path?: string) => `/home${path ? `?path=${path}` : ""}`,
Search: (search?: string) => `/search${search ? `?search=${search}` : ""}`,
Bin: "/bin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
>
<Trans>General</Trans>
</Typography>
{fullFileInfo.persistent?.uploaded ? (
{fullFileInfo.persistent?.uploaded && (
<div className={classes.subInfoBox}>
<Typography
variant="body1"
Expand All @@ -222,8 +222,8 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
{fullFileInfo.persistent?.uploaded}
</Typography>
</div>
) : null}
{fullFileInfo.content?.size !== undefined ? (
)}
{fullFileInfo.content?.size !== undefined && (
<div className={classes.subInfoBox}>
<Typography
variant="body1"
Expand All @@ -239,7 +239,7 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
{formatBytes(fullFileInfo.content?.size)}
</Typography>
</div>
) : null}
)}
</div>
<div className={classes.technicalContainer}>
<Typography
Expand All @@ -249,7 +249,7 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
>
<Trans>Technical</Trans>
</Typography>
{fullFileInfo.persistent?.stored_cid !== undefined ? (
{fullFileInfo.persistent?.stored_cid !== undefined && (
<div className={classes.subInfoBox}>
<Typography
variant="body1"
Expand All @@ -265,8 +265,8 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
{fullFileInfo.persistent?.stored_cid}
</Typography>
</div>
) : null}
{fullFileInfo.persistent?.stored_cid !== undefined ? (
)}
{fullFileInfo.persistent?.stored_cid !== undefined && (
<div className={classes.subInfoBox}>
<Typography
variant="body1"
Expand All @@ -282,7 +282,7 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
{fullFileInfo.persistent?.stored_cid}
</Typography>
</div>
) : null}
)}
<div className={classes.subInfoBox}>
<Grid
item
Expand All @@ -294,7 +294,7 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
>
<Trans>CID (Content Identifier)</Trans>
</Typography>
{copied ? (
{copied && (
<Typography
variant="body2"
component="p"
Expand All @@ -303,9 +303,9 @@ const FileInfoModal: React.FC<IFileInfoModuleProps> = ({
classes.copiedContainer
)}
>
<Trans>copied !</Trans>
<Trans>copied!</Trans>
</Typography>
) : null}
)}
</Grid>
<Typography
className={classes.subSubtitle}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ const FilesTableView = ({
</TableCell>
<TableCell align="left">
{uploadInProgress.noOfFiles > 1
? `Uploading ${uploadInProgress.noOfFiles} files`
? t`Uploading ${uploadInProgress.noOfFiles} files`
: uploadInProgress.fileName}
</TableCell>
<TableCell />
Expand Down
16 changes: 8 additions & 8 deletions packages/files-ui/src/Components/Modules/FilePreviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,37 +303,37 @@ const FilePreviewModal = ({ file, nextFile, previousFile, closePreview, path }:
menuItems={[
// {
// contents: (
// <Fragment>
// <>
// <ExportIcon className={classes.menuIcon} />
// <span>Move</span>
// </Fragment>
// </>
// ),
// onClick: () => console.log,
// },
// {
// contents: (
// <Fragment>
// <>
// <ShareAltIcon className={classes.menuIcon} />
// <span>Share</span>
// </Fragment>
// </>
// ),
// onClick: () => console.log,
// },
// {
// contents: (
// <Fragment>
// <>
// <EditIcon className={classes.menuIcon} />
// <span>Rename</span>
// </Fragment>
// </>
// ),
// onClick: () => console.log,
// },
// {
// contents: (
// <Fragment>
// <>
// <DeleteIcon className={classes.menuIcon} />
// <span>Delete</span>
// </Fragment>
// </>
// ),
// onClick: () => console.log,
// },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ const useStyles = makeStyles(({ breakpoints, constants, typography, palette, zIn
[breakpoints.down("md")]: {
marginTop: constants.generalUnit * 3
}
},
title: {
fontWeight: 400,
marginBottom: constants.generalUnit * 2.5,
[breakpoints.down("md")]: {
...typography.h4
}
}
})
)
Expand All @@ -109,8 +116,9 @@ const AuthenticationFactors = ({ goToComplete, goToMnemonic, goToPassword, goToS
return (
<div className={clsx(classes.root, className)}>
<Typography
variant={desktop ? "h2" : "h4"}
component="h1"
variant="h2"
component="h2"
className={classes.title}
>
<Trans>
Your Authentication Factors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const useStyles = makeStyles(({ breakpoints, constants, palette, zIndex }: CSFTh
color: constants.loginModule.completeBg,
backgroundColor: constants.loginModule.completeText,
"&:hover": {
backgroundColor: palette.success.main,
color: constants.loginModule.completeBg
backgroundColor: palette.primary.main,
color: palette.common.white.main
}
}
})
Expand Down Expand Up @@ -99,7 +99,7 @@ const Complete = ({ className }: IComplete) => {
</Typography>
<Typography
component="p"
variant="body2"
variant="body1"
>
<Trans>
Thanks for taking care of that. You can <br/> adjust these anytime in security settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const ConciseExplainer: React.FC<IConciseExplainerProps> = ({ className, onConti
className={classes.subtitle}
>
<Trans>
For security reasons, upon signing in we’ll ask you for one of the following to confirm your identity.
For security reasons, each time you sign in we’ll ask you for one of the following to confirm your identity.
</Trans>
&nbsp;
<a
Expand Down Expand Up @@ -158,7 +158,7 @@ const ConciseExplainer: React.FC<IConciseExplainerProps> = ({ className, onConti
alt="password and keys"
/>
<Typography component="p">
<Trans>Enter a password</Trans>
<Trans>Enter password</Trans>
</Typography>
</div>
<div className={classes.imageBox}>
Expand Down
Loading

0 comments on commit 4e362c8

Please sign in to comment.