Skip to content

Commit

Permalink
Upgrade UI library to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjacob committed Aug 13, 2024
1 parent 3742e3f commit 34ba67e
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 68 deletions.
20 changes: 7 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"name": "near-discovery",
"version": "0.1.0",
"private": true,
"engines":
{
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8.5.0"
},
"scripts":
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
Expand All @@ -20,13 +18,12 @@
"commit": "cz",
"ts:check": "tsc --noEmit --incremental"
},
"dependencies":
{
"dependencies": {
"@idos-network/idos-sdk": "^0.0.30",
"@keypom/selector": "1.2.3",
"@monaco-editor/react": "^4.6.0",
"@near-js/biometric-ed25519": "0.3.0",
"@near-pagoda/ui": "^0.3.0",
"@near-pagoda/ui": "^1.0.0",
"@near-wallet-selector/core": "8.9.7",
"@near-wallet-selector/here-wallet": "8.9.7",
"@near-wallet-selector/ledger": "^8.9.7",
Expand Down Expand Up @@ -79,8 +76,7 @@
"typescript": "^5.4.5",
"zustand": "^4.5.2"
},
"devDependencies":
{
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@types/big.js": "^6.2.2",
Expand All @@ -101,10 +97,8 @@
"is-ci": "^3.0.1",
"prettier": "^2.8.8"
},
"config":
{
"commitizen":
{
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
Expand Down
12 changes: 5 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/CookiePrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styled from 'styled-components';

import { useBosComponents } from '@/hooks/useBosComponents';
import { useCookieStore } from '@/stores/cookieData';

import { VmComponent } from './vm/VmComponent';
import { useCookieStore } from '@/stores/cookieData';

const Wrapper = styled.div`
position: fixed;
Expand Down
2 changes: 1 addition & 1 deletion src/components/research-form-wizard/ResearchFormWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Modal from 'react-bootstrap/Modal';
import styled from 'styled-components';

import { useResearchWizardEvents } from '@/hooks/useResearchWizardEvents';
import { useCookieStore } from '@/stores/cookieData';
import { useResearchWizardStore } from '@/stores/researchWizard';
import { recordEventWithProps } from '@/utils/analytics';

import { StepLayout } from './StepLayout';
import { useCookieStore } from '@/stores/cookieData';

const MobileWrapper = styled.div`
width: 276px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/vm/VmInitializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { useEthersProviderContext } from '@/data/web3';
import { useIdOS } from '@/hooks/useIdOS';
import { useSignInRedirect } from '@/hooks/useSignInRedirect';
import { useAuthStore } from '@/stores/auth';
import { useCookieStore } from '@/stores/cookieData';
import { useIdosStore } from '@/stores/idosStore';
import { useVmStore } from '@/stores/vm';
import {
Expand All @@ -54,7 +55,6 @@ import {
import { KEYPOM_OPTIONS } from '@/utils/keypom-options';

import { useNavigationStore } from '../sidebar-navigation/store';
import { useCookieStore } from '@/stores/cookieData';

export default function VmInitializer() {
const [signedIn, setSignedIn] = useState(false);
Expand Down Expand Up @@ -177,7 +177,7 @@ export default function VmInitializer() {
enableWidgetSrcWithCodeOverride: isLocalEnvironment,
},
});
}, [initNear, router.query]);
}, [initNear, router.query, setCookieData]);

useEffect(() => {
if (!near || !idOS) {
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useResearchWizardEvents.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useResearchWizardStore } from '@/stores/researchWizard';
import { useEffect, useState } from 'react';

import { useResearchWizardStore } from '@/stores/researchWizard';

export function useResearchWizardEvents() {
const set = useResearchWizardStore((state) => state.set);
const [showMobileResearchForm, setShowMobileResearchForm] = useState<boolean>(false);
Expand Down
95 changes: 52 additions & 43 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import '@near-wallet-selector/modal-ui/styles.css';
import 'react-bootstrap-typeahead/css/Typeahead.css';
import 'react-bootstrap-typeahead/css/Typeahead.bs5.css';

import { openToast, Toaster } from '@near-pagoda/ui';
import { openToast, PagodaUiProvider, Toaster } from '@near-pagoda/ui';
import Gleap from 'gleap';
import type { AppProps } from 'next/app';
import dynamic from 'next/dynamic';
import Head from 'next/head';
import Link from 'next/link';
import { useRouter } from 'next/router';
import Script from 'next/script';
import { useEffect } from 'react';
Expand All @@ -23,13 +24,13 @@ import { useClickTracking } from '@/hooks/useClickTracking';
import { useHashUrlBackwardsCompatibility } from '@/hooks/useHashUrlBackwardsCompatibility';
import { usePageAnalytics } from '@/hooks/usePageAnalytics';
import { useAuthStore } from '@/stores/auth';
import { useCookieStore } from '@/stores/cookieData';
import { useResearchWizardStore } from '@/stores/researchWizard';
import { init as initializeAnalytics, recordHandledError, setReferrer } from '@/utils/analytics';
import { gleapSdkToken } from '@/utils/config';
import { setNotificationsLocalStorage } from '@/utils/notificationsLocalStorage';
import type { NextPageWithLayout } from '@/utils/types';
import { styleZendesk } from '@/utils/zendesk';
import { useResearchWizardStore } from '@/stores/researchWizard';
import { useCookieStore } from '@/stores/cookieData';

const VmInitializer = dynamic(() => import('../components/vm/VmInitializer'), {
ssr: false,
Expand Down Expand Up @@ -113,53 +114,61 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
} else {
Gleap.showFeedbackButton(true);
}
}, [isResearchFormDismissed, cookieData, gleapSdkToken]);
}, [isResearchFormDismissed, cookieData]);

useEffect(() => {
checkCookieData();
}, [checkCookieData]);

return (
<>
<Head>
<meta name="google-site-verification" content="CDEVFlJTyVZ2vM7ePugKgWsl_7Rd-MrfDv42u0vZ0B0" />
<link rel="icon" href="favicon.ico" />
<link rel="canonical" href={`${process.env.NEXT_PUBLIC_HOSTNAME}${router.asPath}`} key="canonical" />
<link rel="manifest" href="manifest.json" />
</Head>

<Script id="phosphor-icons" src="https://unpkg.com/@phosphor-icons/web" async />

<Script id="bootstrap" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" />

<VmInitializer />

{getLayout(<Component {...pageProps} />)}

<Toaster />

<CookiePrompt />

<ResearchFormWizard />

<div
id="idos_container"
style={
!router.route.startsWith('/settings')
? ({
position: 'absolute',
top: 0,
left: 0,
width: 0,
height: 0,
margin: 0,
padding: 0,
opacity: 0,
overflow: 'hidden',
} as React.CSSProperties)
: undefined
}
/>
<PagodaUiProvider
value={{
routerPrefetch: router.prefetch,
routerPush: router.push,
Link,
}}
>
<Head>
<meta name="google-site-verification" content="CDEVFlJTyVZ2vM7ePugKgWsl_7Rd-MrfDv42u0vZ0B0" />
<link rel="icon" href="favicon.ico" />
<link rel="canonical" href={`${process.env.NEXT_PUBLIC_HOSTNAME}${router.asPath}`} key="canonical" />
<link rel="manifest" href="manifest.json" />
</Head>

<Script id="phosphor-icons" src="https://unpkg.com/@phosphor-icons/web" async />

<Script id="bootstrap" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" />

<VmInitializer />

{getLayout(<Component {...pageProps} />)}

<Toaster />

<CookiePrompt />

<ResearchFormWizard />

<div
id="idos_container"
style={
!router.route.startsWith('/settings')
? ({
position: 'absolute',
top: 0,
left: 0,
width: 0,
height: 0,
margin: 0,
padding: 0,
opacity: 0,
overflow: 'hidden',
} as React.CSSProperties)
: undefined
}
/>
</PagodaUiProvider>
</>
);
}

0 comments on commit 34ba67e

Please sign in to comment.