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

PWA app for NExplorer #117

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d261562
🚀 added PWA install support
rayanfer32 Feb 7, 2022
4883be7
💄 updated icon
rayanfer32 Feb 8, 2022
5a22bb0
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
rayanfer32 Feb 12, 2022
f7015e5
Merge branch 'update-api' of https://github.com/rayanfer32/nexus-expl…
rayanfer32 Feb 15, 2022
db03e42
Merge branch 'feat/component' of https://github.com/rayanfer32/nexus-…
rayanfer32 Feb 18, 2022
8f2cce7
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
rayanfer32 Feb 23, 2022
d4f034a
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
shrivatsabhat Feb 23, 2022
547abad
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
shrivatsabhat Feb 23, 2022
2e9b46d
Merge branch 'next-pwa' of https://github.com/rayanfer32/nexus-explor…
rayanfer32 Feb 23, 2022
0da1edb
🍱 feat: update manifest and icon for the app
shrivatsabhat Feb 24, 2022
cd8636d
Merge branch 'next-pwa' of https://github.com/rayanfer32/nexus-explor…
shrivatsabhat Feb 24, 2022
b7a756e
Merge branch 'develop' into next-pwa
shrivatsabhat Mar 3, 2022
3260301
Merge branch 'develop' into next-pwa
shrivatsabhat Mar 3, 2022
dbab8b2
Merge branch 'develop' into next-pwa
shrivatsabhat Mar 10, 2022
2d2de18
Merge branch 'develop' into next-pwa
shrivatsabhat Mar 11, 2022
a70944b
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
shrivatsabhat Apr 28, 2022
8dfeee5
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
shrivatsabhat May 15, 2022
79d65ff
fix: revert deletion of next-pwa
shrivatsabhat May 15, 2022
1b9efa0
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
shrivatsabhat Jul 11, 2022
0a3d951
Merge branch 'develop' into next-pwa
shrivatsabhat Jul 25, 2022
39308c1
Merge branch 'develop' into next-pwa
rayanfer32 Aug 15, 2022
eebc83c
feat: offline suport for pwa
shrivatsabhat Aug 15, 2022
0529ef5
fix: brand logo on offline
shrivatsabhat Aug 15, 2022
b5cbfd8
Revert "fix: brand logo on offline"
shrivatsabhat Aug 15, 2022
a184303
Update .gitignore
shrivatsabhat Aug 15, 2022
a8a92d5
Merge branch 'develop' into next-pwa
shrivatsabhat Aug 19, 2022
2bf5766
Merge branch 'develop' into next-pwa
shrivatsabhat Sep 8, 2022
ce44f7f
Merge remote-tracking branch 'origin' into next-pwa
shrivatsabhat Sep 28, 2022
873cec5
Merge branch 'develop' of https://github.com/rayanfer32/nexus-explore…
shrivatsabhat Oct 23, 2022
f47139c
Merge branch 'next-pwa' of https://github.com/rayanfer32/nexus-explor…
shrivatsabhat Oct 23, 2022
0b603e5
Merge branch 'develop' into next-pwa
shrivatsabhat Nov 11, 2022
9dc95ff
Merge branch 'develop' into next-pwa
shrivatsabhat Dec 3, 2022
a3d5120
Merge branch 'develop' into next-pwa
shrivatsabhat Jan 14, 2023
aa88d9a
Merge branch 'develop' into next-pwa
shrivatsabhat Jan 26, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ yarn-error.log*

# PWA files
**/public/sw.js
**/public/fallback-*.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
Expand Down
15 changes: 13 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
const path = require('path');

module.exports = {
const withPWA = require('next-pwa');

module.exports = withPWA({
reactStrictMode: true,
sassOptions: {
includePaths: [path.join(__dirname, 'src', 'styles')],
},
};
pwa: {
dest: 'public',
register: true,
skipWaiting: true,
fallbacks: {
image: '/wifi-strike.svg'
},
disable: process.env.NODE_ENV === 'development',
}
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"http-proxy-middleware": "^2.0.6",
"js-cookie": "^3.0.1",
"next": "12.3.0",
"next-pwa": "^5.5.2",
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-apexcharts": "^1.4.0",
Expand Down Expand Up @@ -52,4 +53,4 @@
"prettier --write --ignore-unknown"
]
}
}
}
Binary file added public/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icon-384x384.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "Nexus Explorer",
"short_name": "Nexplorer",
"description": "Nexus Blockchain Explorer V2",
"lang": "en-IN",
"start_url": "/",
"scope": "/",
"display": "standalone",
"orientation": "portrait-primary",
"theme_color": "#0ca4fb",
"background_color": "#012235",
"icons": [
{
"src": "/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
9 changes: 9 additions & 0 deletions public/wifi-strike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/components/Views/Fallback/fallback.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.fallback {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: 50vh;
flex-wrap: wrap;
color: var(--theme-page-text);
h1 {
font-size: var(--font-xxxl, black);
margin-bottom: var(--space-xl, 1rem);
}
small {
color: var(--theme-page-text-secondary, grey);
opacity: 0.6;
}
}
17 changes: 17 additions & 0 deletions src/components/Views/Fallback/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Image from 'next/image';
import styles from './fallback.module.scss';

export const Fallback = () => {
return (
<section className={styles.fallback}>
<Image
src={'/wifi-strike.svg'}
alt="No Internet"
width={150}
height={150}
/>
<h1>Whoops!!</h1>
<small>There seems to be problem with your network connection.</small>
</section>
);
};
68 changes: 67 additions & 1 deletion src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,74 @@ class MyDocument extends Document {
return (
<Html lang="en">
<Head>
<link rel="manifest" href="/manifest.json" />
<link rel="icon" href="/favicon.svg" />
<meta name="theme-color" content={TYPES.COLORS.OCEAN_BLUE} />
<meta name="theme-color" content={TYPES.COLORS.NEXUS_BLUE} />
<meta
name="apple-mobile-web-app-status-bar-style"
content={TYPES.COLORS.NEXUS_BLUE}
/>
<meta
name="msapplication-navbutton-color"
content={TYPES.COLORS.NEXUS_BLUE}
/>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="application-name" content="Nexplorer" />
<meta name="apple-mobile-web-app-title" content="Nexplorer" />
<meta name="msapplication-starturl" content="/" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link
rel="icon"
type="image/png"
sizes="192x192"
href="/icon-192x192.png"
/>
<link
rel="apple-touch-icon"
type="image/png"
sizes="192x192"
href="/icon-192x192.png"
/>
<link
rel="icon"
type="image/png"
sizes="256x256"
href="/icon-256x256.png"
/>
<link
rel="apple-touch-icon"
type="image/png"
sizes="256x256"
href="/icon-256x256.png"
/>
<link
rel="icon"
type="image/png"
sizes="384x384"
href="/icon-384x384.png"
/>
<link
rel="apple-touch-icon"
type="image/png"
sizes="384x384"
href="/icon-384x384.png"
/>
<link
rel="icon"
type="image/png"
sizes="512x512"
href="/icon-512x512.png"
/>
<link
rel="apple-touch-icon"
type="image/png"
sizes="512x512"
href="/icon-512x512.png"
/>
</Head>
<body className={TYPES.THEME.LIGHT}>
<Main />
Expand Down
13 changes: 13 additions & 0 deletions src/pages/_offline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Fallback } from 'components/Views/Fallback';
import PageHeader from 'components/Header/PageHeader';

const fallback = () => {
return (
<>
<PageHeader />
<Fallback />
</>
);
};

export default fallback;
Loading