Merge pull request #1939 from gnosis/feature/#1682-custom-app

Link to docs from "Add custom app"
This commit is contained in:
Mati Dastugue 2021-02-24 16:54:45 -03:00 committed by GitHub
commit 3f413cf86c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2397 additions and 1630 deletions

View File

@ -28,7 +28,7 @@ export const useSafeScheduledUpdates = (safeLoaded: boolean, safeAddress?: strin
}) })
if (mounted) { if (mounted) {
timer.current = setTimeout(() => { timer.current = window.setTimeout(() => {
fetchSafeData(address) fetchSafeData(address)
}, TIMEOUT * 3) }, TIMEOUT * 3)
} }

View File

@ -5,6 +5,7 @@ import styled from 'styled-components'
import { SafeApp } from 'src/routes/safe/components/Apps/types.d' import { SafeApp } from 'src/routes/safe/components/Apps/types.d'
import GnoForm from 'src/components/forms/GnoForm' import GnoForm from 'src/components/forms/GnoForm'
import Img from 'src/components/layout/Img' import Img from 'src/components/layout/Img'
import { Icon, Link, Text } from '@gnosis.pm/safe-react-components'
import AppAgreement from './AppAgreement' import AppAgreement from './AppAgreement'
import AppUrl, { AppInfoUpdater, appUrlResolver } from './AppUrl' import AppUrl, { AppInfoUpdater, appUrlResolver } from './AppUrl'
@ -29,6 +30,16 @@ const AppInfo = styled.div`
margin-right: 10px; margin-right: 10px;
} }
` `
const AppDocsInfo = styled.div`
display: flex;
margin-bottom: 10px;
flex-direction: column;
svg {
position: relative;
top: 4px;
left: 4px;
}
`
export interface AddAppFormValues { export interface AddAppFormValues {
appUrl: string appUrl: string
@ -66,6 +77,22 @@ const AddApp = ({ appList, closeModal }: AddAppProps): ReactElement => {
<GnoForm decorators={[appUrlResolver]} initialValues={INITIAL_VALUES} onSubmit={handleSubmit} testId={FORM_ID}> <GnoForm decorators={[appUrlResolver]} initialValues={INITIAL_VALUES} onSubmit={handleSubmit} testId={FORM_ID}>
{() => ( {() => (
<> <>
<AppDocsInfo>
<Text size="xl" as="span" color="secondary">
Safe Apps are third-party extensions.
</Text>
<Link
href="https://docs.gnosis.io/safe/docs/sdks_safe_apps/"
target="_blank"
rel="noreferrer"
title="Learn more about building Safe Apps"
>
<Text size="xl" as="span" color="primary">
Learn more about building Safe Apps.
</Text>
<Icon size="sm" type="externalLink" color="primary" />
</Link>
</AppDocsInfo>
<AppUrl appList={appList} /> <AppUrl appList={appList} />
{/* Fetch app from url and return a SafeApp */} {/* Fetch app from url and return a SafeApp */}

View File

@ -119,7 +119,7 @@ const AppFrame = ({ appUrl }: Props): React.ReactElement => {
useEffect(() => { useEffect(() => {
if (appIsLoading) { if (appIsLoading) {
timer.current = setTimeout(() => { timer.current = window.setTimeout(() => {
setAppTimeout(true) setAppTimeout(true)
}, TIMEOUT) }, TIMEOUT)
} else { } else {

3996
yarn.lock

File diff suppressed because it is too large Load Diff