This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* useCustomApps * move error check to the useAppList hook * use custom field to check if the app is custom * add comment for filter * Feature: Pinned Safe Apps section (#2793) * Added GA event to pin and unpin Safe Apps (#2840)
- Loading branch information
Showing
21 changed files
with
757 additions
and
420 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import axios from 'axios' | ||
import { getNetworkId } from 'src/config' | ||
import { ETHEREUM_NETWORK } from 'src/config/networks/network' | ||
import { CONFIG_SERVICE_URL } from 'src/utils/constants' | ||
|
||
export type AppData = { | ||
export type RemoteAppData = { | ||
id: number | ||
url: string | ||
name?: string | ||
disabled?: boolean | ||
description?: string | ||
networks: ETHEREUM_NETWORK[] | ||
custom?: boolean | ||
name: string | ||
iconUrl: string | ||
description: string | ||
chainIds: number[] | ||
} | ||
|
||
enum Endpoints { | ||
SAFE_APPS = '/safe-apps/', | ||
} | ||
|
||
export const fetchSafeAppsList = async (): Promise<AppData[]> => { | ||
export const fetchSafeAppsList = async (): Promise<RemoteAppData[]> => { | ||
const networkId = getNetworkId() | ||
return axios.get(`${CONFIG_SERVICE_URL}${Endpoints['SAFE_APPS']}?chainId=${networkId}`).then(({ data }) => data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 14 additions & 11 deletions
25
src/routes/safe/components/Apps/components/AppCard/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import AppCard from './index' | ||
|
||
import AddAppIcon from 'src/routes/safe/components/Apps/assets/addApp.svg' | ||
import { FETCH_STATUS } from 'src/utils/requests' | ||
import { getEmptySafeApp } from '../../utils' | ||
import { AppCard, AddCustomAppCard } from './index' | ||
|
||
export default { | ||
title: 'Apps/AppCard', | ||
component: AppCard, | ||
} | ||
|
||
export const Loading = (): React.ReactElement => <AppCard isLoading /> | ||
export const Loading = (): React.ReactElement => <AppCard to="" app={getEmptySafeApp()} /> | ||
|
||
export const AddCustomApp = (): React.ReactElement => ( | ||
<AppCard iconUrl={AddAppIcon} onClick={console.log} buttonText="Add custom app" /> | ||
) | ||
export const AddCustomApp = (): React.ReactElement => <AddCustomAppCard onClick={(): void => {}} /> | ||
|
||
export const LoadedApp = (): React.ReactElement => ( | ||
<AppCard | ||
iconUrl="https://cryptologos.cc/logos/versions/gnosis-gno-gno-logo-circle.svg?v=007" | ||
name="Gnosis" | ||
description="Gnosis safe app" | ||
onClick={console.log} | ||
to="" | ||
app={{ | ||
id: '228', | ||
url: '', | ||
name: 'Gnosis', | ||
iconUrl: 'https://cryptologos.cc/logos/versions/gnosis-gno-gno-logo-circle.svg?v=007', | ||
description: 'Gnosis safe app', | ||
fetchStatus: FETCH_STATUS.SUCCESS, | ||
}} | ||
/> | ||
) |
Oops, something went wrong.