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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 1.9.2

This update rebrands Family Accounts as Aave Account and includes a configuration option rename that may require changes in your app configuration.

## Updated

- Replaced `family` dependency with `@aave/account`.
- Updated branding and UI to reflect Aave Account.
- Renamed `enableFamily` option to `enableAaveAccount` in `getDefaultConfig` and `getDefaultConnectors`. Update your usage of these helpers accordingly when upgrading to 1.9.2.

# 1.9.1

This update includes updates to the peer dependencies and improvements to the Family Accounts features.
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<img width="1080" alt="connectkit" src="https://github.com/family/connectkit/assets/1930210/87c2e868-3228-44b8-82c3-a38adf6d1bbf">
</a>



# ConnectKit

ConnectKit is a powerful [React](https://reactjs.org/) component library for connecting a wallet to your dApp. It supports the most popular connectors and chains out of the box and provides a beautiful, seamless experience.
Expand All @@ -23,11 +21,11 @@ Get started with a ConnectKit + [wagmi](https://wagmi.sh/) + [viem](https://viem

## Documentation

You can find the full ConnectKit documentation in the Family docs [here](https://docs.family.co/connectkit).
You can find the full ConnectKit documentation in the docs [here](https://docs.family.co/connectkit).

## API Reference

You can find the full API Reference in the Family docs [here](https://docs.family.co/connectkit/api-reference).
You can find the full API Reference in the docs [here](https://docs.family.co/connectkit/api-reference).

## Examples

Expand Down Expand Up @@ -74,7 +72,7 @@ Before starting on anything, please have a read through our [Contribution Guidel

## Twitter

Follow [@family](https://twitter.com/family) on Twitter for the latest updates on ConnectKit.
Follow [@aave](https://twitter.com/aave) on Twitter for the latest updates on ConnectKit.

## License

Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-app/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Providers } from './providers';

export const metadata: Metadata = {
title: 'ConnectKit Next.js Example',
description: 'By Family',
description: 'By Aave',
};

export default function RootLayout(props: { children: ReactNode }) {
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-siwe/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Next.js](https://nextjs.org/) + [TypeScript](https://www.typescriptlang.org/) + [SIWE](https://login.xyz/) + ConnectKit Example

This is a simple example of how to implement ConnectKit with [Next.js](https://nextjs.org/) and [SIWE](https://docs.family.co/connectkit/authentication) in TypeScript. This example is based on the [SIWE with Next.js documentation](https://docs.family.co/connectkit/auth-with-nextjs) provided by Family.
This is a simple example of how to implement ConnectKit with [Next.js](https://nextjs.org/) and [SIWE](https://docs.family.co/connectkit/authentication) in TypeScript. This example is based on the [SIWE with Next.js documentation](https://docs.family.co/connectkit/auth-with-nextjs).

## Running the example

Expand Down
4 changes: 2 additions & 2 deletions examples/testbench/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Testbench for ConnectKit",
"iconPath": "app.png",
"providedBy": {
"name": "Family",
"url": "https://family.co"
"name": "Aave",
"url": "https://aave.com"
}
}
2 changes: 1 addition & 1 deletion examples/testbench/src/components/Web3Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ckConfig = getDefaultConfig({
appName: 'ConnectKit testbench',
appIcon: '/app.png',
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!,
//enableFamily: false,
//enableAaveAccount: false,
});
const customConfig = {
...ckConfig,
Expand Down
2 changes: 1 addition & 1 deletion examples/testbench/src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class CustomDocument extends Document {
return (
<Html>
<Head>
<link rel="icon" href="https://family.co/favicon.png" />
<link rel="icon" href="https://aave.com/favicon.png" />
<link
href="https://fonts.cdnfonts.com/css/pt-root-ui"
rel="stylesheet"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "family-connectkit",
"name": "aave-connectkit",
"version": "0.0.0",
"description": "Family ConnectKit.",
"description": "Aave ConnectKit",
"main": "packages/connectkit/src/index.ts",
"private": true,
"workspaces": [
Expand Down
4 changes: 2 additions & 2 deletions packages/connectkit-next-siwe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ yarn add siwe connectkit-next-siwe

## 2. Configure

You can find the full configuration documentation for this package in the Family docs [here](https://docs.family.co/connectkit/auth-with-nextjs).
You can find the full configuration documentation for this package in the docs [here](https://docs.family.co/connectkit/auth-with-nextjs).

## Contribute

Before starting on anything, please have a read through our [Contribution Guidelines](https://github.com/family/connectkit/blob/main/CONTRIBUTING.md).

## Twitter

Follow [@family](https://twitter.com/family) on Twitter for the latest updates on ConnectKit.
Follow [@aave](https://twitter.com/aave) on Twitter for the latest updates on ConnectKit.

## License

Expand Down
3 changes: 2 additions & 1 deletion packages/connectkit-next-siwe/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "connectkit-next-siwe",
"version": "0.3.0",
"author": "Family",
"author": "Aave",
"homepage": "https://docs.family.co/connectkit",
"license": "BSD-2-Clause license",
"description": "Connecting a wallet, made simple.",
Expand Down Expand Up @@ -32,6 +32,7 @@
"blockchain",
"hooks",
"family",
"aave",
"ethereum",
"react"
],
Expand Down
7 changes: 4 additions & 3 deletions packages/connectkit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "connectkit",
"version": "1.9.1",
"author": "Family",
"version": "1.9.2",
"author": "Aave",
"homepage": "https://docs.family.co/connectkit",
"license": "BSD-2-Clause license",
"description": "Connecting a wallet, made simple.",
Expand Down Expand Up @@ -35,13 +35,14 @@
"blockchain",
"hooks",
"family",
"aave",
"ethereum",
"react"
],
"dependencies": {
"@aave/account": "^0.2.0",
"buffer": "^6.0.3",
"detect-browser": "^5.3.0",
"family": "^0.1.2",
"framer-motion": "^6.3.11",
"qrcode": "^1.5.0",
"react-transition-state": "^1.1.4",
Expand Down
35 changes: 8 additions & 27 deletions packages/connectkit/src/assets/logos.tsx

Large diffs are not rendered by default.

19 changes: 5 additions & 14 deletions packages/connectkit/src/components/Common/ConnectorList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,19 @@ import {
} from '../../../utils';
import { useLastConnector } from '../../../hooks/useLastConnector';
import { useConnect } from '../../../hooks/useConnect';
import {
useFamilyAccountsConnector,
useFamilyConnector,
} from '../../../hooks/useConnectors';
import { isFamily } from '../../../utils/wallets';
import { useAaveAccountConnector } from '../../../hooks/useConnectors';

const ConnectorList = () => {
const context = useContext();
const isMobile = useIsMobile();

const wallets = useWallets();
const { lastConnectorId } = useLastConnector();
const familyConnector = useFamilyConnector();
const familyAccountsConnector = useFamilyAccountsConnector();
const aaveAccountConnector = useAaveAccountConnector();

let filteredWallets = wallets.filter(
(wallet) => wallet.id !== familyAccountsConnector?.id
(wallet) => wallet.id !== aaveAccountConnector?.id
);
if (familyConnector && isFamily()) {
filteredWallets = filteredWallets.filter(
(wallet) => wallet.id !== familyConnector?.id
);
}

const walletsToDisplay =
context.options?.hideRecentBadge || lastConnectorId === 'walletConnect' // do not hoist walletconnect to top of list
Expand Down Expand Up @@ -122,7 +112,8 @@ const ConnectorItem = ({
// Safari requires opening popup on user gesture, so we connect immediately here
const shouldConnectImmediately =
(detectBrowser() === 'safari' || detectBrowser() === 'ios') &&
(isCoinbaseWalletConnector(wallet.connector.id) || isPortoConnector(wallet.connector.id));
(isCoinbaseWalletConnector(wallet.connector.id) ||
isPortoConnector(wallet.connector.id));

if (redirectToMoreWallets || shouldConnectImmediately) deeplink = undefined; // mobile redirects to more wallets page

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {
ButtonContainer,
InnerContainer,
IconContainer,
ButtonContainerInner,
} from './styles';
import FitText from '../FitText';
import useLocales from '../../../hooks/useLocales';

const Logo = () => (
<svg
width="27"
height="15"
viewBox="0 0 27 15"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.85405 13.9979C11.3617 13.9979 12.5838 12.7757 12.5838 11.2681C12.5838 9.76047 11.3617 8.5383 9.85405 8.5383C8.34643 8.5383 7.12427 9.76047 7.12427 11.2681C7.12427 12.7757 8.34643 13.9979 9.85405 13.9979Z"
fill="currentColor"
/>
<path
d="M16.8534 13.9979C18.3611 13.9979 19.5832 12.7757 19.5832 11.2681C19.5832 9.76047 18.3611 8.5383 16.8534 8.5383C15.3458 8.5383 14.1237 9.76047 14.1237 11.2681C14.1237 12.7757 15.3458 13.9979 16.8534 13.9979Z"
fill="currentColor"
/>
<path
d="M13.4193 0C6.00734 0 -0.00193968 6.12375 4.69662e-07 13.6754H3.42824C3.42824 8.01604 7.866 3.42759 13.4193 3.42759C18.9727 3.42759 23.4104 8.01604 23.4104 13.6754H26.8387C26.84 6.12375 20.8307 0 13.4193 0Z"
fill="currentColor"
/>
</svg>
);

export const ContinueWithAaveButton = ({
onClick,
}: {
onClick: () => void;
}) => {
const locales = useLocales();
return (
<ButtonContainer onClick={onClick}>
<ButtonContainerInner>
<IconContainer>
<Logo />
</IconContainer>
<InnerContainer>
<FitText>{locales.continueWithAave}</FitText>
</InnerContainer>
</ButtonContainerInner>
</ButtonContainer>
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { motion } from 'framer-motion';
import styled from './../../../styles/styled';
import styled from '../../../styles/styled';

export const ButtonContainerInner = styled(motion.div)`
display: flex;
Expand All @@ -10,16 +10,13 @@ export const ButtonContainerInner = styled(motion.div)`
`;
export const ButtonContainer = styled.button`
--color: #ffffff;
--background: var(--ck-family-accounts-brand);
--background: var(--ck-aave-brand);
--box-shadow: var(--ck-primary-button-box-shadow);
--border-radius: var(--ck-primary-button-border-radius);
--font-weight: var(--ck-primary-button-font-weight, 500);

--hover-color: var(--ck-button-primary-hover-color, var(--color));
--hover-background: var(
--ck-primary-button-hover-background,
var(--background)
);
--hover-background: var(--ck-aave-brand);
--hover-box-shadow: var(
--ck-primary-button-hover-box-shadow,
var(--box-shadow)
Expand Down Expand Up @@ -52,6 +49,10 @@ export const ButtonContainer = styled.button`
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
will-change: transform, box-shadow, background-color, color;

&:hover {
background: var(--hover-background);
}
`;

export const InnerContainer = styled.div`
Expand All @@ -67,9 +68,9 @@ export const IconContainer = styled.div`
position: relative;
display: inline-block;
vertical-align: middle;
max-width: 20px;
max-height: 20px;
margin: 0 12px 0 0;
max-width: 27px;
max-height: 27px;
margin: 0 8px 0 0;
svg {
display: block;
position: relative;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ export const ThemeContainer = styled.button`
}
}
&:focus-visible {
outline: 2px solid var(--ck-family-brand);
outline: 2px solid var(--ck-aave-brand);
}
`;
8 changes: 0 additions & 8 deletions packages/connectkit/src/components/ConnectKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
useConnectCallback,
useConnectCallbackProps,
} from '../hooks/useConnectCallback';
import { isFamily } from '../utils/wallets';
import { useConnector } from '../hooks/useConnectors';
import { WagmiContext, useAccount } from 'wagmi';
import { Web3ContextProvider } from './contexts/web3';
Expand Down Expand Up @@ -212,13 +211,6 @@ export const ConnectKitProvider = ({
}
}, [isConnected, isChainSupported, chain, route, open]);

// Autoconnect to Family wallet if available
useEffect(() => {
if (isFamily()) {
injectedConnector?.connect();
}
}, [injectedConnector]);

const log = debugMode ? console.log : () => {};

const value = {
Expand Down
Loading
Loading