Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dev): remove old AuthContext usage #1026

Merged
merged 1 commit into from
May 4, 2022
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
4 changes: 2 additions & 2 deletions astro_2.0/features/DaoFeatureInfo/DaoFeatureInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Settings } from 'types/settings';

import { IconName } from 'components/Icon';

import { useAuthContext } from 'context/AuthContext';
import { useWalletContext } from 'context/WalletContext';
import { SputnikHttpService } from 'services/sputnik';
import { NOTIFICATION_TYPES, showNotification } from 'features/notifications';

Expand All @@ -34,7 +34,7 @@ export const DaoFeatureInfo: FC<Props> = ({
description,
control,
}) => {
const { accountId, nearService } = useAuthContext();
const { accountId, nearService } = useWalletContext();
const isMounted = useMountedState();
const [showInfo, setShowInfo] = useState(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { ConfigCard } from 'astro_2.0/features/pages/myAccount/cards/ConfigCard'
import { VoteCreditRow } from 'astro_2.0/features/pages/myAccount/cards/VoteCreditCard/components/VoteCreditRow';

import { SputnikHttpService } from 'services/sputnik';
import { useAuthContext } from 'context/AuthContext';
import { useWalletContext } from 'context/WalletContext';

import { DaoFeedItem } from 'types/dao';

import styles from './VoteCreditCard.module.scss';

export const VoteCreditCard: FC = () => {
const isMounted = useMountedState();
const { accountId } = useAuthContext();
const { accountId } = useWalletContext();
const [accountDaos, setAccountDaos] = useState<DaoFeedItem[]>([]);

const [{ loading }, getDaosList] = useAsyncFn(async () => {
Expand Down
11 changes: 2 additions & 9 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ACCOUNT_COOKIE } from 'constants/cookies';
import { useRouter } from 'next/router';

type Props = {
account: string | undefined;
account: string | null;
};

export default function RootPage({ account }: Props): JSX.Element {
Expand All @@ -38,14 +38,7 @@ export const getServerSideProps: GetServerSideProps = async ({
['common', 'notificationsPage'],
nextI18NextConfig
)),
account,
account: account || null,
},
};
};
/*
export const getServerSideProps: GetServerSideProps = async ctx => {
return {
props: {}
};
};
*/