Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

feat: Featured Apps Widget #3789

Merged
merged 7 commits into from
Apr 19, 2022
Merged

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Apr 12, 2022

What it solves

Part of #3693

How this PR fixes it

Adds a widget to display featured apps in the dashboard. Layout will be done in a separate PR.

How to test it

  1. Open the Safe app
  2. Select a Safe
  3. Observe a widget that displays Transaction Builder and WalletConnect apps in the dashboard

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Apr 12, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@github-actions
Copy link

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

return (
<>
{featuredApps.map((app) => {
const appRoute = generateSafeRoute(SAFE_ROUTES.APPS, routesSlug) + `?appUrl=${app.url}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you extract this to a function? It will probably use useful in the other Safe Apps widget.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

`

// TODO: Replace once tags are available
const featuredAppIds = ['29', '11']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tags are available on staging. Can we use them here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I switched over to filter by tags and removed the hard-coded ids. We still need to update the type in the gateway sdk. For the time being I extended the type here.

`

// TODO: Replace with type from gateway-sdk once available
type SafeAppWithTags = SafeApp & { tags: string[] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice to see you extend the type here but we should do this in the gateway types first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw that its already there in v2.10.3. Will update the dependency and remove this type.

const { allApps } = useAppList()
const { address } = useSelector(currentSafe) ?? {}
const featuredApps = useMemo(
() => allApps.filter((app) => (app as SafeAppWithTags).tags?.includes('dashboard-widgets')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By updating the gateway tiypes, you won't need to cast this.

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@DiogoSoaress DiogoSoaress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@usame-algan usame-algan merged commit 2686fa6 into epic-dashboard Apr 19, 2022
@usame-algan usame-algan deleted the dashboard-featured-apps branch April 19, 2022 12:14
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants