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

DApp-1877 reward points thumbnail #1883

Closed
wants to merge 6 commits into from
Closed
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"jsbi": "3.2.1",
"puppeteer": "^23.4.1",
"typescript": "^5.2.2",
"vite": "^5.2.7",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-plugin-prerender": "^1.0.8",
"vite-plugin-require": "^1.1.14",
"vite-plugin-svgr": "^4.2.0",
"vite-plugin-top-level-await": "^1.4.1",
Expand Down
Binary file added public/previews/rewardsPreview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 22 additions & 21 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

// Internal Components
import App from './App';
import ErrorContextProvider from './contexts/ErrorContext';
Expand All @@ -33,26 +32,28 @@ const previewBasePath = getPreviewBasePath();
const queryClient = new QueryClient({});

ReactDOM.createRoot(document.getElementById('root')!).render(
<BrowserRouter basename={previewBasePath || publicURL}>
<Provider store={store}>
<GlobalContextProvider>
<Web3OnboardProvider web3Onboard={web3Onboard}>
<ErrorContextProvider>
<RewardsContextProvider>
<AppContextProvider>
<VideoCallContextProvider>
<QueryClientProvider client={queryClient}>
<App />
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
</VideoCallContextProvider>
</AppContextProvider>
</RewardsContextProvider>
</ErrorContextProvider>
</Web3OnboardProvider>
</GlobalContextProvider>
</Provider>
</BrowserRouter>
<HelmetProvider>
<BrowserRouter basename={previewBasePath || publicURL}>
<Provider store={store}>
<GlobalContextProvider>
<Web3OnboardProvider web3Onboard={web3Onboard}>
<ErrorContextProvider>
<RewardsContextProvider>
<AppContextProvider>
<VideoCallContextProvider>
<QueryClientProvider client={queryClient}>
<App />
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
</VideoCallContextProvider>
</AppContextProvider>
</RewardsContextProvider>
</ErrorContextProvider>
</Web3OnboardProvider>
</GlobalContextProvider>
</Provider>
</BrowserRouter>
</HelmetProvider>
);

// If you want your app to work offline and load faster, you can change
Expand Down
1 change: 0 additions & 1 deletion src/pages/RewardPointsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//components
import { Rewards } from 'modules/rewards';
import { ContentLayout } from 'common';

Expand Down
8 changes: 7 additions & 1 deletion src/structure/MasterInterfacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ function MasterInterfacePage() {
path={APP_PATHS.WelcomeDashboard}
element={<WelcomDashboardPage />}
/>

{rewardsPointsPagePaths.map((path, index) => (
<Route
path={path}
Expand Down Expand Up @@ -282,7 +283,12 @@ function MasterInterfacePage() {

<Route
path={APP_PATHS.YieldV2}
element={<Navigate to={APP_PATHS.Yield} replace />}
element={
<Navigate
to={APP_PATHS.Yield}
replace
/>
}
/>
<Route
path={APP_PATHS.Yield}
Expand Down
77 changes: 77 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import vitePluginRequire from 'vite-plugin-require';
import svgr from 'vite-plugin-svgr';
import topLevelAwait from 'vite-plugin-top-level-await';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import vitePrerender from 'vite-plugin-prerender';
// @ts-expect-error
import { getPreviewBasePath } from './basePath';

Expand Down Expand Up @@ -53,6 +54,8 @@ if (localSDKLinking) {
};
}

const { PuppeteerRenderer } = vitePrerender;

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
Expand All @@ -74,6 +77,80 @@ export default defineConfig({
}),
nodePolyfills(),
vitePluginRequire.default(),
// vitePrerender({
// staticDir: path.join(__dirname, 'build'),
// outputDir: path.join(__dirname, 'prerendered'),
// indexPath: path.join(__dirname, 'build', 'index.html'),
// routes: ['/points', '/points/activity', '/points/leaderboard'], // Add your points route here
// postProcess(renderedRoute) {
// // Add specific meta tags for the /points route
// if (
// renderedRoute.route === '/points' ||
// renderedRoute.route === '/points/activity' ||
// renderedRoute.route === '/points/leaderboard'
// ) {
// const metaTags = `
// <meta
// property="og:url"
// content="https://push-protocol.github.io/push-dapp/pr-preview/pr-1833/points"
// />
// <meta
// property="og:type"
// content="website"
// />
// <meta
// property="og:title"
// content="Push App (Previously EPNS)"
// />
// <meta
// property="og:description"
// content="Push App (Previously EPNS) | Communication Protocol of Web3"
// />
// <meta
// property="og:image"
// content="https://push-protocol.github.io/push-dapp/pr-preview/pr-1833/previews/rewardsPreview.png"
// />
// <meta
// name="twitter:card"
// content="summary_large_image"
// />
// <meta
// property="twitter:domain"
// content="https://push-protocol.github.io/push-dapp/pr-preview/pr-1833/points"
// />
// <meta
// property="twitter:url"
// content="https://push-protocol.github.io/push-dapp/pr-preview/pr-1833/points"
// />
// <meta
// name="twitter:title"
// content="Push App (Previously EPNS)"
// />
// <meta
// name="twitter:description"
// content="Push App (Previously EPNS) | Communication Protocol of Web3"
// />
// <meta
// name="twitter:image"
// content="https://push-protocol.github.io/push-dapp/pr-preview/pr-1833/previews/rewardsPreview.png"
// />
// `;
// renderedRoute.html = renderedRoute.html.replace('</head>', `${metaTags}</head>`);
// }
// renderedRoute.route = renderedRoute.originalRoute;
// return renderedRoute;
// },
// minify: {
// collapseBooleanAttributes: true,
// collapseWhitespace: true,
// },
// server: {
// port: 3000,
// },
// renderer: new Renderer({
// headless: true,
// }),
// }),
],
define: {
global: 'globalThis',
Expand Down
Loading
Loading